summaryrefslogtreecommitdiffstats
path: root/clang/lib/Headers/__clang_cuda_cmath.h
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2017-01-05 16:53:55 +0000
committerJustin Lebar <jlebar@google.com>2017-01-05 16:53:55 +0000
commit11d5116904d8a51edd22861001d7a31b9aec870a (patch)
treea4b886c8354765612d853d9557861eeb867d6e5a /clang/lib/Headers/__clang_cuda_cmath.h
parent86c4e63ff97466f4a4fec3ab79f4ae23d6289052 (diff)
downloadbcm5719-llvm-11d5116904d8a51edd22861001d7a31b9aec870a.tar.gz
bcm5719-llvm-11d5116904d8a51edd22861001d7a31b9aec870a.zip
[CUDA] Don't define functions that the CUDA headers themselves define on Windows.
Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28324 llvm-svn: 291137
Diffstat (limited to 'clang/lib/Headers/__clang_cuda_cmath.h')
-rw-r--r--clang/lib/Headers/__clang_cuda_cmath.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/Headers/__clang_cuda_cmath.h b/clang/lib/Headers/__clang_cuda_cmath.h
index 0eaa08b30ca..9bef82611aa 100644
--- a/clang/lib/Headers/__clang_cuda_cmath.h
+++ b/clang/lib/Headers/__clang_cuda_cmath.h
@@ -72,6 +72,10 @@ __DEVICE__ int fpclassify(double __x) {
__DEVICE__ float frexp(float __arg, int *__exp) {
return ::frexpf(__arg, __exp);
}
+
+// For inscrutable reasons, the CUDA headers define these functions for us on
+// Windows.
+#ifndef _MSC_VER
__DEVICE__ bool isinf(float __x) { return ::__isinff(__x); }
__DEVICE__ bool isinf(double __x) { return ::__isinf(__x); }
__DEVICE__ bool isfinite(float __x) { return ::__finitef(__x); }
@@ -79,6 +83,10 @@ __DEVICE__ bool isfinite(float __x) { return ::__finitef(__x); }
// __finitef, does not exist when compiling for MacOS. __isfinited is available
// everywhere and is just as good.
__DEVICE__ bool isfinite(double __x) { return ::__isfinited(__x); }
+__DEVICE__ bool isnan(float __x) { return ::__isnanf(__x); }
+__DEVICE__ bool isnan(double __x) { return ::__isnan(__x); }
+#endif
+
__DEVICE__ bool isgreater(float __x, float __y) {
return __builtin_isgreater(__x, __y);
}
@@ -109,8 +117,6 @@ __DEVICE__ bool islessgreater(float __x, float __y) {
__DEVICE__ bool islessgreater(double __x, double __y) {
return __builtin_islessgreater(__x, __y);
}
-__DEVICE__ bool isnan(float __x) { return ::__isnanf(__x); }
-__DEVICE__ bool isnan(double __x) { return ::__isnan(__x); }
__DEVICE__ bool isnormal(float __x) { return __builtin_isnormal(__x); }
__DEVICE__ bool isnormal(double __x) { return __builtin_isnormal(__x); }
__DEVICE__ bool isunordered(float __x, float __y) {
OpenPOWER on IntegriCloud