Skip to content

Is CUDA_ENFORCE_LOWER still needed? #2856

@jakirkham

Description

@jakirkham

Previously CUDA_ENFORCE_LOWER was used with CUDA_VER_10_1_UP, which ensured the CUDA version was at least 10.1. Here was the explanation on how to use CUDA_ENFORCE_LOWER:

// Notes:
//(1.) CUDA_VER_10_1_UP aggregates all the CUDA version selection logic;
//(2.) to enforce a lower version,
//
//`#define CUDA_ENFORCE_LOWER
// #include <raft/sparse/detail/cusparse_wrappers.h>`
//
// (i.e., before including this header)
//
#define CUDA_VER_10_1_UP (CUDART_VERSION >= 10010)
#define CUDA_VER_12_4_UP (CUDART_VERSION >= 12040)

Also here was a usage example:

#if not defined CUDA_ENFORCE_LOWER and CUDA_VER_10_1_UP
auto size_x = transpose ? nrows_ : ncols_;
auto size_y = transpose ? ncols_ : nrows_;

However support for CUDA 9, 10 (and even CUDA 11) have been dropped. Meaning CUDA_VER_10_1_UP is always true and thus is no longer used. As a result, recent code looks like this:

#if not defined CUDA_ENFORCE_LOWER
auto size_x = transpose ? nrows_ : ncols_;
auto size_y = transpose ? ncols_ : nrows_;


Given this, is CUDA_ENFORCE_LOWER still needed?

  • If so, what does it mean for CUDA 12+ code?
  • If not, what should happen to the code it guards?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions