[PATCH] D40198: [CUDA] Tweak CUDA wrappers to make cuda-9 work with libc++

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 30 14:22:54 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL319485: [CUDA] Tweak CUDA wrappers to make cuda-9 work with libc++ (authored by tra).

Changed prior to commit:
  https://reviews.llvm.org/D40198?vs=123421&id=125021#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D40198

Files:
  cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h


Index: cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h
===================================================================
--- cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h
+++ cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h
@@ -270,12 +270,18 @@
 // include guard from math.h wrapper from libstdc++. We have to undo the header
 // guard temporarily to get the definitions we need.
 #pragma push_macro("_GLIBCXX_MATH_H")
+#pragma push_macro("_LIBCPP_VERSION")
 #if CUDA_VERSION >= 9000
 #undef _GLIBCXX_MATH_H
+// We also need to undo another guard that checks for libc++ 3.8+
+#ifdef _LIBCPP_VERSION
+#define _LIBCPP_VERSION 3700
+#endif
 #endif
 
 #include "math_functions.hpp"
 #pragma pop_macro("_GLIBCXX_MATH_H")
+#pragma pop_macro("_LIBCPP_VERSION")
 #pragma pop_macro("__GNUC__")
 #pragma pop_macro("signbit")
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40198.125021.patch
Type: text/x-patch
Size: 836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171130/3f86f183/attachment.bin>


More information about the cfe-commits mailing list