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
Prev Previous commit
Next Next commit
Verify Thrust version against CCCL version.
jrhemstad committed Nov 2, 2023
commit e9fdf449aa1ea14a3f2bab0bcc3817aac7c954cf
14 changes: 11 additions & 3 deletions thrust/thrust/version.h
Original file line number Diff line number Diff line change
@@ -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>

// This is the only Thrust header that is guaranteed to
// change with every Thrust release.
//
@@ -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 200200 // macro expansion with ## requires this to be a single value

/*! \def THRUST_MAJOR_VERSION
* \brief The preprocessor macro \p THRUST_MAJOR_VERSION encodes the
@@ -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, "");