From f61cff60522f403643d12cf3747b275d956cbced Mon Sep 17 00:00:00 2001 From: David Bayer Date: Thu, 14 May 2026 22:00:11 +0200 Subject: [PATCH 1/3] [infra] Add clang-cuda-21 in C++23 job for libcu++ --- CMakePresets.json | 9 +++ ci/matrix.yaml | 3 + .../include/cuda/std/__cmath/fpclassify.h | 4 +- .../barrier/arrive_tx_cluster.runfail.cpp | 1 + .../cuda/barrier/arrive_tx_device.runfail.cpp | 2 +- .../barrier/cp_async_bulk_tensor.pass.cpp | 1 + .../cuda/barrier/expect_tx_device.runfail.cpp | 2 +- .../device_mdspan/index_operator.pass.cpp | 18 +++--- .../host_mdspan/index_operator.pass.cpp | 18 +++--- .../managed_mdspan/index_operator.pass.cpp | 8 +-- .../restrict_mdspan/index_operator.pass.cpp | 8 +-- .../shared_mem_mdspan/index_operator.pass.cpp | 56 +++++++++---------- .../memcpy_async/memcpy_async_tx.pass.cpp | 2 +- .../mdspan/mdspan/index_operator.pass.cpp | 18 +++--- .../language.support/cstdlib/calloc.pass.cpp | 6 +- .../const_data_members.pass.cpp | 5 ++ .../has_denorm.pass.cpp | 5 ++ .../has_denorm_loss.pass.cpp | 5 ++ .../limits/numeric.limits/default.pass.cpp | 5 ++ .../limits/round.style/check_values.pass.cpp | 5 ++ .../c.math/fp_manip/copysign.pass.cpp | 7 ++- .../c.math/fp_traits/fpclassify.pass.cpp | 9 ++- .../c.math/fp_traits/isfinite.pass.cpp | 7 ++- .../numerics/c.math/fp_traits/isinf.pass.cpp | 7 ++- .../numerics/c.math/fp_traits/isnan.pass.cpp | 7 ++- .../c.math/fp_traits/isnormal.pass.cpp | 7 ++- .../c.math/fp_traits/signbit.pass.cpp | 7 ++- 27 files changed, 142 insertions(+), 90 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index f2a5e45a9f3..12c48f4cb94 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -159,6 +159,15 @@ "CMAKE_CUDA_STANDARD": "20" } }, + { + "name": "libcudacxx-cpp23", + "displayName": "libcu++: C++23", + "inherits": "libcudacxx", + "cacheVariables": { + "CMAKE_CXX_STANDARD": "23", + "CMAKE_CUDA_STANDARD": "23" + } + }, { "name": "libcudacxx-nvrtc", "inherits": "libcudacxx", diff --git a/ci/matrix.yaml b/ci/matrix.yaml index b08c6068ace..c6e94cac1ad 100644 --- a/ci/matrix.yaml +++ b/ci/matrix.yaml @@ -94,6 +94,7 @@ workflows: - {jobs: ['build'], cxx: 'nvhpc', ctk: 'nvhpc', std: 'all', project: ['libcudacxx', 'cub', 'thrust', 'cudax', 'stdpar'], cpu: ['amd64', 'arm64']} # clang-cuda - {jobs: ['build'], cudacxx: 'clang', ctk: 'clang-cuda', cxx: 'clang-cuda', std: 'all', sm: '75;80;90;100;120'} + - {jobs: ['build'], project: 'libcudacxx', cudacxx: 'clang', ctk: 'clang-cuda', cxx: 'clang-cuda', std: 23, sm: '75;80;90;100;120'} # libc++ # - arm64 for now as it's closest to android. # - {jobs: ['build'], cpu: 'arm64', project: 'libcudacxx', std: 'all', cudacxx: 'clang', ctk: 'clang-cuda', cxx: 'clang-cuda', cmake_options: '-DCCCL_USE_LIBCXX=ON', sm: '75;80;90;100;120'} @@ -229,6 +230,7 @@ workflows: - {jobs: ['build'], cxx: 'nvhpc', ctk: 'nvhpc', std: 'all', project: ['libcudacxx', 'cub', 'thrust', 'cudax', 'stdpar'], cpu: ['amd64', 'arm64']} # clang-cuda - {jobs: ['build'], cudacxx: 'clang', ctk: 'clang-cuda', cxx: 'clang-cuda', std: 'all', sm: '75;80;90;100;120'} + - {jobs: ['build'], project: 'libcudacxx', cudacxx: 'clang', ctk: 'clang-cuda', cxx: 'clang-cuda', std: 23, sm: '75;80;90;100;120'} # clang-tidy - { jobs: ['build'], project: 'tidy', std: 'min', cxx: ['clang'], cudacxx: ['clang'], ctk: 'clang-cuda', sm: '75' } # arch-specific and family-specific arch builds @@ -321,6 +323,7 @@ workflows: - {jobs: ['build'], cxx: 'nvhpc', ctk: 'nvhpc', std: 'all', project: ['libcudacxx', 'cub', 'thrust', 'cudax', 'stdpar'], cpu: ['amd64', 'arm64']} # clang-cuda - {jobs: ['build'], cudacxx: 'clang', ctk: 'clang-cuda', cxx: 'clang-cuda', std: 'all', sm: '75;80;90;100;120'} + - {jobs: ['build'], project: 'libcudacxx', cudacxx: 'clang', ctk: 'clang-cuda', cxx: 'clang-cuda', std: 23, sm: '75;80;90;100;120'} # compute-sanitizer - {jobs: ['compute_sanitizer'], project: 'cub', std: 'max', gpu: 'rtxa6000', sm: 'gpu', cmake_options: '-DCMAKE_CUDA_FLAGS=-lineinfo'} # clang-tidy diff --git a/libcudacxx/include/cuda/std/__cmath/fpclassify.h b/libcudacxx/include/cuda/std/__cmath/fpclassify.h index b48e44824fd..3069a93ed83 100644 --- a/libcudacxx/include/cuda/std/__cmath/fpclassify.h +++ b/libcudacxx/include/cuda/std/__cmath/fpclassify.h @@ -79,7 +79,7 @@ _CCCL_BEGIN_NAMESPACE_CUDA_STD template [[nodiscard]] _CCCL_API constexpr int __fpclassify_impl(_Tp __x) noexcept { - static_assert(numeric_limits<_Tp>::has_denorm, "The type must have denorm support"); + static_assert(__fp_has_denorm_v<__fp_format_of_v<_Tp>>, "The type must have denorm support"); if constexpr (numeric_limits<_Tp>::has_quiet_NaN || numeric_limits<_Tp>::has_signaling_NaN) { @@ -186,7 +186,7 @@ template #if _CCCL_HAS_NVFP8_E8M0() [[nodiscard]] _CCCL_API constexpr int fpclassify(__nv_fp8_e8m0 __x) noexcept { - return ((__x.__x & __fp_exp_mask_of_v<__nv_fp8_e8m0>) == __fp_exp_mask_of_v<__nv_fp8_e8m0>) ? FP_NAN : FP_NORMAL; + return (__x.__x == __fp_exp_mask_of_v<__nv_fp8_e8m0>) ? FP_NAN : FP_NORMAL; } #endif // _CCCL_HAS_NVFP8_E8M0() diff --git a/libcudacxx/test/libcudacxx/cuda/barrier/arrive_tx_cluster.runfail.cpp b/libcudacxx/test/libcudacxx/cuda/barrier/arrive_tx_cluster.runfail.cpp index f709a9e9398..81d9ac17abe 100644 --- a/libcudacxx/test/libcudacxx/cuda/barrier/arrive_tx_cluster.runfail.cpp +++ b/libcudacxx/test/libcudacxx/cuda/barrier/arrive_tx_cluster.runfail.cpp @@ -10,6 +10,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: pre-sm-90 +// UNSUPPORTED: clang && !nvcc // UNSUPPORTED: no_execute diff --git a/libcudacxx/test/libcudacxx/cuda/barrier/arrive_tx_device.runfail.cpp b/libcudacxx/test/libcudacxx/cuda/barrier/arrive_tx_device.runfail.cpp index 31a1d9866da..3301d88bbab 100644 --- a/libcudacxx/test/libcudacxx/cuda/barrier/arrive_tx_device.runfail.cpp +++ b/libcudacxx/test/libcudacxx/cuda/barrier/arrive_tx_device.runfail.cpp @@ -37,6 +37,6 @@ int main(int, char**) if (threadIdx.x == 0) { init(bar_ptr, blockDim.x); } __syncthreads(); // Should fail because the barrier is in device memory. - auto token = cuda::device::barrier_arrive_tx(*bar_ptr, 1, 0);)); + [[maybe_unused]] auto token = cuda::device::barrier_arrive_tx(*bar_ptr, 1, 0);)); return 0; } diff --git a/libcudacxx/test/libcudacxx/cuda/barrier/cp_async_bulk_tensor.pass.cpp b/libcudacxx/test/libcudacxx/cuda/barrier/cp_async_bulk_tensor.pass.cpp index 6bdbcffe71f..cb7df3feb70 100644 --- a/libcudacxx/test/libcudacxx/cuda/barrier/cp_async_bulk_tensor.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/barrier/cp_async_bulk_tensor.pass.cpp @@ -11,6 +11,7 @@ // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: pre-sm-90 // ADDITIONAL_COMPILE_DEFINITIONS: CCCL_IGNORE_DEPRECATED_API +// UNSUPPORTED: clang && !nvcc // UNSUPPORTED: nvrtc // NVRTC_SKIP_KERNEL_RUN // This will have effect once PR 433 is merged (line above should be removed.) diff --git a/libcudacxx/test/libcudacxx/cuda/barrier/expect_tx_device.runfail.cpp b/libcudacxx/test/libcudacxx/cuda/barrier/expect_tx_device.runfail.cpp index 2ebd6d8b441..57eeab2eb67 100644 --- a/libcudacxx/test/libcudacxx/cuda/barrier/expect_tx_device.runfail.cpp +++ b/libcudacxx/test/libcudacxx/cuda/barrier/expect_tx_device.runfail.cpp @@ -25,7 +25,7 @@ // Suppress warning about barrier in shared memory TEST_NV_DIAG_SUPPRESS(static_var_with_dynamic_init) -TEST_GLOBAL_VARIABLE uint64_t bar_storage; +[[maybe_unused]] TEST_GLOBAL_VARIABLE uint64_t bar_storage; int main(int, char**) { diff --git a/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/device_mdspan/index_operator.pass.cpp b/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/device_mdspan/index_operator.pass.cpp index 6c0e51ef52d..e4a0ff2289d 100644 --- a/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/device_mdspan/index_operator.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/device_mdspan/index_operator.pass.cpp @@ -46,23 +46,19 @@ TEST_DEVICE_FUNC constexpr auto& access(MDS mds, int64_t i0) } #if _CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() -template < - class MDS, - class... Indices, - class = cuda::std::enable_if_t< - cuda::std::is_same_v()[cuda::std::declval()...]), typename MDS::reference>, - int> = 0> +template + requires requires(MDS mds, Indices... indices) { mds[indices...]; } TEST_DEVICE_FUNC constexpr bool check_operator_constraints(MDS m, Indices... idxs) { unused(m[idxs...]); return true; } #else // ^^^ _CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() ^^^ / vvv !_CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() vvv -template < - class MDS, - class Index, - class = cuda::std::enable_if_t()[cuda::std::declval()]), - typename MDS::reference>::value>> +template ()[cuda::std::declval()]), + typename MDS::reference>, + int> = 0> TEST_DEVICE_FUNC constexpr bool check_operator_constraints(MDS m, Index idx) { unused(m[idx]); diff --git a/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/host_mdspan/index_operator.pass.cpp b/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/host_mdspan/index_operator.pass.cpp index 9d8b5f7c70d..a4403adf1c6 100644 --- a/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/host_mdspan/index_operator.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/host_mdspan/index_operator.pass.cpp @@ -45,23 +45,19 @@ constexpr auto& access(MDS mds, int64_t i0) } #if _CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() -template < - class MDS, - class... Indices, - class = cuda::std::enable_if_t< - cuda::std::is_same_v()[cuda::std::declval()...]), typename MDS::reference>, - int> = 0> +template + requires requires(MDS mds, Indices... indices) { mds[indices...]; } constexpr bool check_operator_constraints(MDS m, Indices... idxs) { unused(m[idxs...]); return true; } #else // ^^^ _CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() ^^^ / vvv !_CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() vvv -template < - class MDS, - class Index, - class = cuda::std::enable_if_t()[cuda::std::declval()]), - typename MDS::reference>::value>> +template ()[cuda::std::declval()]), + typename MDS::reference>, + int> = 0> constexpr bool check_operator_constraints(MDS m, Index idx) { unused(m[idx]); diff --git a/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/managed_mdspan/index_operator.pass.cpp b/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/managed_mdspan/index_operator.pass.cpp index c2b708179b2..3fb5c91e576 100644 --- a/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/managed_mdspan/index_operator.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/managed_mdspan/index_operator.pass.cpp @@ -46,12 +46,8 @@ TEST_FUNC constexpr auto& access(MDS mds, int64_t i0) } #if _CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() -template < - class MDS, - class... Indices, - class = cuda::std::enable_if_t< - cuda::std::is_same_v()[cuda::std::declval()...]), typename MDS::reference>, - int> = 0> +template + requires requires(MDS mds, Indices... indices) { mds[indices...]; } TEST_FUNC constexpr bool check_operator_constraints(MDS m, Indices... idxs) { unused(m[idxs...]); diff --git a/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/restrict_mdspan/index_operator.pass.cpp b/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/restrict_mdspan/index_operator.pass.cpp index 0ecf59b3354..b932135bae0 100644 --- a/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/restrict_mdspan/index_operator.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/restrict_mdspan/index_operator.pass.cpp @@ -45,12 +45,8 @@ TEST_FUNC constexpr auto& access(MDS mds, int64_t i0) } #if _CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() -template < - class MDS, - class... Indices, - class = cuda::std::enable_if_t< - cuda::std::is_same_v()[cuda::std::declval()...]), typename MDS::reference>, - int> = 0> +template + requires requires(MDS mds, Indices... indices) { mds[indices...]; } TEST_FUNC constexpr bool check_operator_constraints(MDS m, Indices... idxs) { unused(m[idxs...]); diff --git a/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/shared_mem_mdspan/index_operator.pass.cpp b/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/shared_mem_mdspan/index_operator.pass.cpp index df9382177b9..d2282e0cb0b 100644 --- a/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/shared_mem_mdspan/index_operator.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/containers/views/mdspan/shared_mem_mdspan/index_operator.pass.cpp @@ -46,23 +46,19 @@ TEST_DEVICE_FUNC constexpr auto& access(MDS mds, int64_t i0) } #if _CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() -template < - class MDS, - class... Indices, - class = cuda::std::enable_if_t< - cuda::std::is_same_v()[cuda::std::declval()...]), typename MDS::reference>>, - int> -= 0 > TEST_DEVICE_FUNC constexpr bool check_operator_constraints(MDS m, Indices... idxs) +template + requires requires(MDS mds, Indices... indices) { mds[indices...]; } +TEST_DEVICE_FUNC constexpr bool check_operator_constraints(MDS m, Indices... idxs) { unused(m[idxs...]); return true; } #else // ^^^ _CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() ^^^ / vvv !_CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() vvv -template < - class MDS, - class Index, - class = cuda::std::enable_if_t< - cuda::std::is_same_v()[cuda::std::declval()]), typename MDS::reference>>> +template ()[cuda::std::declval()]), + typename MDS::reference>, + int> = 0> TEST_DEVICE_FUNC constexpr bool check_operator_constraints(MDS m, Index idx) { unused(m[idx]); @@ -166,52 +162,52 @@ TEST_DEVICE_FUNC void test_layout() test_iteration(construct_mapping(Layout(), cuda::std::extents())); __shared__ int data[16]; // Check operator constraint for number of arguments - static_assert(check_operator_constraints( + assert(check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1))), 0)); - static_assert(!check_operator_constraints( + assert(!check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1))), 0, 0)); // Check operator constraint for convertibility of arguments to index_type - static_assert(check_operator_constraints( + assert(check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1))), IntType(0))); - static_assert(!check_operator_constraints( + assert(!check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1))), IntType(0))); // Check operator constraint for no-throw-constructibility of index_type from arguments - static_assert(!check_operator_constraints( + assert(!check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1))), IntType(0))); // Check that mixed integrals work: note the second one tests that mdspan casts: layout_wrapping_integral does not // accept IntType - static_assert(check_operator_constraints( + assert(check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1, 1))), int(0), size_t(0))); - static_assert(check_operator_constraints( + assert(check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1, 1))), unsigned(0), IntType(0))); constexpr bool t = true; constexpr bool o = false; - static_assert(!check_operator_constraints( + assert(!check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1, 1))), unsigned(0), IntConfig(0))); - static_assert(check_operator_constraints( + assert(check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1, 1))), unsigned(0), IntConfig(0))); - static_assert(check_operator_constraints( + assert(check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1, 1))), unsigned(0), IntConfig(0))); - static_assert(!check_operator_constraints( + assert(!check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1, 1))), unsigned(0), IntConfig(0))); - static_assert(check_operator_constraints( + assert(check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1, 1))), unsigned(0), IntConfig(0))); @@ -221,22 +217,22 @@ TEST_DEVICE_FUNC void test_layout() // const&, no-throw-ctor from non-const if constexpr (cuda::std::is_same_v) { - static_assert(!check_operator_constraints( + assert(!check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1))), cuda::std::array{IntConfig(0)})); - static_assert(!check_operator_constraints( + assert(!check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1))), cuda::std::array{IntConfig(0)})); - static_assert(!check_operator_constraints( + assert(!check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1))), cuda::std::array{IntConfig(0)})); - static_assert(!check_operator_constraints( + assert(!check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1))), cuda::std::array{IntConfig(0)})); - static_assert(check_operator_constraints( + assert(check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1))), cuda::std::array{IntConfig(0)})); - static_assert(check_operator_constraints( + assert(check_operator_constraints( cuda::shared_memory_mdspan(data, construct_mapping(Layout(), cuda::std::extents(1))), cuda::std::array{IntConfig(0)})); diff --git a/libcudacxx/test/libcudacxx/cuda/memcpy_async/memcpy_async_tx.pass.cpp b/libcudacxx/test/libcudacxx/cuda/memcpy_async/memcpy_async_tx.pass.cpp index 0cc1ec117c0..e1c6bfc3900 100644 --- a/libcudacxx/test/libcudacxx/cuda/memcpy_async/memcpy_async_tx.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/memcpy_async/memcpy_async_tx.pass.cpp @@ -33,7 +33,7 @@ TEST_NV_DIAG_SUPPRESS(static_var_with_dynamic_init) static_assert(false, "Insufficient CUDA Compute Capability: cuda::device::memcpy_async_tx is not available."); #endif // __CUDA_MINIMUM_ARCH__ -alignas(16) TEST_GLOBAL_VARIABLE int gmem_x[2048]; +[[maybe_unused]] alignas(16) TEST_GLOBAL_VARIABLE int gmem_x[2048]; int main(int, char**) { diff --git a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/mdspan/index_operator.pass.cpp b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/mdspan/index_operator.pass.cpp index 7425221a4ba..e0f6a6ba4f8 100644 --- a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/mdspan/index_operator.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/mdspan/index_operator.pass.cpp @@ -43,23 +43,19 @@ TEST_FUNC constexpr auto& access(MDS mds, int64_t i0) } #if _CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() -template < - class MDS, - class... Indices, - class = cuda::std::enable_if_t< - cuda::std::is_same_v()[cuda::std::declval()...]), typename MDS::reference>, - int> = 0> +template + requires requires(MDS mds, Indices... indices) { mds[indices...]; } TEST_FUNC constexpr bool check_operator_constraints(MDS m, Indices... idxs) { unused(m[idxs...]); return true; } #else // ^^^ _CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() ^^^ / vvv !_CCCL_HAS_MULTIARG_OPERATOR_BRACKETS() vvv -template < - class MDS, - class Index, - class = cuda::std::enable_if_t()[cuda::std::declval()]), - typename MDS::reference>::value>> +template ()[cuda::std::declval()]), + typename MDS::reference>, + int> = 0> TEST_FUNC constexpr bool check_operator_constraints(MDS m, Index idx) { unused(m[idx]); diff --git a/libcudacxx/test/libcudacxx/std/language.support/cstdlib/calloc.pass.cpp b/libcudacxx/test/libcudacxx/std/language.support/cstdlib/calloc.pass.cpp index 360635bf7e5..ebc05e7aa65 100644 --- a/libcudacxx/test/libcudacxx/std/language.support/cstdlib/calloc.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/language.support/cstdlib/calloc.pass.cpp @@ -42,8 +42,10 @@ TEST_FUNC void test_calloc_fail(cuda::std::size_t n) { T* ptr = static_cast(cuda::std::calloc(n, sizeof(T))); - // check that the memory was not allocated - assert(ptr == nullptr); + // check that the memory was not allocated on device, on host it's implementation defined + NV_IF_TARGET(NV_IS_DEVICE, (assert(ptr == nullptr);)) + + cuda::std::free(ptr); } struct BigStruct diff --git a/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/const_data_members.pass.cpp b/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/const_data_members.pass.cpp index 69c53e1d287..4ca11e59a50 100644 --- a/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/const_data_members.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/const_data_members.pass.cpp @@ -13,6 +13,11 @@ #include "test_macros.h" +// numeric_limits::has_denorm and numeric_limits::has_denorm_loss have been deprecated since C++23 +#if _CCCL_STD_VER >= 2023 +_CCCL_SUPPRESS_DEPRECATED_PUSH +#endif // _CCCL_STD_VER >= 2023 + /* : numeric_limits diff --git a/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/has_denorm.pass.cpp b/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/has_denorm.pass.cpp index 85c20c38a2c..321550f8b3a 100644 --- a/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/has_denorm.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/has_denorm.pass.cpp @@ -17,6 +17,11 @@ #include "test_macros.h" +// numeric_limits::has_denorm and numeric_limits::has_denorm_loss have been deprecated since C++23 +#if _CCCL_STD_VER >= 2023 +_CCCL_SUPPRESS_DEPRECATED_PUSH +#endif // _CCCL_STD_VER >= 2023 + template TEST_FUNC void test() { diff --git a/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/has_denorm_loss.pass.cpp b/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/has_denorm_loss.pass.cpp index 802993c6fce..693aac71a65 100644 --- a/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/has_denorm_loss.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/has_denorm_loss.pass.cpp @@ -17,6 +17,11 @@ #include "test_macros.h" +// numeric_limits::has_denorm and numeric_limits::has_denorm_loss have been deprecated since C++23 +#if _CCCL_STD_VER >= 2023 +_CCCL_SUPPRESS_DEPRECATED_PUSH +#endif // _CCCL_STD_VER >= 2023 + template TEST_FUNC void test() { diff --git a/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits/default.pass.cpp b/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits/default.pass.cpp index 7d290ab3afe..0f822c3394e 100644 --- a/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits/default.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits/default.pass.cpp @@ -16,6 +16,11 @@ #include "test_macros.h" +// numeric_limits::has_denorm and numeric_limits::has_denorm_loss have been deprecated since C++23 +#if _CCCL_STD_VER >= 2023 +_CCCL_SUPPRESS_DEPRECATED_PUSH +#endif // _CCCL_STD_VER >= 2023 + struct A { TEST_FUNC A(int i = 0) diff --git a/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/round.style/check_values.pass.cpp b/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/round.style/check_values.pass.cpp index 6e02f57c7a0..60506c1c67b 100644 --- a/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/round.style/check_values.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/round.style/check_values.pass.cpp @@ -14,6 +14,11 @@ #include "test_macros.h" +// denorm_style has been deprecated since C++23 +#if _CCCL_STD_VER >= 2023 +_CCCL_SUPPRESS_DEPRECATED_PUSH +#endif // _CCCL_STD_VER >= 2023 + using one = char; struct two { diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_manip/copysign.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_manip/copysign.pass.cpp index e4e404c74cc..d0674384d24 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_manip/copysign.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_manip/copysign.pass.cpp @@ -122,9 +122,14 @@ TEST_FUNC constexpr void test_type(float val) test_copysign(cuda::std::numeric_limits::signaling_NaN()); } + // numeric_limits::has_denorm has been deprecated since C++23 + _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - test_copysign(cuda::std::numeric_limits::denorm_min()); + _CCCL_SUPPRESS_DEPRECATED_POP + { + test_copysign(cuda::std::numeric_limits::denorm_min()); + } } } diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/fpclassify.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/fpclassify.pass.cpp index 904b65b78e1..6305a32c2f7 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/fpclassify.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/fpclassify.pass.cpp @@ -79,10 +79,15 @@ TEST_FUNC constexpr void test_type() test_fpclassify(cuda::std::numeric_limits::signaling_NaN(), FP_NAN); } + // numeric_limits::has_denorm has been deprecated since C++23 + _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - // fixme: behaviour of subnormal values depends on the FP mode, may result in FP_ZERO - // test_fpclassify(cuda::std::numeric_limits::denorm_min(), FP_SUBNORMAL); + _CCCL_SUPPRESS_DEPRECATED_POP + { + // fixme: behaviour of subnormal values depends on the FP mode, may result in FP_ZERO + // test_fpclassify(cuda::std::numeric_limits::denorm_min(), FP_SUBNORMAL); + } } } diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isfinite.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isfinite.pass.cpp index 0361202c812..6ba33227eb0 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isfinite.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isfinite.pass.cpp @@ -78,9 +78,14 @@ TEST_FUNC constexpr void test_type() test_isfinite(cuda::std::numeric_limits::signaling_NaN(), false); } + // numeric_limits::has_denorm has been deprecated since C++23 + _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - test_isfinite(cuda::std::numeric_limits::denorm_min(), true); + _CCCL_SUPPRESS_DEPRECATED_POP + { + test_isfinite(cuda::std::numeric_limits::denorm_min(), true); + } } } diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isinf.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isinf.pass.cpp index 23cf8251a59..5078d0e14e9 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isinf.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isinf.pass.cpp @@ -78,9 +78,14 @@ TEST_FUNC constexpr void test_type() test_isinf(cuda::std::numeric_limits::signaling_NaN(), false); } + // numeric_limits::has_denorm has been deprecated since C++23 + _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - test_isinf(cuda::std::numeric_limits::denorm_min(), false); + _CCCL_SUPPRESS_DEPRECATED_POP + { + test_isinf(cuda::std::numeric_limits::denorm_min(), false); + } } } diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnan.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnan.pass.cpp index 69a080c7d26..cadca869eef 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnan.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnan.pass.cpp @@ -78,9 +78,14 @@ TEST_FUNC constexpr void test_type() test_isnan(cuda::std::numeric_limits::signaling_NaN(), true); } + // numeric_limits::has_denorm has been deprecated since C++23 + _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - test_isnan(cuda::std::numeric_limits::denorm_min(), false); + _CCCL_SUPPRESS_DEPRECATED_POP + { + test_isnan(cuda::std::numeric_limits::denorm_min(), false); + } } } diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnormal.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnormal.pass.cpp index a7952309e7a..e02a355e797 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnormal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnormal.pass.cpp @@ -80,9 +80,14 @@ TEST_FUNC constexpr void test_type() test_isnormal(cuda::std::numeric_limits::signaling_NaN(), false); } + // numeric_limits::has_denorm has been deprecated since C++23 + _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - test_isnormal(cuda::std::numeric_limits::denorm_min(), false); + _CCCL_SUPPRESS_DEPRECATED_POP + { + test_isnormal(cuda::std::numeric_limits::denorm_min(), false); + } } } diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/signbit.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/signbit.pass.cpp index 091166f1662..5cfe8ddc609 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/signbit.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/signbit.pass.cpp @@ -89,9 +89,14 @@ TEST_FUNC constexpr void test_type(float val) test_signbit(cuda::std::numeric_limits::signaling_NaN()); } + // numeric_limits::has_denorm has been deprecated since C++23 + _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - test_signbit(cuda::std::numeric_limits::denorm_min()); + _CCCL_SUPPRESS_DEPRECATED_POP + { + test_signbit(cuda::std::numeric_limits::denorm_min()); + } } } From d3fab50a58803c8964278c894731fb470b075440 Mon Sep 17 00:00:00 2001 From: David Bayer Date: Fri, 15 May 2026 10:31:14 +0200 Subject: [PATCH 2/3] fix failures --- c2h/include/c2h/catch2_test_helper.h | 29 ---------------------------- c2h/include/c2h/catch2_test_macros.h | 29 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/c2h/include/c2h/catch2_test_helper.h b/c2h/include/c2h/catch2_test_helper.h index a32a54106d4..565266d0e1c 100644 --- a/c2h/include/c2h/catch2_test_helper.h +++ b/c2h/include/c2h/catch2_test_helper.h @@ -33,35 +33,6 @@ #include #include -// workaround for error #3185-D: no '#pragma diagnostic push' was found to match this 'diagnostic pop' -#if _CCCL_COMPILER(NVHPC) -# undef CATCH_INTERNAL_START_WARNINGS_SUPPRESSION -# undef CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION -# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma("diag push") -# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma("diag pop") -#endif -// The nv_diagnostic pragmas in Catch2 macros cause cicc to hang indefinitely in CTK 13.0. -// See NVBugs 5475335. -#if _CCCL_VERSION_COMPARE(_CCCL_CTK_, _CCCL_CTK, ==, 13, 0) -# undef CATCH_INTERNAL_START_WARNINGS_SUPPRESSION -# undef CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION -# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION -# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION -#endif -// workaround for error -// * MSVC14.39: #3185-D: no '#pragma diagnostic push' was found to match this 'diagnostic pop' -// * MSVC14.29: internal error: assertion failed: alloc_copy_of_pending_pragma: copied pragma has source sequence entry -// (pragma.c, line 526 in alloc_copy_of_pending_pragma) -// see also upstream Catch2 issue: https://github.com/catchorg/Catch2/issues/2636 -#if _CCCL_COMPILER(MSVC) -# undef CATCH_INTERNAL_START_WARNINGS_SUPPRESSION -# undef CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION -# undef CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS -# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION -# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION -# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS -#endif - #ifndef VAR_IDX # define VAR_IDX 0 #endif diff --git a/c2h/include/c2h/catch2_test_macros.h b/c2h/include/c2h/catch2_test_macros.h index 8de20d3330e..927cc88be88 100644 --- a/c2h/include/c2h/catch2_test_macros.h +++ b/c2h/include/c2h/catch2_test_macros.h @@ -22,6 +22,35 @@ // Only a subset of the Catch2's macro are provided. If needed, feel free to extend the support. Host-only macros can // be determined by missing NV_IF_ELSE_TARGET wrapper and immediate dispatch to CATCH_-prefixed variant. +// workaround for error #3185-D: no '#pragma diagnostic push' was found to match this 'diagnostic pop' +#if _CCCL_COMPILER(NVHPC) +# undef CATCH_INTERNAL_START_WARNINGS_SUPPRESSION +# undef CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma("diag push") +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma("diag pop") +#endif +// The nv_diagnostic pragmas in Catch2 macros cause cicc to hang indefinitely in CTK 13.0. +// See NVBugs 5475335. +#if _CCCL_VERSION_COMPARE(_CCCL_CTK_, _CCCL_CTK, ==, 13, 0) +# undef CATCH_INTERNAL_START_WARNINGS_SUPPRESSION +# undef CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION +#endif +// workaround for error +// * MSVC14.39: #3185-D: no '#pragma diagnostic push' was found to match this 'diagnostic pop' +// * MSVC14.29: internal error: assertion failed: alloc_copy_of_pending_pragma: copied pragma has source sequence entry +// (pragma.c, line 526 in alloc_copy_of_pending_pragma) +// see also upstream Catch2 issue: https://github.com/catchorg/Catch2/issues/2636 +#if _CCCL_COMPILER(MSVC) +# undef CATCH_INTERNAL_START_WARNINGS_SUPPRESSION +# undef CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION +# undef CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION +# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS +#endif + // We must pass the COND as a cstring parameter, because it might contain the '%' character that would break the printf // formatting. #define C2H_INTERNAL_DEVICE_TEST_PRINT(KIND, COND) \ From 37fa585a8bcff9391fcf567f76cecdb8c2080e1d Mon Sep 17 00:00:00 2001 From: David Bayer Date: Fri, 15 May 2026 10:35:09 +0200 Subject: [PATCH 3/3] fix msvc + nvcc 12.X --- .../std/numerics/c.math/fp_manip/copysign.pass.cpp | 12 ++++++------ .../numerics/c.math/fp_traits/fpclassify.pass.cpp | 14 +++++++------- .../numerics/c.math/fp_traits/isfinite.pass.cpp | 12 ++++++------ .../std/numerics/c.math/fp_traits/isinf.pass.cpp | 12 ++++++------ .../std/numerics/c.math/fp_traits/isnan.pass.cpp | 12 ++++++------ .../numerics/c.math/fp_traits/isnormal.pass.cpp | 12 ++++++------ .../std/numerics/c.math/fp_traits/signbit.pass.cpp | 12 ++++++------ 7 files changed, 43 insertions(+), 43 deletions(-) diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_manip/copysign.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_manip/copysign.pass.cpp index d0674384d24..c12fc11e793 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_manip/copysign.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_manip/copysign.pass.cpp @@ -22,6 +22,11 @@ #include "test_macros.h" +// numeric_limits::has_denorm has been deprecated since C++23 +#if _CCCL_STD_VER >= 2023 +_CCCL_SUPPRESS_DEPRECATED_PUSH +#endif // _CCCL_STD_VER >= 2023 + template TEST_FUNC constexpr void test_copysign(const T mag, const T sign, bool expected) { @@ -122,14 +127,9 @@ TEST_FUNC constexpr void test_type(float val) test_copysign(cuda::std::numeric_limits::signaling_NaN()); } - // numeric_limits::has_denorm has been deprecated since C++23 - _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - _CCCL_SUPPRESS_DEPRECATED_POP - { - test_copysign(cuda::std::numeric_limits::denorm_min()); - } + test_copysign(cuda::std::numeric_limits::denorm_min()); } } diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/fpclassify.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/fpclassify.pass.cpp index 6305a32c2f7..ef703b95c90 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/fpclassify.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/fpclassify.pass.cpp @@ -22,6 +22,11 @@ #include "test_macros.h" +// numeric_limits::has_denorm has been deprecated since C++23 +#if _CCCL_STD_VER >= 2023 +_CCCL_SUPPRESS_DEPRECATED_PUSH +#endif // _CCCL_STD_VER >= 2023 + template TEST_FUNC constexpr void test_fpclassify(T val, int expected) { @@ -79,15 +84,10 @@ TEST_FUNC constexpr void test_type() test_fpclassify(cuda::std::numeric_limits::signaling_NaN(), FP_NAN); } - // numeric_limits::has_denorm has been deprecated since C++23 - _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - _CCCL_SUPPRESS_DEPRECATED_POP - { - // fixme: behaviour of subnormal values depends on the FP mode, may result in FP_ZERO - // test_fpclassify(cuda::std::numeric_limits::denorm_min(), FP_SUBNORMAL); - } + // fixme: behaviour of subnormal values depends on the FP mode, may result in FP_ZERO + // test_fpclassify(cuda::std::numeric_limits::denorm_min(), FP_SUBNORMAL); } } diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isfinite.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isfinite.pass.cpp index 6ba33227eb0..bb1ac5cdb62 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isfinite.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isfinite.pass.cpp @@ -21,6 +21,11 @@ #include "test_macros.h" +// numeric_limits::has_denorm has been deprecated since C++23 +#if _CCCL_STD_VER >= 2023 +_CCCL_SUPPRESS_DEPRECATED_PUSH +#endif // _CCCL_STD_VER >= 2023 + template TEST_FUNC constexpr void test_isfinite(const T pos, bool expected) { @@ -78,14 +83,9 @@ TEST_FUNC constexpr void test_type() test_isfinite(cuda::std::numeric_limits::signaling_NaN(), false); } - // numeric_limits::has_denorm has been deprecated since C++23 - _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - _CCCL_SUPPRESS_DEPRECATED_POP - { - test_isfinite(cuda::std::numeric_limits::denorm_min(), true); - } + test_isfinite(cuda::std::numeric_limits::denorm_min(), true); } } diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isinf.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isinf.pass.cpp index 5078d0e14e9..4a3f15ce447 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isinf.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isinf.pass.cpp @@ -21,6 +21,11 @@ #include "test_macros.h" +// numeric_limits::has_denorm has been deprecated since C++23 +#if _CCCL_STD_VER >= 2023 +_CCCL_SUPPRESS_DEPRECATED_PUSH +#endif // _CCCL_STD_VER >= 2023 + template TEST_FUNC constexpr void test_isinf(const T pos, bool expected) { @@ -78,14 +83,9 @@ TEST_FUNC constexpr void test_type() test_isinf(cuda::std::numeric_limits::signaling_NaN(), false); } - // numeric_limits::has_denorm has been deprecated since C++23 - _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - _CCCL_SUPPRESS_DEPRECATED_POP - { - test_isinf(cuda::std::numeric_limits::denorm_min(), false); - } + test_isinf(cuda::std::numeric_limits::denorm_min(), false); } } diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnan.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnan.pass.cpp index cadca869eef..a9c8dbc23c9 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnan.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnan.pass.cpp @@ -21,6 +21,11 @@ #include "test_macros.h" +// numeric_limits::has_denorm has been deprecated since C++23 +#if _CCCL_STD_VER >= 2023 +_CCCL_SUPPRESS_DEPRECATED_PUSH +#endif // _CCCL_STD_VER >= 2023 + template TEST_FUNC constexpr void test_isnan(const T pos, bool expected) { @@ -78,14 +83,9 @@ TEST_FUNC constexpr void test_type() test_isnan(cuda::std::numeric_limits::signaling_NaN(), true); } - // numeric_limits::has_denorm has been deprecated since C++23 - _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - _CCCL_SUPPRESS_DEPRECATED_POP - { - test_isnan(cuda::std::numeric_limits::denorm_min(), false); - } + test_isnan(cuda::std::numeric_limits::denorm_min(), false); } } diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnormal.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnormal.pass.cpp index e02a355e797..38abe5e3d78 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnormal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnormal.pass.cpp @@ -22,6 +22,11 @@ #include "test_macros.h" +// numeric_limits::has_denorm has been deprecated since C++23 +#if _CCCL_STD_VER >= 2023 +_CCCL_SUPPRESS_DEPRECATED_PUSH +#endif // _CCCL_STD_VER >= 2023 + template TEST_FUNC constexpr void test_isnormal(const T pos, bool expected) { @@ -80,14 +85,9 @@ TEST_FUNC constexpr void test_type() test_isnormal(cuda::std::numeric_limits::signaling_NaN(), false); } - // numeric_limits::has_denorm has been deprecated since C++23 - _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - _CCCL_SUPPRESS_DEPRECATED_POP - { - test_isnormal(cuda::std::numeric_limits::denorm_min(), false); - } + test_isnormal(cuda::std::numeric_limits::denorm_min(), false); } } diff --git a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/signbit.pass.cpp b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/signbit.pass.cpp index 5cfe8ddc609..92a63b946cb 100644 --- a/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/signbit.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/signbit.pass.cpp @@ -22,6 +22,11 @@ #include "test_macros.h" +// numeric_limits::has_denorm has been deprecated since C++23 +#if _CCCL_STD_VER >= 2023 +_CCCL_SUPPRESS_DEPRECATED_PUSH +#endif // _CCCL_STD_VER >= 2023 + template TEST_FUNC constexpr void test_signbit(const T pos) { @@ -89,14 +94,9 @@ TEST_FUNC constexpr void test_type(float val) test_signbit(cuda::std::numeric_limits::signaling_NaN()); } - // numeric_limits::has_denorm has been deprecated since C++23 - _CCCL_SUPPRESS_DEPRECATED_PUSH if constexpr (cuda::std::numeric_limits::has_denorm) { - _CCCL_SUPPRESS_DEPRECATED_POP - { - test_signbit(cuda::std::numeric_limits::denorm_min()); - } + test_signbit(cuda::std::numeric_limits::denorm_min()); } }