-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
CUDA device code does not support variadic functions #58410
Comments
@llvm/issue-subscribers-clang-frontend |
It's a known issue that can be worked around with I guess we may eventually relax the restriction on variadic arguments and make them deferred, so they become an error only if we end up generating code for such function. |
PTX does not support variadic functions directly, but does allow passing unsized array parameter to a function which can be used to implement variadic functions. https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#variadic-functions
|
Hello, Please, check the following patch that adds support of variadic functions to NVPTX backend: |
Patch to automatically enable |
Allow parsing GPU-side variadic functions when we're compiling with CUDA-9 or newer. We still do not allow accessing variadic arguments. CUDA-9 was the version which introduced PTX-6.0 which allows implementing variadic functions, so older versions can't have variadics in principle. This is required for dealing with headers in recent CUDA versions that rely on variadic function declarations in some of the templated code in libcu++. E.g. #58410 Differential Revision: https://reviews.llvm.org/D150718
Clang should be able to compile CUDA atomics now, though it needs |
Is there a feature test macro or specific version of clang we could test to appropriately update the definition of |
AFAICT, the atomics support has been there since ~clang-13: https://godbolt.org/z/cGGroW74q
|
Filed NVIDIA/cccl#1020 |
I was looking at atomics support on CUDA: https://godbolt.org/z/3WqPYxEve
fails on Clang with:
cc: @wsmoses
The text was updated successfully, but these errors were encountered: