summaryrefslogtreecommitdiffstats
path: root/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-11-18 00:41:35 +0000
committerJustin Lebar <jlebar@google.com>2016-11-18 00:41:35 +0000
commit50fe9853495456f8cd01cef8c46fca4e9e084f58 (patch)
treef68d82af3122b5de4b123124971cd5712bba9db1 /clang/lib/Headers/__clang_cuda_runtime_wrapper.h
parentd14fe8830e16c5d17bbd9e277e69e8044097b00e (diff)
downloadbcm5719-llvm-50fe9853495456f8cd01cef8c46fca4e9e084f58.tar.gz
bcm5719-llvm-50fe9853495456f8cd01cef8c46fca4e9e084f58.zip
[CUDA] Wrapper header changes necessary to support MacOS.
Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26780 llvm-svn: 287288
Diffstat (limited to 'clang/lib/Headers/__clang_cuda_runtime_wrapper.h')
-rw-r--r--clang/lib/Headers/__clang_cuda_runtime_wrapper.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
index f311a4cd601..205e15b40b5 100644
--- a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
+++ b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
@@ -121,6 +121,15 @@
#undef __cxa_vec_delete3
#undef __cxa_pure_virtual
+// math_functions.hpp expects this host function be defined on MacOS, but it
+// ends up not being there because of the games we play here. Just define it
+// ourselves; it's simple enough.
+#ifdef __APPLE__
+inline __host__ double __signbitd(double x) {
+ return std::signbit(x);
+}
+#endif
+
// We need decls for functions in CUDA's libdevice with __device__
// attribute only. Alas they come either as __host__ __device__ or
// with no attributes at all. To work around that, define __CUDA_RTC__
OpenPOWER on IntegriCloud