Skip to content

Commit

Permalink
Use sycl::rint rather than std::rint to resolve failed tests on N…
Browse files Browse the repository at this point in the history
…vidia hardware

When compiled for CUDA, `std::rint` would incorrectly round values halfway between two integers toward 0, rather than to the nearest even number as required per array API.

`sycl::rint` avoids such issues by not relying on the current rounding mode
  • Loading branch information
ndgrigorian committed May 29, 2024
1 parent 1de00cb commit d8705a2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ template <typename argT, typename resT> struct RoundFunctor
private:
template <typename T> T round_func(const T &input) const
{
return std::rint(input);
return sycl::rint(input);
}
};

Expand Down

0 comments on commit d8705a2

Please sign in to comment.