Skip to content

Commit c096ffe

Browse files
committed
[SYCL][HIP] add missing nearbyint and rint
1 parent 814290d commit c096ffe

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

libdevice/cmath_wrapper.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,14 @@ DEVICE_EXTERN_C_INLINE
200200
float rintf(float x) { return __nv_rintf(x); }
201201
#endif // __NVPTX__
202202

203+
#ifdef __AMDGCN__
204+
extern "C" SYCL_EXTERNAL float __ocml_nearbyint_f32(float);
205+
DEVICE_EXTERN_C_INLINE
206+
float nearbyintf(float x) { return __ocml_nearbyint_f32(x); }
207+
208+
extern "C" SYCL_EXTERNAL float __ocml_rint_f32(float);
209+
DEVICE_EXTERN_C_INLINE
210+
float rintf(float x) { return __ocml_rint_f32(x); }
211+
#endif // __AMDGCN__
212+
203213
#endif // __SPIR__ || __SPIRV__ || __NVPTX__ || __AMDGCN__

0 commit comments

Comments
 (0)