-
Notifications
You must be signed in to change notification settings - Fork 179
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
Feature: clang CUDA (device compilation) support #991
Comments
We'll place this on a milestone once we get gpuCI, that's a prerequisite to this as we don't have the capacity on DVS. |
This was supported a year ago. @MatthiasKohl what error are you encountering? |
Responded with PM, the error comes from using cuCollections and in particular, the static map implementation. |
I am having the same kind of issue trying to compile cuDF with clang as device compiler. The specific error I'm observing occurs in type_traits:
This is running clang 14.0.6 compiled using spack based on CUDA 10.2 |
For clang you probably need to enable the use of variadic functions with |
A word of caution. Clang currently does not have support for GPU-side variadic functions but in this case it's benign, as this is only a declaration used as a low-priority overload candidate for which we will not need to generate any code. That said, when the option is in effect, it may lead to a miscompilation or compiler crash if you try to compile an actual variadic function for a GPU. There's been some progress on this (llvm/llvm-project#58410). LLVM support has been added recently, but it's not been plumbed through to the CUDA front-end yet) If you run into clang issues, please do file an issue in LLVM's repo. libcudacxx is getting more users and it would be useful to know what features are actually needed. Otherwise we end up in a bit of a catch-22 situation -- people can't use clang for CUDA compilation because feature X is missing, and the feature X is missing because nobody asks for it. |
This is news to me. So the |
I do not think so. You will probably run into and error if there's a real attempt to use varargs via va_start/va_arg. E.g. https://godbolt.org/z/3qa5dn88c Most of the required functionality is already in place, we're missing a bit of glue to tie it all together. |
closed by #493 |
This issue is similar to this one in cuCollections: NVIDIA/cuCollections#128
While working on RAFT (primitives for RADPIS, PR: rapidsai/raft#424), I noticed that libcudacxx doesn't support having its device code compiled with clang.
It would be great to support this, if possible.
If test coverage is good enough, it's usually good enough to simply transform
nvcc
commands to clang for which I have a somewhat usable script in the above mentioned PR for RAFT, and apply those commands to the entire test suite.The text was updated successfully, but these errors were encountered: