Skip to content

Commit 546d4dd

Browse files
authored
Merge pull request #443 from ndellingwood/workaround-cuda124-issue
use cuda/std/limits with cuda version >= 12.6
2 parents 53c0e61 + 95692bc commit 546d4dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/experimental/__p0009_bits/utility.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <type_traits>
55
#include <array>
66
#include <utility>
7-
#if defined(MDSPAN_IMPL_HAS_CUDA) && defined(__NVCC__)
7+
#if defined(MDSPAN_IMPL_HAS_CUDA) && defined(__NVCC__) && (__CUDACC_VER_MAJOR__ * 100 + __CUDACC_VER_MINOR__ * 10 >= 1260)
88
#include <cuda/std/limits>
99
#else
1010
#include <limits>
@@ -203,7 +203,7 @@ MDSPAN_INLINE_FUNCTION constexpr bool cmp_greater_equal(T t, U u) noexcept {
203203

204204
template <class R, class T>
205205
MDSPAN_INLINE_FUNCTION constexpr bool in_range(T t) noexcept {
206-
#if defined(MDSPAN_IMPL_HAS_CUDA) && defined(__NVCC__)
206+
#if defined(MDSPAN_IMPL_HAS_CUDA) && defined(__NVCC__) && (__CUDACC_VER_MAJOR__ * 100 + __CUDACC_VER_MINOR__ * 10 >= 1260)
207207
using cuda::std::numeric_limits;
208208
#else
209209
using std::numeric_limits;
@@ -226,7 +226,7 @@ check_mul_result_is_nonnegative_and_representable(T a, T b) {
226226
if constexpr (std::is_signed_v<T>) {
227227
if ( a < 0 || b < 0 ) return false;
228228
}
229-
#if defined(MDSPAN_IMPL_HAS_CUDA) && defined(__NVCC__)
229+
#if defined(MDSPAN_IMPL_HAS_CUDA) && defined(__NVCC__) && (__CUDACC_VER_MAJOR__ * 100 + __CUDACC_VER_MINOR__ * 10 >= 1260)
230230
using cuda::std::numeric_limits;
231231
#else
232232
using std::numeric_limits;

0 commit comments

Comments
 (0)