-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable clang to compile <atomic>
in device code
#1020
Comments
IIUC This change would be meant to guard against using atomics on versions of Clang where the PTX or variadic calls are not supported? |
For things to work, users would need both support for variadics (can be enabled with old clang versions via clang-17 will have variadics enabled by default, but the atomics change would still be useful for users of the older versions. Clang packages in the field tend to be updated rather slowly. |
Ah, I missed the part about needing variadics enabled. Is there macro to test if |
Unfortunately not. Adding it now would not make sense either as clang already enables variadics.
I do not think it's necessary. Variadics and atomics support are independent issues. We just happen to run into variadics first. |
I just hit this trying to build cuCollections with clang 17. Since it sounds like there is no way to distinguish if clang has |
@AustinSchuh do you have an example of something that still doesn't work today? I think this issue may already be resolved. We added That said, it looks like the definition of |
@jrhemstad , I don't think I'm doing anything too special. I was trying to get
I'm using clang 17.0.2, and Debian Bookworm's cuda installation. (I've got a sysroot built up with
The error above goes on quite a bit longer and repeats 3 times, but I don't think the rest of the error adds value. The problem is what is described in this ticket. If I add Holler if more info would be helpful. |
Could you try pulling the latest |
Success! I can confirm that the latest |
We guard the
<atomic>
header based on the definition of_LIBCUDACXX_HAS_CUDA_ATOMIC_IMPL
.This definition currently only allows nvcc, nvrtc, or nvc++ and excludes
clang
. We should update it to allowclang
.Based on llvm/llvm-project#58410 (comment), we likely need to version guard this to
>=clang13
.Furthermore, before clang17,
<cuda/(std/)atomic>
requires compiling with-fcuda-allow-variadic-functions
. Hopefully there is a macro that lets us test if this is enabled so we can guard based on this as wellPerhaps we should add a new definition
and update as:
The text was updated successfully, but these errors were encountered: