From de81ddf0440fdaea9e889c284b5eb1f0896277f4 Mon Sep 17 00:00:00 2001 From: Namjae Choi Date: Thu, 16 Jul 2026 17:21:08 -0600 Subject: [PATCH] Manually implement nearbyint() for Kokkos SYCL backend --- src/utilities/include/metaphysicl/metaphysicl_math.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/utilities/include/metaphysicl/metaphysicl_math.h b/src/utilities/include/metaphysicl/metaphysicl_math.h index 9107281..88ee54b 100644 --- a/src/utilities/include/metaphysicl/metaphysicl_math.h +++ b/src/utilities/include/metaphysicl/metaphysicl_math.h @@ -18,6 +18,18 @@ #include #include +#if defined (METAPHYSICL_KOKKOS_COMPILATION) && defined(KOKKOS_ENABLE_SYCL) +namespace Kokkos +{ +template +KOKKOS_INLINE_FUNCTION +T nearbyint(T x) +{ + return rint(x); +} +} +#endif + namespace MetaPhysicL { namespace math {