Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions util/math_reference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,8 @@ sycl::half fdim(sycl::half a, sycl::half b) {
double resd = static_cast<double>(a) - static_cast<double>(b);
sycl::half res = static_cast<sycl::half>(resd);
double diff = resd - static_cast<double>(res);
sycl::half next = nextafter(res, static_cast<sycl::half>(DBL_MAX * diff));
sycl::half next =
reference::nextafter(res, static_cast<sycl::half>(DBL_MAX * diff));
if (static_cast<double>(next) - resd == diff) {
int16_t rep;
type_punn(next, rep);
Expand All @@ -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)); }
Expand Down
Loading