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

Add CCCL_VERSION and script for updating version #652

Merged
merged 12 commits into from
Nov 7, 2023
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/NVIDIA/cccl?quickstart=1&devcontainer_path=.devcontainer%2Fdevcontainer.json)

|[Contributor Guide](https://github.com/NVIDIA/cccl/blob/main/CONTRIBUTING.md)|[Dev Containers](https://github.com/NVIDIA/cccl/blob/main/.devcontainer/README.md)|[Discord](https://discord.gg/nvidiadeveloper)|[Godbolt](https://godbolt.org/z/x4G73af9a)|[GitHub Project](https://github.com/orgs/NVIDIA/projects/6)|[libcudacxx Docs](https://nvidia.github.io/libcudacxx/)|[Thrust Docs](https://nvidia.github.io/thrust/)|[CUB Docs](https://nvlabs.github.io/cub/)|
|[Contributor Guide](https://github.com/NVIDIA/cccl/blob/main/CONTRIBUTING.md)|[Dev Containers](https://github.com/NVIDIA/cccl/blob/main/.devcontainer/README.md)|[Discord](https://discord.gg/nvidiadeveloper)|[Godbolt](https://godbolt.org/z/x4G73af9a)|[GitHub Project](https://github.com/orgs/NVIDIA/projects/6)|[libcudacxx Docs](https://nvidia.github.io/libcudacxx/)|[Thrust Docs](https://nvidia.github.io/thrust/)|[CUB Docs](https://nvlabs.github.io/cub/)|
|-|-|-|-|-|-|-|-|

# CUDA C++ Core Libraries (CCCL)
Expand Down Expand Up @@ -284,20 +284,22 @@ Anything not part of the public API may change at any time without warning.

#### API Versioning

The entirety of CCCL's public API across all components shares a common semantic version of `MAJOR.MINOR.PATCH`.
The public API of all CCCL's components share a unified semantic version of `MAJOR.MINOR.PATCH`.

Only the most recently released version is supported.
As a rule, features and bug fixes are not backported to previously released version or branches.

For historical reasons, the library versions are encoded separately in each of Thrust/CUB/libcudacxx as follows:
The preferred method for querying the version is to use `CCCL_[MAJOR/MINOR/PATCH_]VERSION` as described below.
For backwards compatibility, the Thrust/CUB/libcudacxxx version definitions are available and will always be consistent with `CCCL_VERSION`.
Note that Thrust/CUB use a `MMMmmmpp` scheme whereas the CCCL and libcudacxx use `MMMmmmppp`.

| | libcudacxx | Thrust | CUB | Incremented when? |
|------------------------|-------------------------------------------|-------------------------------|----------------------------|--------------------------------------------------------------------|
| Header | `<cuda/std/version>` | `<thrust/version.h>` | `<cub/version.h>` | - |
| Major Version | `_LIBCUDACXX_CUDA_API_VERSION_MAJOR` | `THRUST_MAJOR_VERSION` | `CUB_MAJOR_VERSION` | Public API breaking changes (only at new CTK major release) |
| Minor Version | `_LIBCUDACXX_CUDA_API_VERSION_MINOR` | `THRUST_MINOR_VERSION` | `CUB_MINOR_VERSION` | Non-breaking feature additions |
| Patch/Subminor Version | `_LIBCUDACXX_CUDA_API_VERSION_PATCH` | `THRUST_SUBMINOR_VERSION` | `CUB_SUBMINOR_VERSION` | Minor changes not covered by major/minor versions |
| Concatenated Version | `_LIBCUDACXX_CUDA_API_VERSION (MMMmmmppp)`| `THRUST_VERSION (MMMmmmpp)` | `CUB_VERSION (MMMmmmpp)` | - |
| | CCCL | libcudacxx | Thrust | CUB |
|------------------------|----------------------------------------|-------------------------------------------|------------------------------|---------------------------|
| Header | `<cuda/version>` | `<cuda/std/version>` | `<thrust/version.h>` | `<cub/version.h>` |
| Major Version | `CCCL_MAJOR_VERSION` | `_LIBCUDACXX_CUDA_API_VERSION_MAJOR` | `THRUST_MAJOR_VERSION` | `CUB_MAJOR_VERSION` |
| Minor Version | `CCCL_MINOR_VERSION` | `_LIBCUDACXX_CUDA_API_VERSION_MINOR` | `THRUST_MINOR_VERSION` | `CUB_MINOR_VERSION` |
| Patch/Subminor Version | `CCCL_PATCH_VERSION` | `_LIBCUDACXX_CUDA_API_VERSION_PATCH` | `THRUST_SUBMINOR_VERSION` | `CUB_SUBMINOR_VERSION` |
| Concatenated Version | `CCCL_VERSION (MMMmmmppp)` | `_LIBCUDACXX_CUDA_API_VERSION (MMMmmmppp)`| `THRUST_VERSION (MMMmmmpp)` | `CUB_VERSION (MMMmmmpp)` |

### Application Binary Interface (ABI)

Expand Down Expand Up @@ -376,7 +378,7 @@ For a detailed overview of the CI pipeline, see [ci-overview.md](ci-overview.md)
Projects that are related to CCCL's mission to make CUDA C++ more delightful:
- [cuCollections](https://github.com/NVIDIA/cuCollections) - GPU accelerated data structures like hash tables
- [NVBench](https://github.com/NVIDIA/nvbench) - Benchmarking library tailored for CUDA applications
- [stdexec](https://github.com/nvidia/stdexec) - Reference implementation for Senders asynchronous programming model
- [stdexec](https://github.com/nvidia/stdexec) - Reference implementation for Senders asynchronous programming model

## Projects Using CCCL

Expand Down
101 changes: 101 additions & 0 deletions ci/update_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/bin/bash

# Usage: ./update_version.sh [--dry-run] <major> <minor> <patch>
# Example: ./update_version.sh --dry-run 2 2 1

# Run in root cccl/
cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit

DRY_RUN=false

while [[ "$#" -gt 0 ]]; do
case "$1" in
--dry-run) DRY_RUN=true; ;;
*) break ;;
esac
shift
done

major="$1"
minor="$2"
patch="$3"

if [ -z "$major" ] || [ -z "$minor" ] || [ -z "$patch" ]; then
echo "Usage: $0 [--dry-run] <major> <minor> <patch>"
exit 1
fi

# Version file paths
CCCL_VERSION_FILE="libcudacxx/include/cuda/std/detail/libcxx/include/__cccl/version.h"
THRUST_VERSION_FILE="thrust/thrust/version.h"
CUB_VERSION_FILE="cub/cub/version.cuh"
CCCL_CMAKE_VERSION_FILE="lib/cmake/cccl/cccl-config-version.cmake"
CUB_CMAKE_VERSION_FILE="cub/cub/cmake/cub-config-version.cmake"
LIBCUDACXX_CMAKE_VERSION_FILE="libcudacxx/lib/cmake/libcudacxx/libcudacxx-config-version.cmake"
THRUST_CMAKE_VERSION_FILE="thrust/thrust/cmake/thrust-config-version.cmake"

# Calculated version codes
new_cccl_version=$((major * 1000000 + minor * 1000 + patch)) # MMMmmmppp
new_thrust_cub_version=$((major * 100000 + minor * 100 + patch)) # MMMmmmpp

# Fetch current version from file
current_cccl_version=$(grep -oP "define CCCL_VERSION \K[0-9]+" "$CCCL_VERSION_FILE")

# Fetch the latest tag from git and strip the 'v' prefix if present
latest_tag=$(git tag --sort=-v:refname | head -n 1 | sed 's/^v//')

# Since the tags and versions are numerically comparable, we cast them to integers
latest_tag_version=$(echo "$latest_tag" | awk -F. '{ printf("%d%03d%03d", $1,$2,$3) }')

echo "Running in $(pwd)"
echo "New MMMmmmppp version: $new_cccl_version"
echo "New MMMmmmpp version: $new_thrust_cub_version"
echo "Current CCCL version: $current_cccl_version"
echo "Latest git tag: $latest_tag"

# Check if new version is less than or equal to current or the latest tag
if (( new_cccl_version < current_cccl_version )) || (( new_cccl_version < latest_tag_version )); then
echo "Error: New version $new_cccl_version is less than current version $current_cccl_version or latest git tag version $latest_tag_version."
exit 1
fi

update_file () {
local file=$1
local pattern=$2
local new_value=$3
if [ "$DRY_RUN" = true ]; then
local temp_file=$(mktemp)
sed "s/$pattern/$new_value/g" "$file" > "$temp_file"
diff --color=auto -U 0 "$file" "$temp_file" || true
rm "$temp_file"
else
sed -i "s/$pattern/$new_value/" "$file"
fi
}

# Update version information in files
update_file "$CCCL_VERSION_FILE" "^#define CCCL_VERSION \([0-9]\+\)" "#define CCCL_VERSION $new_cccl_version"
update_file "$THRUST_VERSION_FILE" "^#define THRUST_VERSION \([0-9]\+\)" "#define THRUST_VERSION $new_thrust_cub_version"
update_file "$CUB_VERSION_FILE" "^#define CUB_VERSION \([0-9]\+\)" "#define CUB_VERSION $new_thrust_cub_version"

update_file "$CUB_CMAKE_VERSION_FILE" "set(CUB_VERSION_MAJOR \([0-9]\+\))" "set(CUB_VERSION_MAJOR $major)"
update_file "$CUB_CMAKE_VERSION_FILE" "set(CUB_VERSION_MINOR \([0-9]\+\))" "set(CUB_VERSION_MINOR $minor)"
update_file "$CUB_CMAKE_VERSION_FILE" "set(CUB_VERSION_PATCH \([0-9]\+\))" "set(CUB_VERSION_PATCH $patch)"

update_file "$LIBCUDACXX_CMAKE_VERSION_FILE" "set(libcudacxx_VERSION_MAJOR \([0-9]\+\))" "set(libcudacxx_VERSION_MAJOR $major)"
update_file "$LIBCUDACXX_CMAKE_VERSION_FILE" "set(libcudacxx_VERSION_MINOR \([0-9]\+\))" "set(libcudacxx_VERSION_MINOR $minor)"
update_file "$LIBCUDACXX_CMAKE_VERSION_FILE" "set(libcudacxx_VERSION_PATCH \([0-9]\+\))" "set(libcudacxx_VERSION_PATCH $patch)"

update_file "$THRUST_CMAKE_VERSION_FILE" "set(THRUST_VERSION_MAJOR \([0-9]\+\))" "set(THRUST_VERSION_MAJOR $major)"
update_file "$THRUST_CMAKE_VERSION_FILE" "set(THRUST_VERSION_MINOR \([0-9]\+\))" "set(THRUST_VERSION_MINOR $minor)"
update_file "$THRUST_CMAKE_VERSION_FILE" "set(THRUST_VERSION_PATCH \([0-9]\+\))" "set(THRUST_VERSION_PATCH $patch)"

update_file "$CCCL_CMAKE_VERSION_FILE" "set(CCCL_VERSION_MAJOR \([0-9]\+\))" "set(CCCL_VERSION_MAJOR $major)"
update_file "$CCCL_CMAKE_VERSION_FILE" "set(CCCL_VERSION_MINOR \([0-9]\+\))" "set(CCCL_VERSION_MINOR $minor)"
update_file "$CCCL_CMAKE_VERSION_FILE" "set(CCCL_VERSION_PATCH \([0-9]\+\))" "set(CCCL_VERSION_PATCH $patch)"

if [ "$DRY_RUN" = true ]; then
echo "Dry run completed. No changes made."
else
echo "Version updated to $major.$minor.$patch"
fi
15 changes: 4 additions & 11 deletions cub/cub/cmake/cub-config-version.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
# Parse version information from version.cuh:
include("${CMAKE_CURRENT_LIST_DIR}/cub-header-search.cmake")
jrhemstad marked this conversation as resolved.
Show resolved Hide resolved

file(READ "${_CUB_VERSION_INCLUDE_DIR}/cub/version.cuh" CUB_VERSION_HEADER)
string(REGEX MATCH "#define[ \t]+CUB_VERSION[ \t]+([0-9]+)" DUMMY "${CUB_VERSION_HEADER}")
set(CUB_VERSION_FLAT ${CMAKE_MATCH_1})
# Note that CUB calls this the PATCH number, CMake calls it the TWEAK number:
string(REGEX MATCH "#define[ \t]+CUB_PATCH_NUMBER[ \t]+([0-9]+)" DUMMY "${CUB_VERSION_HEADER}")
set(CUB_VERSION_TWEAK ${CMAKE_MATCH_1})

math(EXPR CUB_VERSION_MAJOR "${CUB_VERSION_FLAT} / 100000")
math(EXPR CUB_VERSION_MINOR "(${CUB_VERSION_FLAT} / 100) % 1000")
math(EXPR CUB_VERSION_PATCH "${CUB_VERSION_FLAT} % 100") # CUB: "subminor" CMake: "patch"

set(CUB_VERSION_MAJOR 2)
set(CUB_VERSION_MINOR 3)
set(CUB_VERSION_PATCH 0)
set(CUB_VERSION_TWEAK 0)
set(CUB_VERSION "${CUB_VERSION_MAJOR}.${CUB_VERSION_MINOR}.${CUB_VERSION_PATCH}.${CUB_VERSION_TWEAK}")

set(PACKAGE_VERSION ${CUB_VERSION})
Expand Down
12 changes: 10 additions & 2 deletions cub/cub/version.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@
_CCCL_IMPLICIT_SYSTEM_HEADER
#endif // !_CCCL_COMPILER_NVHPC

#include <cuda/version>

/*! \def CUB_VERSION
* \brief The preprocessor macro \p CUB_VERSION encodes the version
* number of the CUB library.
* number of the CUB library as MMMmmmpp.
*
* \note CUB_VERSION is formatted as `MMMmmmpp`, which differs from `CCCL_VERSION` that uses `MMMmmmppp`.
*
* <tt>CUB_VERSION % 100</tt> is the sub-minor version.
* <tt>CUB_VERSION / 100 % 1000</tt> is the minor version.
* <tt>CUB_VERSION / 100000</tt> is the major version.
*/
#define CUB_VERSION 200200
#define CUB_VERSION 200300 // macro expansion with ## requires this to be a single value

/*! \def CUB_MAJOR_VERSION
* \brief The preprocessor macro \p CUB_MAJOR_VERSION encodes the
Expand All @@ -77,3 +81,7 @@ _CCCL_IMPLICIT_SYSTEM_HEADER
* patch number of the CUB library.
*/
#define CUB_PATCH_NUMBER 0

static_assert(CUB_MAJOR_VERSION == CCCL_MAJOR_VERSION,"");
static_assert(CUB_MINOR_VERSION == CCCL_MINOR_VERSION,"");
static_assert(CUB_SUBMINOR_VERSION == CCCL_PATCH_VERSION,"");
2 changes: 1 addition & 1 deletion lib/cmake/cccl/cccl-config-version.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set(CCCL_VERSION_MAJOR 2)
set(CCCL_VERSION_MINOR 2)
set(CCCL_VERSION_MINOR 3)
set(CCCL_VERSION_PATCH 0)
set(CCCL_VERSION_TWEAK 0)

Expand Down
19 changes: 19 additions & 0 deletions libcudacxx/.upstream-tests/test/cuda/version.pass.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//===----------------------------------------------------------------------===//
//
// Part of libcu++, the C++ Standard Library for your entire system,
// under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
//
//===----------------------------------------------------------------------===//

#include <cuda/version>

static_assert(CCCL_MAJOR_VERSION == (CCCL_VERSION/1000000),"");
static_assert(CCCL_MINOR_VERSION == (CCCL_VERSION/1000 % 1000),"");
static_assert(CCCL_PATCH_VERSION == (CCCL_VERSION % 1000),"");

int main(int argc, char** argv){
return 0;
}
14 changes: 5 additions & 9 deletions libcudacxx/include/cuda/std/detail/__config
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@
#ifndef __cuda_std__
#define __cuda_std__

#define _LIBCUDACXX_CUDA_API_VERSION 2002000
#include <cuda/std/detail/libcxx/include/__cccl/version.h>

#define _LIBCUDACXX_CUDA_API_VERSION_MAJOR \
(_LIBCUDACXX_CUDA_API_VERSION / 1000000)

#define _LIBCUDACXX_CUDA_API_VERSION_MINOR \
(_LIBCUDACXX_CUDA_API_VERSION / 1000 % 1000)

#define _LIBCUDACXX_CUDA_API_VERSION_PATCH \
(_LIBCUDACXX_CUDA_API_VERSION % 1000)
#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

#ifndef _LIBCUDACXX_CUDA_ABI_VERSION_LATEST
# define _LIBCUDACXX_CUDA_ABI_VERSION_LATEST 4
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//===----------------------------------------------------------------------===//
//
// Part of libcu++, the C++ Standard Library for your entire system,
// under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
//
//===----------------------------------------------------------------------===//

#ifndef __CCCL_VERSION_H
miscco marked this conversation as resolved.
Show resolved Hide resolved
#define __CCCL_VERSION_H

#define CCCL_VERSION 2003000
#define CCCL_MAJOR_VERSION (CCCL_VERSION / 1000000)
#define CCCL_MINOR_VERSION (((CCCL_VERSION / 1000) % 1000))
#define CCCL_PATCH_VERSION (CCCL_VERSION % 1000)

#if CCCL_PATCH_VERSION > 99
#error "CCCL patch version cannot be greater than 99 for compatibility with Thrust/CUB's MMMmmmpp format."
#endif

#endif // __CCCL_VERSION_H
16 changes: 16 additions & 0 deletions libcudacxx/include/cuda/version
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===----------------------------------------------------------------------===//
//
// Part of libcu++, the C++ Standard Library for your entire system,
// under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
//
//===----------------------------------------------------------------------===//

#ifndef _CUDA_VERSION
#define _CUDA_VERSION

#include "std/version"

#endif // _CUDA_VERSION
16 changes: 3 additions & 13 deletions libcudacxx/lib/cmake/libcudacxx/libcudacxx-config-version.cmake
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
# Parse version information from version header:
include("${CMAKE_CURRENT_LIST_DIR}/libcudacxx-header-search.cmake")

file(READ "${_libcudacxx_VERSION_INCLUDE_DIR}/cuda/std/detail/__config"
libcudacxx_VERSION_HEADER
)

string(REGEX MATCH
"#define[ \t]+_LIBCUDACXX_CUDA_API_VERSION[ \t]+([0-9]+)" unused_var
"${libcudacxx_VERSION_HEADER}"
)

set(libcudacxx_VERSION_FLAT ${CMAKE_MATCH_1})
math(EXPR libcudacxx_VERSION_MAJOR "${libcudacxx_VERSION_FLAT} / 1000000")
math(EXPR libcudacxx_VERSION_MINOR "(${libcudacxx_VERSION_FLAT} / 1000) % 1000")
math(EXPR libcudacxx_VERSION_PATCH "${libcudacxx_VERSION_FLAT} % 1000")
set(libcudacxx_VERSION_MAJOR 2)
set(libcudacxx_VERSION_MINOR 3)
set(libcudacxx_VERSION_PATCH 0)
set(libcudacxx_VERSION_TWEAK 0)

set(libcudacxx_VERSION
Expand Down
15 changes: 4 additions & 11 deletions thrust/thrust/cmake/thrust-config-version.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
# Parse version information from version.h:
include("${CMAKE_CURRENT_LIST_DIR}/thrust-header-search.cmake")

file(READ "${_THRUST_VERSION_INCLUDE_DIR}/thrust/version.h" THRUST_VERSION_HEADER)
string(REGEX MATCH "#define[ \t]+THRUST_VERSION[ \t]+([0-9]+)" DUMMY "${THRUST_VERSION_HEADER}")
set(THRUST_VERSION_FLAT ${CMAKE_MATCH_1})
# Note that Thrust calls this the PATCH number, CMake calls it the TWEAK number:
string(REGEX MATCH "#define[ \t]+THRUST_PATCH_NUMBER[ \t]+([0-9]+)" DUMMY "${THRUST_VERSION_HEADER}")
set(THRUST_VERSION_TWEAK ${CMAKE_MATCH_1})

math(EXPR THRUST_VERSION_MAJOR "${THRUST_VERSION_FLAT} / 100000")
math(EXPR THRUST_VERSION_MINOR "(${THRUST_VERSION_FLAT} / 100) % 1000")
math(EXPR THRUST_VERSION_PATCH "${THRUST_VERSION_FLAT} % 100") # Thrust: "subminor" CMake: "patch"

set(THRUST_VERSION_MAJOR 2)
set(THRUST_VERSION_MINOR 3)
set(THRUST_VERSION_PATCH 0) # Thrust: "subminor" CMake: "patch"
set(THRUST_VERSION_TWEAK 0)
set(THRUST_VERSION "${THRUST_VERSION_MAJOR}.${THRUST_VERSION_MINOR}.${THRUST_VERSION_PATCH}.${THRUST_VERSION_TWEAK}")

set(PACKAGE_VERSION ${THRUST_VERSION})
Expand Down
14 changes: 11 additions & 3 deletions thrust/thrust/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
#include <thrust/detail/config/config.h>

#if defined(_CCCL_COMPILER_NVHPC) && defined(_CCCL_USE_IMPLICIT_SYSTEM_DEADER)
#pragma GCC system_header
# pragma GCC system_header
#else // ^^^ _CCCL_COMPILER_NVHPC ^^^ / vvv !_CCCL_COMPILER_NVHPC vvv
_CCCL_IMPLICIT_SYSTEM_HEADER
#endif // !_CCCL_COMPILER_NVHPC

#include <cuda/version>

jrhemstad marked this conversation as resolved.
Show resolved Hide resolved
// This is the only Thrust header that is guaranteed to
// change with every Thrust release.
//
Expand All @@ -49,13 +51,15 @@ _CCCL_IMPLICIT_SYSTEM_HEADER

/*! \def THRUST_VERSION
* \brief The preprocessor macro \p THRUST_VERSION encodes the version
* number of the Thrust library.
* number of the Thrust library as MMMmmmpp.
*
* \note THRUST_VERSION is formatted as `MMMmmmpp`, which differs from `CCCL_VERSION` that uses `MMMmmmppp`.
*
* <tt>THRUST_VERSION % 100</tt> is the sub-minor version.
* <tt>THRUST_VERSION / 100 % 1000</tt> is the minor version.
* <tt>THRUST_VERSION / 100000</tt> is the major version.
*/
#define THRUST_VERSION 200200
#define THRUST_VERSION 200300 // macro expansion with ## requires this to be a single value
jrhemstad marked this conversation as resolved.
Show resolved Hide resolved

/*! \def THRUST_MAJOR_VERSION
* \brief The preprocessor macro \p THRUST_MAJOR_VERSION encodes the
Expand All @@ -81,3 +85,7 @@ _CCCL_IMPLICIT_SYSTEM_HEADER
* Legacy; will be 0 for all future releases.
*/
#define THRUST_PATCH_NUMBER 0

static_assert(THRUST_MAJOR_VERSION == CCCL_MAJOR_VERSION, "");
static_assert(THRUST_MINOR_VERSION == CCCL_MINOR_VERSION, "");
static_assert(THRUST_SUBMINOR_VERSION == CCCL_PATCH_VERSION, "");