Skip to content

Commit af3ed63

Browse files
Use std::isnan instead of sycl::isnan is extended-order comparators
Sorting test were failing for complex128 types on capable Intel GPU devices. Change from sycl::isnan to std::isnan fixes these failures.
1 parent 0ab003d commit af3ed63

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

dpctl/tensor/libtensor/source/sorting/sorting_common.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ template <typename fpT> struct ExtendedRealFPLess
4141
/* [R, nan] */
4242
bool operator()(const fpT v1, const fpT v2) const
4343
{
44-
return (!sycl::isnan(v1) && (sycl::isnan(v2) || (v1 < v2)));
44+
return (!std::isnan(v1) && (std::isnan(v2) || (v1 < v2)));
4545
}
4646
};
4747

4848
template <typename fpT> struct ExtendedRealFPGreater
4949
{
5050
bool operator()(const fpT v1, const fpT v2) const
5151
{
52-
return (!sycl::isnan(v2) && (sycl::isnan(v1) || (v2 < v1)));
52+
return (!std::isnan(v2) && (std::isnan(v1) || (v2 < v1)));
5353
}
5454
};
5555

@@ -64,14 +64,14 @@ template <typename cT> struct ExtendedComplexFPLess
6464
const realT real1 = std::real(v1);
6565
const realT real2 = std::real(v2);
6666

67-
const bool r1_nan = sycl::isnan(real1);
68-
const bool r2_nan = sycl::isnan(real2);
67+
const bool r1_nan = std::isnan(real1);
68+
const bool r2_nan = std::isnan(real2);
6969

7070
const realT imag1 = std::imag(v1);
7171
const realT imag2 = std::imag(v2);
7272

73-
const bool i1_nan = sycl::isnan(imag1);
74-
const bool i2_nan = sycl::isnan(imag2);
73+
const bool i1_nan = std::isnan(imag1);
74+
const bool i2_nan = std::isnan(imag2);
7575

7676
const int idx1 = ((r1_nan) ? 2 : 0) + ((i1_nan) ? 1 : 0);
7777
const int idx2 = ((r2_nan) ? 2 : 0) + ((i2_nan) ? 1 : 0);

0 commit comments

Comments
 (0)