Skip to content
Open
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
4 changes: 2 additions & 2 deletions clang/lib/Headers/__clang_cuda_libdevice_declares.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ __DEVICE__ float __nv_modff(float __a, float *__b);
__DEVICE__ int __nv_mul24(int __a, int __b);
__DEVICE__ long long __nv_mul64hi(long long __a, long long __b);
__DEVICE__ int __nv_mulhi(int __a, int __b);
__DEVICE__ double __nv_nan(const signed char *__a);
__DEVICE__ float __nv_nanf(const signed char *__a);
__DEVICE__ double __nv_nan(const char *__a);
__DEVICE__ float __nv_nanf(const char *__a);
__DEVICE__ double __nv_nearbyint(double __a);
__DEVICE__ float __nv_nearbyintf(float __a);
__DEVICE__ double __nv_nextafter(double __a, double __b);
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Headers/__clang_cuda_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ __DEVICE__ int max(int __a, int __b) { return __nv_max(__a, __b); }
__DEVICE__ int min(int __a, int __b) { return __nv_min(__a, __b); }
__DEVICE__ double modf(double __a, double *__b) { return __nv_modf(__a, __b); }
__DEVICE__ float modff(float __a, float *__b) { return __nv_modff(__a, __b); }
__DEVICE__ float nanf(const char *__a) { return __nv_nanf(__a); }
__DEVICE__ double nan(const char *__a) { return __nv_nan(__a); }
__DEVICE__ double nearbyint(double __a) { return __builtin_nearbyint(__a); }
__DEVICE__ float nearbyintf(float __a) { return __builtin_nearbyintf(__a); }
__DEVICE__ double nextafter(double __a, double __b) {
Expand Down
2 changes: 2 additions & 0 deletions clang/test/Headers/Inputs/include/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ long lround(double __a);
long lroundf(float __a);
double modf(double __a, double *__b);
float modff(float __a, float *__b);
float nanf(const char *__a);
double nan(const char *__a);
double nearbyint(double __a);
float nearbyintf(float __a);
double nextafter(double __a, double __b);
Expand Down
4 changes: 4 additions & 0 deletions clang/test/Headers/nvptx_device_cmath_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ void test_sqrt(double a1) {
double l4 = fabs(a1);
// CHECK-YES: call noundef i32 @__nv_abs(i32
double l5 = abs((int)a1);
// CHECK-YES: call noundef float @__nv_nanf(ptr noundef
float l6 = nanf("");
// CHECK-YES: call noundef double @__nv_nan(ptr noundef
double l7 = nan("");
}
}
4 changes: 4 additions & 0 deletions clang/test/Headers/nvptx_device_math_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ void test_sqrt(double a1) {
double l4 = fabs(a1);
// CHECK-YES: call noundef i32 @__nv_abs(i32
double l5 = abs((int)a1);
// CHECK-YES: call noundef float @__nv_nanf(ptr noundef
float l6 = nanf("");
// CHECK-YES: call noundef double @__nv_nan(ptr noundef
double l7 = nan("");
}
}
Loading