diff --git a/examples/dot_product/dot_product.cpp b/examples/dot_product/dot_product.cpp index f4202861..7141177a 100644 --- a/examples/dot_product/dot_product.cpp +++ b/examples/dot_product/dot_product.cpp @@ -55,9 +55,10 @@ T dot_product( Kokkos::mdspan b ) //requires ExtsA::rank() == ExtsB::rank() && ExtsA::rank() == 2 { + using int_t = typename ExtsA::index_type; T result = 0; - for(int i = 0; i < a.extent(0); ++i) { - for(int j = 0; j < a.extent(1); ++j) { + for(int_t i = 0; i < a.extent(0); ++i) { + for(int_t j = 0; j < a.extent(1); ++j) { #if MDSPAN_USE_BRACKET_OPERATOR result += a[i, j] * b[i, j]; #else @@ -78,9 +79,10 @@ void fill_in_order( Kokkos::mdspan a ) // requires ExtsA::rank() == 2 { + using int_t = typename ExtsA::index_type; T count = 0; - for(int i = 0; i < a.extent(0); ++i) { - for(int j = 0; j < a.extent(1); ++j) { + for(int_t i = 0; i < a.extent(0); ++i) { + for(int_t j = 0; j < a.extent(1); ++j) { #if MDSPAN_USE_BRACKET_OPERATOR a[i, j] = count++; #else diff --git a/include/experimental/__p0009_bits/layout_stride.hpp b/include/experimental/__p0009_bits/layout_stride.hpp index ded3156e..ea2cd380 100644 --- a/include/experimental/__p0009_bits/layout_stride.hpp +++ b/include/experimental/__p0009_bits/layout_stride.hpp @@ -651,15 +651,15 @@ constexpr void validate_strides(with_rank, Layout, const Extents& ext, const constexpr auto is_left = std::is_same::value; - typename Extents::index_type stride = 1; + typename Extents::index_type expected_stride = 1; for (std::size_t r = 0; r < N; r++) { const std::size_t s = is_left ? r : N - 1 - r; - MDSPAN_IMPL_PRECONDITION(common_integral_compare(stride, other.stride(s)) + MDSPAN_IMPL_PRECONDITION(common_integral_compare(expected_stride, other.stride(s)) and "invalid strides for layout_{left,right}"); - stride *= ext.extent(s); + expected_stride *= ext.extent(s); } } diff --git a/include/experimental/__p2630_bits/submdspan_mapping.hpp b/include/experimental/__p2630_bits/submdspan_mapping.hpp index e7ad9753..543a0919 100644 --- a/include/experimental/__p2630_bits/submdspan_mapping.hpp +++ b/include/experimental/__p2630_bits/submdspan_mapping.hpp @@ -41,10 +41,10 @@ template MDSPAN_INLINE_FUNCTION constexpr bool -one_slice_out_of_bounds(const IndexType& extent, const Slice& slice) +one_slice_out_of_bounds(const IndexType& ext, const Slice& slice) { using common_t = std::common_type_t; - return static_cast(detail::first_of(slice)) == static_cast(extent); + return static_cast(detail::first_of(slice)) == static_cast(ext); } template