Skip to content

Commit 7ae4303

Browse files
authored
Use sycl::rint rather than std::rint to resolve failed tests on Nvidia hardware (#1700)
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
1 parent 1de00cb commit 7ae4303

File tree

1 file changed

+1
-1
lines changed
  • dpctl/tensor/libtensor/include/kernels/elementwise_functions

1 file changed

+1
-1
lines changed

dpctl/tensor/libtensor/include/kernels/elementwise_functions/round.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ template <typename argT, typename resT> struct RoundFunctor
8181
private:
8282
template <typename T> T round_func(const T &input) const
8383
{
84-
return std::rint(input);
84+
return sycl::rint(input);
8585
}
8686
};
8787

0 commit comments

Comments
 (0)