-
Notifications
You must be signed in to change notification settings - Fork 200
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
implement new CUDA compiler checks #2983
Conversation
Please properly rebase this PR onto |
@@ -45,12 +45,12 @@ _CCCL_DIAG_SUPPRESS_CLANG("-Wunused-function") | |||
# include <cuda_bf16.h> | |||
_CCCL_DIAG_POP | |||
|
|||
# if _CCCL_CUDACC_AT_LEAST(11, 8) | |||
# if _CCCL_CUDA_COMPILER_AT_LEAST(11, 8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot change that macro, This relates to the __CUDACC__
macro, aka the version of the cuda headers used
This is different from the version of e.g clang-cuda and also nvc++ can consume cuda headers from different versions.
So we should leave that macro alone.
So for the currently supported compilers we have
- nvcc: nvcc version + cudacc version more or less equivalent
- nvrtc: same as nvcc
- clang-cuda: clang version + cudacc version. slightly coupled, I believe the cudacc version is bound to the clang version
- nvc++: nvc++ version and cudacc version are completely uncoupled, nvc++ can consume different cuda header versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bernhardmgruber @gevtushenko Do you have a opinions here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@miscco it seems you already have a far better understanding what __CUDACC__
means, so I leave this decision to you.
I agree that if __CUDACC__
does not designate a CUDA compiler version, then renaming _CCCL_CUDACC_AT_LEAST
to _CCCL_CUDA_COMPILER_AT_LEAST
is misleading.
The PR is replaced by #3057. |
This PR introduces a new CUDA compiler handling, following the C++ compiler checks.
Changes:
_CCCL_CUDA_COMPILER_*
now expands to the CUDA compiler version (does what_CCCL_CUDACC_VER
did)_CCCL_CUDA_COMPILER(_name [, _op, _maj [, min]])
macro_CCCL_CUDA_COMPILER
is replaced with_CCCL_HAS_CUDA_COMPILER
flag_CCCL_CUDACC_*
are replaced by_CCCL_CUDA_COMPILER_*
to match the naming_CCCL_CUDA_COMPILATION
flag can be used to check if CUDA source file is being compiled_CCCL_DEVICE_COMPILATION
flag can be used to check if the device code is being compiled (should replacedefined(__CUDA_ARCH__)
_CCCL_PTX_ARCH
should be valid for compilation with NVHPC compiler nowThere are still many places where the CUDA compiler version is meant to be NVCC only and should be fixed.