Skip to content

Conversation

@davebayer
Copy link
Contributor

I've removed almost all uses of _CCCL_HAS_CUDA_COMPILER() and now it's the time to remove the macro completely. Basically it's just almost always not the right tool for the job.

Most of the uses were/are replaced by _CCCL_CUDA_COMPILATION() and the rest was/is almost always replacement for _CCCL_CUDA_COMPILER(NVCC) or _CCCL_HAS_CTK().

The compiler detection is now wrapped by _CCCL_CUDA_COMPILATION(), so if we are not compiling CUDA code, there is not CUDA compiler. This was not always the case, because if the user does:

$ nvcc -x c++ my_src.cpp

we would still set the _CCCL_CUDA_COMPILER_NVCC() even though we are compiling a c++ file. In my opinion this is not correct, because nvcc just controls the compilation trajectory and doesn't compile any source code.

This means that many of the builtins that cudafe++ doesn't support are not used even though the c++ compiler could use them without any problem.

So, this PR removes _CCCL_HAS_CUDA_COMPILER() completely and puts all compiler/compilation macros to a consistent state.

@davebayer davebayer requested review from a team as code owners December 15, 2025 21:40
@github-project-automation github-project-automation bot moved this to Todo in CCCL Dec 15, 2025
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Dec 15, 2025
@davebayer davebayer requested review from miscco and removed request for alliepiper and griwes December 15, 2025 22:02
Copy link
Contributor

@fbusato fbusato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly agree with the motivation of the PR. _CCCL_HAS_CUDA_COMPILER() is way too generic. I want to double-check we are not introducing subtle errors.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

🥳 CI Workflow Results

🟩 Finished in 14h 21m: Pass: 100%/91 | Total: 2d 10h | Max: 2h 58m | Hits: 83%/206947

See results here.

@davebayer davebayer merged commit db37889 into NVIDIA:main Dec 17, 2025
208 of 211 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants