From 66fd8d404dfd653e29d03537e8fd3ca1bdcab273 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Wed, 22 Jan 2025 09:18:41 +0100 Subject: [PATCH] Even more fixes --- libcudacxx/include/cuda/std/__mdspan/layout_stride.h | 3 +++ .../views/mdspan/default_accessor/ctor.conversion.pass.cpp | 2 +- .../views/mdspan/default_accessor/ctor.default.pass.cpp | 2 +- .../std/containers/views/mdspan/extents/ctad.pass.cpp | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libcudacxx/include/cuda/std/__mdspan/layout_stride.h b/libcudacxx/include/cuda/std/__mdspan/layout_stride.h index 4a64df0eda8..1c0e966b1a5 100644 --- a/libcudacxx/include/cuda/std/__mdspan/layout_stride.h +++ b/libcudacxx/include/cuda/std/__mdspan/layout_stride.h @@ -123,6 +123,7 @@ class layout_stride::mapping template _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __conversion_may_overflow(_OtherIndexType __stride) noexcept { + (void) __stride; // nvcc believes stride is unused here if constexpr (_CCCL_TRAIT(is_integral, _OtherIndexType)) { using _CommonType = common_type_t; @@ -139,6 +140,7 @@ class layout_stride::mapping _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __required_span_size_is_representable( const extents_type& __ext, span<_OtherIndexType, extents_type::rank()> __strides) { + (void) __strides; // nvcc believes strides is unused here if constexpr (extents_type::rank() != 0) { index_type __size = 1; @@ -232,6 +234,7 @@ class layout_stride::mapping _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto __check_strides(span<_OtherIndexType, extents_type::rank()> __strides, index_sequence<_Pos...>) noexcept { + (void) __strides; // nvcc believes strides is unused here if constexpr (_CCCL_TRAIT(is_integral, _OtherIndexType)) { return _CCCL_FOLD_AND((__strides[_Pos] > static_cast<_OtherIndexType>(0))); diff --git a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/default_accessor/ctor.conversion.pass.cpp b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/default_accessor/ctor.conversion.pass.cpp index 533a2b2ab49..9045e72cedb 100644 --- a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/default_accessor/ctor.conversion.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/default_accessor/ctor.conversion.pass.cpp @@ -34,7 +34,7 @@ struct Derived : public Base template __host__ __device__ constexpr void test_conversion() { - cuda::std::default_accessor acc_from; + cuda::std::default_accessor acc_from{}; ASSERT_NOEXCEPT(cuda::std::default_accessor(acc_from)); cuda::std::default_accessor acc_to(acc_from); unused(acc_to); diff --git a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/default_accessor/ctor.default.pass.cpp b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/default_accessor/ctor.default.pass.cpp index fcf3661225c..8a571b0b8a2 100644 --- a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/default_accessor/ctor.default.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/default_accessor/ctor.default.pass.cpp @@ -27,7 +27,7 @@ template __host__ __device__ constexpr void test_construction() { ASSERT_NOEXCEPT(cuda::std::default_accessor{}); - cuda::std::default_accessor acc; + cuda::std::default_accessor acc{}; static_assert(cuda::std::is_trivially_default_constructible>::value); unused(acc); } diff --git a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/extents/ctad.pass.cpp b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/extents/ctad.pass.cpp index 2185bddc444..8064b2e35e8 100644 --- a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/extents/ctad.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/extents/ctad.pass.cpp @@ -34,7 +34,9 @@ __host__ __device__ constexpr bool test() { constexpr cuda::std::size_t D = cuda::std::dynamic_extent; +#if !defined(_CCCL_NO_DEDUCTION_GUIDES) test(cuda::std::extents(), cuda::std::extents()); +#endif // !_CCCL_NO_DEDUCTION_GUIDES test(cuda::std::extents(1), cuda::std::extents(1)); test(cuda::std::extents(1, 2u), cuda::std::extents(1, 2u)); test(cuda::std::extents(1, 2u, 3, 4, 5, 6, 7, 8, 9),