|
25 | 25 | #include <cuda/__fwd/mdspan.h> |
26 | 26 | #include <cuda/__numeric/add_overflow.h> |
27 | 27 | #include <cuda/__numeric/mul_overflow.h> |
28 | | -#include <cuda/__numeric/overflow_cast.h> |
29 | 28 | #include <cuda/std/__concepts/concept_macros.h> |
30 | 29 | #include <cuda/std/__cstddef/types.h> |
31 | 30 | #include <cuda/std/__mdspan/concepts.h> |
@@ -132,7 +131,7 @@ class _CCCL_DECLSPEC_EMPTY_BASES layout_stride_relaxed::mapping |
132 | 131 | { |
133 | 132 | for (rank_type __d = 0; __d < __rank_; ++__d) |
134 | 133 | { |
135 | | - _CCCL_ASSERT(!::cuda::overflow_cast<offset_type>(__other.stride(__d)), |
| 134 | + _CCCL_ASSERT(::cuda::std::in_range<offset_type>(__other.stride(__d)), |
136 | 135 | "layout_stride_relaxed::mapping: stride is out of range"); |
137 | 136 | __init_strides[__d] = static_cast<offset_type>(__other.stride(__d)); |
138 | 137 | } |
@@ -274,15 +273,15 @@ class _CCCL_DECLSPEC_EMPTY_BASES layout_stride_relaxed::mapping |
274 | 273 | return index_type{0}; |
275 | 274 | } |
276 | 275 | const auto __stride_val = strides().stride(__r); |
277 | | - _CCCL_ASSERT(!::cuda::overflow_cast<index_type>(::cuda::uabs(__stride_val)), |
| 276 | + _CCCL_ASSERT(::cuda::std::in_range<index_type>(::cuda::uabs(__stride_val)), |
278 | 277 | "layout_stride_relaxed::mapping: stride is out of range"); |
279 | 278 | if (__stride_val < 0) |
280 | 279 | { |
281 | | - _CCCL_ASSERT(!::cuda::overflow_cast<offset_type>(__ext - 1), |
| 280 | + _CCCL_ASSERT(::cuda::std::in_range<offset_type>(__ext - 1), |
282 | 281 | "layout_stride_relaxed::mapping: extent - 1 is not representable as offset_type"); |
283 | 282 | const auto __min_extent = static_cast<offset_type>(__ext - 1); |
284 | 283 | const auto __abs_stride_u = ::cuda::uabs(__stride_val); |
285 | | - _CCCL_ASSERT(!::cuda::overflow_cast<offset_type>(__abs_stride_u), |
| 284 | + _CCCL_ASSERT(::cuda::std::in_range<offset_type>(__abs_stride_u), |
286 | 285 | "layout_stride_relaxed::mapping: absolute stride is not representable as offset_type"); |
287 | 286 | const auto __abs_stride = static_cast<offset_type>(__abs_stride_u); |
288 | 287 | _CCCL_ASSERT(!::cuda::mul_overflow(__min_extent, __abs_stride) |
@@ -310,7 +309,7 @@ class _CCCL_DECLSPEC_EMPTY_BASES layout_stride_relaxed::mapping |
310 | 309 | { |
311 | 310 | if constexpr (::cuda::std::__cccl_is_integer_v<_Index>) |
312 | 311 | { |
313 | | - return ::cuda::std::cmp_greater_equal(__index, index_type{0}) && !::cuda::overflow_cast<index_type>(__index); |
| 312 | + return ::cuda::std::cmp_greater_equal(__index, index_type{0}) && ::cuda::std::in_range<index_type>(__index); |
314 | 313 | } |
315 | 314 | else |
316 | 315 | { |
|
0 commit comments