Skip to content

Commit

Permalink
[SYCL] Use std::numeric_limits::quiet_NaN instead of NAN macro (intel…
Browse files Browse the repository at this point in the history
…#11197)

The latter needs `<cmath>`/`<math.h>` that pollutes global namespace.
  • Loading branch information
aelovikov-intel authored Sep 20, 2023
1 parent b6b0cf4 commit a254a68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sycl/include/sycl/ext/intel/math/imf_half_trivial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ sycl::half hmax(sycl::half x, sycl::half y) { return sycl::fmax(x, y); }

sycl::half hmax_nan(sycl::half x, sycl::half y) {
if (hisnan(x) || hisnan(y))
return sycl::half(NAN);
return sycl::half(std::numeric_limits<float>::quiet_NaN());
else
return sycl::fmax(x, y);
}
Expand All @@ -269,7 +269,7 @@ sycl::half hmin(sycl::half x, sycl::half y) { return sycl::fmin(x, y); }

sycl::half hmin_nan(sycl::half x, sycl::half y) {
if (hisnan(x) || hisnan(y))
return sycl::half(NAN);
return sycl::half(std::numeric_limits<float>::quiet_NaN());
else
return sycl::fmin(x, y);
}
Expand Down

0 comments on commit a254a68

Please sign in to comment.