Skip to content

Commit

Permalink
Even more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Jan 22, 2025
1 parent b3b24df commit 0ec4d1b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions libcudacxx/include/cuda/std/__mdspan/layout_stride.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class layout_stride::mapping
template <class _OtherIndexType>
_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<index_type, _OtherIndexType>;
Expand All @@ -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;
Expand Down Expand Up @@ -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)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct Derived : public Base
template <class FromT, class ToT>
__host__ __device__ constexpr void test_conversion()
{
cuda::std::default_accessor<FromT> acc_from;
cuda::std::default_accessor<FromT> acc_from{};
ASSERT_NOEXCEPT(cuda::std::default_accessor<ToT>(acc_from));
cuda::std::default_accessor<ToT> acc_to(acc_from);
unused(acc_to);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ template <class T>
__host__ __device__ constexpr void test_construction()
{
ASSERT_NOEXCEPT(cuda::std::default_accessor<T>{});
cuda::std::default_accessor<T> acc;
cuda::std::default_accessor<T> acc{};
static_assert(cuda::std::is_trivially_default_constructible<cuda::std::default_accessor<T>>::value);
unused(acc);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t>());
#endif // !_CCCL_NO_DEDUCTION_GUIDES
test(cuda::std::extents(1), cuda::std::extents<cuda::std::size_t, D>(1));
test(cuda::std::extents(1, 2u), cuda::std::extents<cuda::std::size_t, D, D>(1, 2u));
test(cuda::std::extents(1, 2u, 3, 4, 5, 6, 7, 8, 9),
Expand Down

0 comments on commit 0ec4d1b

Please sign in to comment.