Skip to content

[SYCL][CUDA] Add missing nearbyint #11177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions libdevice/cmath_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,11 @@ float asinhf(float x) { return __devicelib_asinhf(x); }

DEVICE_EXTERN_C_INLINE
float atanhf(float x) { return __devicelib_atanhf(x); }

#ifdef __NVPTX__
extern "C" SYCL_EXTERNAL float __nv_nearbyintf(float);
DEVICE_EXTERN_C_INLINE
float nearbyintf(float x) { return __nv_nearbyintf(x); }
#endif // __NVPTX__

#endif // __SPIR__ || __NVPTX__
6 changes: 6 additions & 0 deletions libdevice/cmath_wrapper_fp64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ double atanh(double x) { return __devicelib_atanh(x); }
DEVICE_EXTERN_C_INLINE
double scalbn(double x, int exp) { return __devicelib_scalbn(x, exp); }

#ifdef __NVPTX__
extern "C" SYCL_EXTERNAL double __nv_nearbyint(double);
DEVICE_EXTERN_C_INLINE
double nearbyint(double x) { return __nv_nearbyint(x); }
#endif // __NVPTX__

#if defined(_MSC_VER)
#include <math.h>
// FLOAT PROPERTIES
Expand Down