[libcxx-commits] [libcxx] [libc++] Protect the libc++ implementation from CUDA SDK's `__noinline__` macro (PR #73838)

Dmitri Gribenko via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 21 16:31:21 PST 2024


================
@@ -1205,6 +1205,20 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c
 #    define _LIBCPP_NOINLINE
 #  endif
 
+#  if defined(__CUDACC__) || defined(__CUDA_ARCH__) || defined(__CUDA_LIBDEVICE__)
+// The CUDA SDK contains an unfortunate definition for the __noinline__ macro,
+// which breaks the regular __attribute__((__noinline__)) syntax. Therefore,
+// when compiling for CUDA we use the non-underscored version of the noinline
+// attribute.
+//
+// See https://github.com/llvm/llvm-project/pull/73838 for more details.
----------------
gribozavr wrote:

Done.

https://github.com/llvm/llvm-project/pull/73838


More information about the libcxx-commits mailing list