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

[FEA]: CCCL should have a single source of truth for version number #646

Closed
1 task done
jrhemstad opened this issue Nov 1, 2023 · 0 comments · Fixed by #652
Closed
1 task done

[FEA]: CCCL should have a single source of truth for version number #646

jrhemstad opened this issue Nov 1, 2023 · 0 comments · Fixed by #652
Labels
feature request New feature or request.

Comments

@jrhemstad
Copy link
Collaborator

Is this a duplicate?

Area

General CCCL

Is your feature request related to a problem? Please describe.

As a maintainer and user of CCCL, for consistency and reliability, I would like to have a single source of truth for the version information.

These versions are currently defined independently as defined here: https://github.com/nvidia/cccl#api-versioning

Describe the solution you'd like

Define a uniform set of version numbers exposed via <cuda/version>:

#define CCCL_VERSION 2003007 // Example version 2.3.7 (MMMmmmppp)
#define CCCL_MAJOR_VERSION (CCCL_VERSION / 1000000)
#define CCCL_MINOR_VERSION (CCCL_VERSION / 1000 % 1000)
#define CCCL_PATCH_VERSION (CCCL_VERSION % 1000)

Derive the other version numbers from these values (note that Thrust/CUB use MMMmmmpp vs MMMmmmppp, so it requires some extra calculation):

// libcudacxx/include/cuda/std/detail/__config
#define _LIBCUDACXX_CUDA_API_VERSION CCCL_VERSION
#define _LIBCUDACXX_CUDA_API_VERSION_MAJOR CCCL_MAJOR_VERSION
#define _LIBCUDACXX_CUDA_API_VERSION_MINOR CCCL_MINOR_VERSION
#define _LIBCUDACXX_CUDA_API_VERSION_PATCH CCCL_PATCH_VERSION

// thrust/thrust/version.h
#include <cuda/version>
#define THRUST_VERSION (CCCL_MAJOR_VERSION * 100000 + CCCL_MINOR_VERSION * 100 + CCCL_PATCH_VERSION)
#define THRUST_MAJOR_VERSION CCCL_MAJOR_VERSION
#define THRUST_MINOR_VERSION CCCL_MINOR_VERSION
#define THRUST_SUBMINOR_VERSION CCCL_PATCH_VERSION

// cub/cub/version.cuh
#include "cuda/version"
#define CUB_VERSION (CCCL_MAJOR_VERSION * 100000 + CCCL_MINOR_VERSION * 100 + CCCL_PATCH_VERSION)
#define CUB_MAJOR_VERSION CCCL_MAJOR_VERSION
#define CUB_MINOR_VERSION CCCL_MINOR_VERSION
#define CUB_SUBMINOR_VERSION CCCL_PATCH_VERSION

Describe alternatives you've considered

No response

Additional context

No response

@jrhemstad jrhemstad added the feature request New feature or request. label Nov 1, 2023
@github-project-automation github-project-automation bot moved this to Todo in CCCL Nov 1, 2023
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Nov 2, 2023
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant