Skip to content

Commit 68acb46

Browse files
committed
[SYCL][HIP] fix: support nearbyint and rint fp64
1 parent c096ffe commit 68acb46

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

libdevice/cmath_wrapper_fp64.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,16 @@ DEVICE_EXTERN_C_INLINE
190190
double rint(double x) { return __nv_rint(x); }
191191
#endif // __NVPTX__
192192

193+
#ifdef __AMDGCN__
194+
extern "C" SYCL_EXTERNAL double __ocml_nearbyint_f64(double);
195+
DEVICE_EXTERN_C_INLINE
196+
double nearbyintf(double x) { return __ocml_nearbyint_f64(x); }
197+
198+
extern "C" SYCL_EXTERNAL double __ocml_rint_f64(double);
199+
DEVICE_EXTERN_C_INLINE
200+
double rintf(double x) { return __ocml_rint_f64(x); }
201+
#endif // __AMDGCN__
202+
193203
#if defined(_MSC_VER)
194204
#include <math.h>
195205
// FLOAT PROPERTIES

0 commit comments

Comments
 (0)