[PATCH] D78392: [CUDA] Define __CUDACC__ before standard library headers

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 17 13:00:09 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG8e2051654044: [CUDA] Define __CUDACC__ before standard library headers (authored by tambre, committed by tra).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78392/new/

https://reviews.llvm.org/D78392

Files:
  clang/lib/Headers/__clang_cuda_runtime_wrapper.h


Index: clang/lib/Headers/__clang_cuda_runtime_wrapper.h
===================================================================
--- clang/lib/Headers/__clang_cuda_runtime_wrapper.h
+++ clang/lib/Headers/__clang_cuda_runtime_wrapper.h
@@ -31,11 +31,17 @@
 // Include some forward declares that must come before cmath.
 #include <__clang_cuda_math_forward_declares.h>
 
+// Define __CUDACC__ early as libstdc++ standard headers with GNU extensions
+// enabled depend on it to avoid using __float128, which is unsupported in
+// CUDA.
+#define __CUDACC__
+
 // Include some standard headers to avoid CUDA headers including them
 // while some required macros (like __THROW) are in a weird state.
 #include <cmath>
 #include <cstdlib>
 #include <stdlib.h>
+#undef __CUDACC__
 
 // Preserve common macros that will be changed below by us or by CUDA
 // headers.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78392.258407.patch
Type: text/x-patch
Size: 853 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200417/0db8d889/attachment-0001.bin>


More information about the cfe-commits mailing list