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

Artem Belevich via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 16 11:29:10 PST 2024


Artem-B wrote:

> use noinline instead of __noinline__ when compiling CUDA code.

SGTM.

We should probably add a comment that this specifically targets the `__noinline__` macro definition in CUDA's `/crt/host_defines.h`. If CUDA headers' implementation changes in the future this workaround may break and would have to grow version-dependent variants.

We may make the workaround a bit simpler and more robust by directly checking if `__noinline__` is defined. However that opens a possibility of us applying the workaround if/when `__noinline__` may be defined as a macro for reasons other than CUDA headers. 

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


More information about the libcxx-commits mailing list