Skip to content
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

Consolidate compiler (version) detection #1965

Closed
bernhardmgruber opened this issue Jul 9, 2024 · 2 comments · Fixed by #2250
Closed

Consolidate compiler (version) detection #1965

bernhardmgruber opened this issue Jul 9, 2024 · 2 comments · Fixed by #2250
Labels
cub For all items related to CUB libcu++ For all items related to libcu++ thrust For all items related to Thrust.

Comments

@bernhardmgruber
Copy link
Contributor

We have a couple of headers detecting what kind of compiler is in use and exposing macros accordingly:

libcu++ seems to be at root, detecting what compiler is in use in: cuda/std/__cccl/compiler.h and defines macros like _CCCL_COMPILER_GCC. However, no version macros are exposed.

Thrust has thrust/detail/config/compiler.h, which uses the libcu++ macros and replicates the information by defining THRUST_HOST_COMPILER to a set of predefined constants, e.g. THRUST_HOST_COMPILER_GCC (which is 2). Thrust additionally defines compiler version macros like THRUST_GCC_VERSION.

CUB basically duplicates what Thrust does, exposing macros like CUB_HOST_COMPILER or CUB_GCC_VERSION.

I would really like all these macros to be consolidated into a single header inside libcu++, so I have a consistent way of asking what compiler at which version is in use.

@github-project-automation github-project-automation bot moved this to Todo in CCCL Jul 9, 2024
@bernhardmgruber bernhardmgruber added thrust For all items related to Thrust. cub For all items related to CUB libcu++ For all items related to libcu++ labels Jul 9, 2024
@miscco
Copy link
Collaborator

miscco commented Jul 22, 2024

the issue here is that the THRUST_* and CUB_* macros are user facing and cannot be removed as is.

I tried to remove all occurrences of those but I see that we missed some internally.

@bernhardmgruber
Copy link
Contributor Author

I would at least like to have compiler version macros in libcu++, so I could consistenly use the libcu++ macros across Thrust, CUB and libcu++. This would also allow us to deprecate and remove the Thrust and CUB macros at some point.

@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Aug 16, 2024
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cub For all items related to CUB libcu++ For all items related to libcu++ thrust For all items related to Thrust.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants