From ae44aeb995bc061a79f3964e0d82a071d17aab4a Mon Sep 17 00:00:00 2001 From: Michael Aziz Date: Wed, 27 May 2026 12:27:49 -0400 Subject: [PATCH] Disambiguate `nextafter` Signed-off-by: Michael Aziz --- util/math_reference.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/math_reference.cpp b/util/math_reference.cpp index 9a38dd285..f2218bbd9 100644 --- a/util/math_reference.cpp +++ b/util/math_reference.cpp @@ -519,7 +519,8 @@ sycl::half fdim(sycl::half a, sycl::half b) { double resd = static_cast(a) - static_cast(b); sycl::half res = static_cast(resd); double diff = resd - static_cast(res); - sycl::half next = nextafter(res, static_cast(DBL_MAX * diff)); + sycl::half next = + reference::nextafter(res, static_cast(DBL_MAX * diff)); if (static_cast(next) - resd == diff) { int16_t rep; type_punn(next, rep); @@ -532,7 +533,8 @@ sycl::half fdim(sycl::half a, sycl::half b) { sycl::half fract(sycl::half a, sycl::half* b) { *b = std::floor(a); - return std::fmin(a - *b, nextafter(sycl::half(1.0), sycl::half(0.0))); + return std::fmin(a - *b, + reference::nextafter(sycl::half(1.0), sycl::half(0.0))); } sycl::half nan(unsigned short a) { return nan(unsigned(a)); }