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

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 21 04:57:33 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.
----------------
mordante wrote:

I really would like a comment this is a temporary work-around. 
Just  to make clear we still expect the CUDA SDK team to solve this properly.
Without this comment it seems that this is a permanent solution.


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


More information about the libcxx-commits mailing list