diff --git a/benchmarks/fill.hpp b/benchmarks/fill.hpp index cc79fa70..13fd0c5f 100644 --- a/benchmarks/fill.hpp +++ b/benchmarks/fill.hpp @@ -18,8 +18,6 @@ #include -namespace KokkosEx = MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE; - #include #include diff --git a/benchmarks/sum/sum_3d_common.hpp b/benchmarks/sum/sum_3d_common.hpp index e38ec165..70ed1d92 100644 --- a/benchmarks/sum/sum_3d_common.hpp +++ b/benchmarks/sum/sum_3d_common.hpp @@ -20,8 +20,6 @@ #include "fill.hpp" -namespace KokkosEx = MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE; - template void BM_Raw_Sum_1D(benchmark::State& state, T, Size size) { auto buffer = std::make_unique(size); diff --git a/compilation_tests/ctest_layout_convertible.cpp b/compilation_tests/ctest_layout_convertible.cpp index 935085db..a82b7928 100644 --- a/compilation_tests/ctest_layout_convertible.cpp +++ b/compilation_tests/ctest_layout_convertible.cpp @@ -104,11 +104,11 @@ MDSPAN_STATIC_TEST(std::is_convertible, LS1>: MDSPAN_STATIC_TEST(std::is_assignable>::value); #if MDSPAN_HAS_CXX_17 -MDSPAN_STATIC_TEST(std::is_constructible::mapping>::value); -MDSPAN_STATIC_TEST(std::is_convertible::mapping, LS1>::value); -MDSPAN_STATIC_TEST(std::is_assignable::mapping>::value); +MDSPAN_STATIC_TEST(std::is_constructible::mapping>::value); +MDSPAN_STATIC_TEST(std::is_convertible::mapping, LS1>::value); +MDSPAN_STATIC_TEST(std::is_assignable::mapping>::value); -MDSPAN_STATIC_TEST(std::is_constructible::mapping>::value); -MDSPAN_STATIC_TEST(std::is_convertible::mapping, LS1>::value); -MDSPAN_STATIC_TEST(std::is_assignable::mapping>::value); +MDSPAN_STATIC_TEST(std::is_constructible::mapping>::value); +MDSPAN_STATIC_TEST(std::is_convertible::mapping, LS1>::value); +MDSPAN_STATIC_TEST(std::is_assignable::mapping>::value); #endif diff --git a/include/experimental/__p0009_bits/layout_left.hpp b/include/experimental/__p0009_bits/layout_left.hpp index e1198008..5feb36f6 100644 --- a/include/experimental/__p0009_bits/layout_left.hpp +++ b/include/experimental/__p0009_bits/layout_left.hpp @@ -118,30 +118,28 @@ class layout_left::mapping { /** * Converting constructor from `layout_left_padded::mapping`. * - * This overload participates in overload resolution only if Mapping is a layout_left_padded mapping and - * extents_type is constructible from Mapping::extents_type. + * This overload participates in overload resolution only if Mapping is a + * layout_left_padded mapping and extents_type is constructible from + * Mapping::extents_type. * - * \note There is currently a difference from p2642r2, where this function is specified as taking - * `layout_left_padded< padding_value >::mapping< Extents>`. However, this makes `padding_value` non-deducible. + * \note There is currently a difference from p2642r2, where this function + * is specified as taking `layout_left_padded< padding_value >::mapping< + * Extents>`. However, this makes `padding_value` non-deducible. */ MDSPAN_TEMPLATE_REQUIRES( - class Mapping, - /* requires */ ( - MDSPAN_IMPL_PROPOSED_NAMESPACE::detail::is_layout_left_padded_mapping::value - && std::is_constructible_v - ) - ) - MDSPAN_CONDITIONAL_EXPLICIT((!std::is_convertible_v)) - MDSPAN_INLINE_FUNCTION constexpr - mapping(const Mapping& other) noexcept - : m_extents(other.extents()) - { - MDSPAN_IMPL_PROPOSED_NAMESPACE::detail:: - check_padded_layout_converting_constructor_mandates< - extents_type, Mapping>(detail::with_rank{}); - MDSPAN_IMPL_PROPOSED_NAMESPACE::detail:: - check_padded_layout_converting_constructor_preconditions< - extents_type>(detail::with_rank{}, other); + class Mapping, + /* requires */ (detail::is_layout_left_padded_mapping::value + &&std::is_constructible_v< + extents_type, typename Mapping::extents_type>)) + MDSPAN_CONDITIONAL_EXPLICIT( + (!std::is_convertible_v)) + MDSPAN_INLINE_FUNCTION constexpr mapping(const Mapping &other) noexcept + : m_extents(other.extents()) { + detail::check_padded_layout_converting_constructor_mandates( + detail::with_rank{}); + detail::check_padded_layout_converting_constructor_preconditions< + extents_type>(detail::with_rank{}, other); } #endif diff --git a/include/experimental/__p0009_bits/layout_right.hpp b/include/experimental/__p0009_bits/layout_right.hpp index d95c180e..f4487d21 100644 --- a/include/experimental/__p0009_bits/layout_right.hpp +++ b/include/experimental/__p0009_bits/layout_right.hpp @@ -128,20 +128,18 @@ class layout_right::mapping { #if MDSPAN_HAS_CXX_17 MDSPAN_TEMPLATE_REQUIRES( class Mapping, - /* requires */ ( - MDSPAN_IMPL_PROPOSED_NAMESPACE::detail::is_layout_right_padded_mapping::value - && std::is_constructible_v)) - MDSPAN_CONDITIONAL_EXPLICIT((!std::is_convertible_v)) - MDSPAN_INLINE_FUNCTION constexpr - mapping(const Mapping &other) noexcept - : m_extents(other.extents()) - { - MDSPAN_IMPL_PROPOSED_NAMESPACE::detail:: - check_padded_layout_converting_constructor_mandates< - extents_type, Mapping>(detail::with_rank{}); - MDSPAN_IMPL_PROPOSED_NAMESPACE::detail:: - check_padded_layout_converting_constructor_preconditions< - extents_type>(detail::with_rank{}, other); + /* requires */ (detail::is_layout_right_padded_mapping::value + &&std::is_constructible_v< + extents_type, typename Mapping::extents_type>)) + MDSPAN_CONDITIONAL_EXPLICIT( + (!std::is_convertible_v)) + MDSPAN_INLINE_FUNCTION constexpr mapping(const Mapping &other) noexcept + : m_extents(other.extents()) { + detail::check_padded_layout_converting_constructor_mandates( + detail::with_rank{}); + detail::check_padded_layout_converting_constructor_preconditions< + extents_type>(detail::with_rank{}, other); } #endif diff --git a/include/experimental/__p0009_bits/layout_stride.hpp b/include/experimental/__p0009_bits/layout_stride.hpp index 2227f230..0333547a 100644 --- a/include/experimental/__p0009_bits/layout_stride.hpp +++ b/include/experimental/__p0009_bits/layout_stride.hpp @@ -445,8 +445,8 @@ struct layout_stride { !(std::is_convertible::value && (detail::is_mapping_of || detail::is_mapping_of || - MDSPAN_IMPL_PROPOSED_NAMESPACE::detail::is_layout_left_padded_mapping::value || // Don't need to guard for C++14 as this isn't compiled in < C++20 - MDSPAN_IMPL_PROPOSED_NAMESPACE::detail::is_layout_right_padded_mapping::value || + detail::is_layout_left_padded_mapping::value || // Don't need to guard for C++14 as this isn't compiled in < C++20 + detail::is_layout_right_padded_mapping::value || detail::is_mapping_of)) ) // needs two () due to comma MDSPAN_INLINE_FUNCTION MDSPAN_IMPL_CONSTEXPR_14 diff --git a/include/experimental/__p2389_bits/dims.hpp b/include/experimental/__p2389_bits/dims.hpp index 00045215..943facda 100644 --- a/include/experimental/__p2389_bits/dims.hpp +++ b/include/experimental/__p2389_bits/dims.hpp @@ -16,13 +16,10 @@ #pragma once -// backward compatibility import into experimental namespace MDSPAN_IMPL_STANDARD_NAMESPACE { -namespace MDSPAN_IMPL_PROPOSED_NAMESPACE { template< ::std::size_t Rank, class IndexType = std::size_t> using dims = :: MDSPAN_IMPL_STANDARD_NAMESPACE :: dextents; -} // namespace MDSPAN_IMPL_PROPOSED_NAMESPACE } // namespace MDSPAN_IMPL_STANDARD_NAMESPACE diff --git a/include/experimental/__p2630_bits/submdspan_mapping.hpp b/include/experimental/__p2630_bits/submdspan_mapping.hpp index 3a87dff9..cbd06678 100644 --- a/include/experimental/__p2630_bits/submdspan_mapping.hpp +++ b/include/experimental/__p2630_bits/submdspan_mapping.hpp @@ -235,7 +235,7 @@ layout_left::mapping::submdspan_mapping_impl( offset}; } else if constexpr (deduce_layout::layout_left_padded_value()) { constexpr size_t S_static = MDSPAN_IMPL_STANDARD_NAMESPACE::detail::compute_s_static_layout_left(std::make_index_sequence()); - using dst_mapping_t = typename MDSPAN_IMPL_PROPOSED_NAMESPACE::layout_left_padded::template mapping; + using dst_mapping_t = typename layout_left_padded::template mapping; return submdspan_mapping_result{ dst_mapping_t(dst_ext, stride(1 + deduce_layout::gap_len)), offset}; } else { @@ -269,7 +269,7 @@ template template template MDSPAN_INLINE_FUNCTION constexpr auto -MDSPAN_IMPL_PROPOSED_NAMESPACE::layout_left_padded::mapping::submdspan_mapping_impl( +layout_left_padded::mapping::submdspan_mapping_impl( SliceSpecifiers... slices) const { // compute sub extents @@ -278,7 +278,7 @@ MDSPAN_IMPL_PROPOSED_NAMESPACE::layout_left_padded::mapping::template mapping; + using dst_mapping_t = typename layout_left_padded::template mapping; return submdspan_mapping_result{*this, 0}; } else { const bool out_of_bounds = @@ -314,7 +314,7 @@ MDSPAN_IMPL_PROPOSED_NAMESPACE::layout_left_padded::mapping{dst_mapping_t{dst_ext}, offset}; } else if constexpr (deduce_layout::layout_left_padded_value()) { // can keep layout_left_padded constexpr size_t S_static = MDSPAN_IMPL_STANDARD_NAMESPACE::detail::compute_s_static_layout_left(std::make_index_sequence()); - using dst_mapping_t = typename MDSPAN_IMPL_PROPOSED_NAMESPACE::layout_left_padded::template mapping; + using dst_mapping_t = typename layout_left_padded::template mapping; return submdspan_mapping_result{ dst_mapping_t(dst_ext, stride(1 + deduce_layout::gap_len)), offset}; } else { // layout_stride @@ -463,7 +463,7 @@ layout_right::mapping::submdspan_mapping_impl( offset}; } else if constexpr (deduce_layout::layout_right_padded_value()) { constexpr size_t S_static = MDSPAN_IMPL_STANDARD_NAMESPACE::detail::compute_s_static_layout_left(std::make_index_sequence()); - using dst_mapping_t = typename MDSPAN_IMPL_PROPOSED_NAMESPACE::layout_right_padded::template mapping; + using dst_mapping_t = typename layout_right_padded::template mapping; return submdspan_mapping_result{ dst_mapping_t(dst_ext, stride(src_ext_t::rank() - 2 - deduce_layout::gap_len)), @@ -499,7 +499,7 @@ template template template MDSPAN_INLINE_FUNCTION constexpr auto -MDSPAN_IMPL_PROPOSED_NAMESPACE::layout_right_padded::mapping::submdspan_mapping_impl( +layout_right_padded::mapping::submdspan_mapping_impl( SliceSpecifiers... slices) const { // compute sub extents @@ -508,7 +508,7 @@ MDSPAN_IMPL_PROPOSED_NAMESPACE::layout_right_padded::mapping::template mapping; + using dst_mapping_t = typename layout_right_padded::template mapping; return submdspan_mapping_result{*this, 0}; } else { // Figure out if any slice's lower bound equals the corresponding extent. @@ -536,7 +536,7 @@ MDSPAN_IMPL_PROPOSED_NAMESPACE::layout_right_padded::mapping{dst_mapping_t{dst_ext}, offset}; } else if constexpr (deduce_layout::layout_right_padded_value()) { // can keep layout_right_padded constexpr size_t S_static = MDSPAN_IMPL_STANDARD_NAMESPACE::detail::compute_s_static_layout_right(std::make_index_sequence()); - using dst_mapping_t = typename MDSPAN_IMPL_PROPOSED_NAMESPACE::layout_right_padded::template mapping; + using dst_mapping_t = typename layout_right_padded::template mapping; return submdspan_mapping_result{ dst_mapping_t(dst_ext, stride(Extents::rank() - 2 - deduce_layout::gap_len)), offset}; } else { // layout_stride diff --git a/include/experimental/__p2642_bits/layout_padded.hpp b/include/experimental/__p2642_bits/layout_padded.hpp index d91313b2..e57d3005 100644 --- a/include/experimental/__p2642_bits/layout_padded.hpp +++ b/include/experimental/__p2642_bits/layout_padded.hpp @@ -26,7 +26,6 @@ #include "../__p0009_bits/utility.hpp" namespace MDSPAN_IMPL_STANDARD_NAMESPACE { -namespace MDSPAN_IMPL_PROPOSED_NAMESPACE { namespace detail { template MDSPAN_INLINE_FUNCTION @@ -81,7 +80,7 @@ struct static_array_type_for_padded_extent { using extents_type = Extents; using type = ::MDSPAN_IMPL_STANDARD_NAMESPACE::detail::maybe_static_array< index_type, size_t, dynamic_extent, - ::MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::detail:: + ::MDSPAN_IMPL_STANDARD_NAMESPACE::detail:: get_actual_static_padding_value()>; }; @@ -1086,4 +1085,3 @@ class layout_right_padded::mapping { } }; } -} diff --git a/include/experimental/__p2642_bits/layout_padded_fwd.hpp b/include/experimental/__p2642_bits/layout_padded_fwd.hpp index 481b1d5c..38e783f9 100644 --- a/include/experimental/__p2642_bits/layout_padded_fwd.hpp +++ b/include/experimental/__p2642_bits/layout_padded_fwd.hpp @@ -20,7 +20,6 @@ #include "../__p0009_bits/utility.hpp" namespace MDSPAN_IMPL_STANDARD_NAMESPACE { -namespace MDSPAN_IMPL_PROPOSED_NAMESPACE { template struct layout_left_padded { @@ -134,4 +133,3 @@ constexpr void check_padded_layout_converting_constructor_preconditions(MDSPAN_I } } -} diff --git a/tests/test_dims.cpp b/tests/test_dims.cpp index 7ceb6f35..1e04da5f 100644 --- a/tests/test_dims.cpp +++ b/tests/test_dims.cpp @@ -31,7 +31,7 @@ static constexpr bool is_extents_v< template void test_dims_with_one_template_argument() { - using d = MDSPAN_IMPL_STANDARD_NAMESPACE :: MDSPAN_IMPL_PROPOSED_NAMESPACE :: dims; + using d = MDSPAN_IMPL_STANDARD_NAMESPACE :: dims; static_assert(test::is_extents_v, "dims is not an extents specialization"); static_assert(std::is_same::value, "dims::index_type is wrong"); static_assert(d::rank() == Rank, "dims::rank() is wrong"); @@ -40,12 +40,12 @@ void test_dims_with_one_template_argument() template void test_dims_with_two_template_arguments() { - using d = MDSPAN_IMPL_STANDARD_NAMESPACE :: MDSPAN_IMPL_PROPOSED_NAMESPACE :: dims; + using d = MDSPAN_IMPL_STANDARD_NAMESPACE :: dims; static_assert(test::is_extents_v, "dims is not an extents specialization"); static_assert(std::is_same::value, "dims::index_type is wrong"); static_assert(d::rank() == Rank, "dims::rank() is wrong"); } - + } // namespace test TEST(TestDims, Test0) diff --git a/tests/test_layout_padded_left.cpp b/tests/test_layout_padded_left.cpp index 8e17eb90..a7df6b37 100644 --- a/tests/test_layout_padded_left.cpp +++ b/tests/test_layout_padded_left.cpp @@ -4,48 +4,46 @@ #include #include -namespace KokkosEx = MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE; - // Compile time tests // For internal traits struct fake_mapping { - using layout_type = Kokkos::Experimental::layout_left_padded<5>; + using layout_type = Kokkos::layout_left_padded<5>; }; -static_assert(!Kokkos::Experimental::detail::is_layout_left_padded_mapping< +static_assert(!Kokkos::detail::is_layout_left_padded_mapping< fake_mapping>::value); -static_assert(Kokkos::Experimental::detail::is_layout_left_padded_mapping< - Kokkos::Experimental::layout_left_padded<4>::mapping< +static_assert(Kokkos::detail::is_layout_left_padded_mapping< + Kokkos::layout_left_padded<4>::mapping< Kokkos::extents>>::value); // layout_left_padded must be trivial -static_assert(std::is_trivial_v>); -static_assert(std::is_trivial_v>); -static_assert(std::is_trivial_v>); +static_assert(std::is_trivial_v>); +static_assert(std::is_trivial_v>); +static_assert(std::is_trivial_v>); // actual padding stride // If extents_type::rank() equals zero or one, then 0. -static_assert(KokkosEx::layout_left_padded<0>::mapping>::static_padding_stride == 0); -static_assert(KokkosEx::layout_left_padded<2>::mapping>::static_padding_stride == 0); -static_assert(KokkosEx::layout_left_padded<2>::mapping>::static_padding_stride == 0); -static_assert(KokkosEx::layout_left_padded<2>::mapping>::static_padding_stride == 0); -static_assert(KokkosEx::layout_left_padded::mapping>::static_padding_stride == 0); -static_assert(KokkosEx::layout_left_padded::mapping>::static_padding_stride == 0); -static_assert(KokkosEx::layout_left_padded::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_left_padded<0>::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_left_padded<2>::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_left_padded<2>::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_left_padded<2>::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_left_padded::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_left_padded::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_left_padded::mapping>::static_padding_stride == 0); // Else, if // - padding_stride does not equal dynamic_extent and // - extents_type::static_extent(0) does not equal dynamic_extent, // then the size_t value which is the least multiple of padding_stride that is greater than or equal to extents_type::static_extent(0). -static_assert(KokkosEx::layout_left_padded<2>::mapping>::static_padding_stride == 4); -static_assert(KokkosEx::layout_left_padded<2>::mapping>::static_padding_stride == 4); +static_assert(Kokkos::layout_left_padded<2>::mapping>::static_padding_stride == 4); +static_assert(Kokkos::layout_left_padded<2>::mapping>::static_padding_stride == 4); // Otherwise, dynamic_extent. -static_assert(KokkosEx::layout_left_padded<2>::mapping>::static_padding_stride == Kokkos::dynamic_extent); -static_assert(KokkosEx::layout_left_padded::mapping>::static_padding_stride == Kokkos::dynamic_extent); -static_assert(KokkosEx::layout_left_padded::mapping>::static_padding_stride == Kokkos::dynamic_extent); +static_assert(Kokkos::layout_left_padded<2>::mapping>::static_padding_stride == Kokkos::dynamic_extent); +static_assert(Kokkos::layout_left_padded::mapping>::static_padding_stride == Kokkos::dynamic_extent); +static_assert(Kokkos::layout_left_padded::mapping>::static_padding_stride == Kokkos::dynamic_extent); namespace { @@ -171,169 +169,169 @@ void test_copy_assignment(const Extents &extents, Size padding_value) TEST(LayoutLeftTests, construction) { // Default Constructor - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); // Copy constructor - test_copy_constructor>(Kokkos::extents()); - test_copy_constructor>(Kokkos::extents()); - test_copy_constructor>(Kokkos::extents()); - test_copy_constructor>(Kokkos::extents()); - test_copy_constructor>(Kokkos::extents(10)); - test_copy_constructor>(Kokkos::extents(10, 9)); - test_copy_constructor>(Kokkos::extents(10, 9, 8)); - - test_copy_constructor>(Kokkos::extents(), 5); - test_copy_constructor>(Kokkos::extents(), 5); - test_copy_constructor>(Kokkos::extents(), 5); - test_copy_constructor>(Kokkos::extents(), 5); + test_copy_constructor>(Kokkos::extents()); + test_copy_constructor>(Kokkos::extents()); + test_copy_constructor>(Kokkos::extents()); + test_copy_constructor>(Kokkos::extents()); + test_copy_constructor>(Kokkos::extents(10)); + test_copy_constructor>(Kokkos::extents(10, 9)); + test_copy_constructor>(Kokkos::extents(10, 9, 8)); + + test_copy_constructor>(Kokkos::extents(), 5); + test_copy_constructor>(Kokkos::extents(), 5); + test_copy_constructor>(Kokkos::extents(), 5); + test_copy_constructor>(Kokkos::extents(), 5); // Copy assignment - test_copy_assignment>(Kokkos::extents()); - test_copy_assignment>(Kokkos::extents()); - test_copy_assignment>(Kokkos::extents()); - test_copy_assignment>(Kokkos::extents()); - test_copy_assignment>(Kokkos::extents(10)); - test_copy_assignment>(Kokkos::extents(10, 9)); - test_copy_assignment>(Kokkos::extents(10, 9, 8)); - - test_copy_assignment>(Kokkos::extents(), 5); - test_copy_assignment>(Kokkos::extents(), 5); - test_copy_assignment>(Kokkos::extents(), 5); - test_copy_assignment>(Kokkos::extents(), 5); + test_copy_assignment>(Kokkos::extents()); + test_copy_assignment>(Kokkos::extents()); + test_copy_assignment>(Kokkos::extents()); + test_copy_assignment>(Kokkos::extents()); + test_copy_assignment>(Kokkos::extents(10)); + test_copy_assignment>(Kokkos::extents(10, 9)); + test_copy_assignment>(Kokkos::extents(10, 9, 8)); + + test_copy_assignment>(Kokkos::extents(), 5); + test_copy_assignment>(Kokkos::extents(), 5); + test_copy_assignment>(Kokkos::extents(), 5); + test_copy_assignment>(Kokkos::extents(), 5); // Constructor only taking an extent // Direct-non-list-initializes inner-mapping with: // - ext, if extents_type::rank() is zero or one; else, - test_0_or_1_rank_padding_stride>(Kokkos::extents{}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{7}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{7}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{7}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{7}); // - ext.extent(0), ext.extent(P_left)..., if padding_stride is dynamic_extent - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{0}); - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{5}); - test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{7}); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{0}); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{5}); + test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{7}); // - S_left, ext.extent(P_left)..., where S_left is the least multiple of padding_stride greater than or equal to ext.extent(0) - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}); - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}); - test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{8}); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}); + test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{8}); // Constructor taking an extent and a dynamic value // Direct-non-list-initializes inner-mapping with: // - ext, if extents_type::rank() is zero or one; else, - test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 4); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 0); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 4); - test_0_or_1_rank_padding_stride>(Kokkos::extents{7}, 4); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 3); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 3255); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 1337); - test_0_or_1_rank_padding_stride>(Kokkos::extents{7}, 6323); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 4); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 0); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 4); + test_0_or_1_rank_padding_stride>(Kokkos::extents{7}, 4); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 3); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 3255); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 1337); + test_0_or_1_rank_padding_stride>(Kokkos::extents{7}, 6323); // - S_left, ext.extent(P_left)..., where S_left is the least multiple of padding_value greater than or equal to ext.extent(0) - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}, 0); - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}, 4); - test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{8}, 4); - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{0}, 2); - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{8}, 4); - test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{8}, 4); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}, 0); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}, 4); + test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{8}, 4); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{0}, 2); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{8}, 4); + test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{8}, 4); // Construct layout_left_padded mapping from layout_left mapping - ASSERT_EQ(KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).padded_stride.value(0)), 4); - - ASSERT_EQ(KokkosEx::layout_left_padded::mapping>(Kokkos::layout_left::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_left::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_left::mapping>()).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_left::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_left::mapping>()).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_left::mapping>(Kokkos::extents{4})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_left::mapping>(Kokkos::extents{4})).padded_stride.value(0)), 4); + ASSERT_EQ(Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left::mapping>()).padded_stride.value(0)), 4); + + ASSERT_EQ(Kokkos::layout_left_padded::mapping>(Kokkos::layout_left::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_left::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_left::mapping>()).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_left::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_left::mapping>()).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_left::mapping>(Kokkos::extents{4})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_left::mapping>(Kokkos::extents{4})).padded_stride.value(0)), 4); // Construct layout_left_padded mapping from layout stride - ASSERT_EQ(KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).padded_stride.value(0)), 8); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).padded_stride.value(0)), 8); - - ASSERT_EQ(KokkosEx::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).padded_stride.value(0)), 8); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).padded_stride.value(0)), 8); + ASSERT_EQ(Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).padded_stride.value(0)), 8); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).padded_stride.value(0)), 8); + + ASSERT_EQ(Kokkos::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 4})).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).padded_stride.value(0)), 8); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1, 8})).padded_stride.value(0)), 8); // Construct layout_left_padded mapping from another layout_left_padded mapping - ASSERT_EQ(KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>(Kokkos::extents(4))).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>(Kokkos::extents(4))).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 4); - - ASSERT_EQ(KokkosEx::layout_left_padded::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 8); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 8); + ASSERT_EQ(Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>(Kokkos::extents(4))).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>(Kokkos::extents(4))).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 4); + + ASSERT_EQ(Kokkos::layout_left_padded::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 8); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 8); // Construct layout_left_padded mapping from layout_right_padded mapping - ASSERT_EQ(KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_right_padded<4>::mapping>(Kokkos::dextents(3))).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_right_padded<4>::mapping>(Kokkos::dextents(3))).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_right_padded::mapping>({}, 4)).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>(KokkosEx::layout_right_padded::mapping>({}, 4)).padded_stride.value(0)), 0); - - ASSERT_EQ(KokkosEx::layout_left_padded::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(KokkosEx::layout_right_padded::mapping>({}, 4)).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>(KokkosEx::layout_right_padded::mapping>({}, 4)).padded_stride.value(0)), 0); + ASSERT_EQ(Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_right_padded<4>::mapping>(Kokkos::dextents(3))).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_right_padded<4>::mapping>(Kokkos::dextents(3))).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_right_padded::mapping>({}, 4)).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>(Kokkos::layout_right_padded::mapping>({}, 4)).padded_stride.value(0)), 0); + + ASSERT_EQ(Kokkos::layout_left_padded::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_right_padded::mapping>({}, 4)).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>(Kokkos::layout_right_padded::mapping>({}, 4)).padded_stride.value(0)), 0); // Construct layout_left mapping from layout_left_padded mapping - ASSERT_EQ(Kokkos::layout_left::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((Kokkos::layout_left::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((Kokkos::layout_left::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((Kokkos::layout_left::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ(Kokkos::layout_left::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_left::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_left::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); } namespace @@ -355,85 +353,85 @@ namespace TEST(LayoutLeftTests, extents) { - test_extent>(Kokkos::extents{}); - test_extent>(Kokkos::extents{}); - test_extent>(Kokkos::extents{}); - test_extent>(Kokkos::extents{7}); - test_extent>(Kokkos::extents{}); - test_extent>(Kokkos::extents{}); - test_extent>(Kokkos::extents{7}); - - test_extent>(Kokkos::extents{}, 0); - test_extent>(Kokkos::extents{}, 4); - test_extent>(Kokkos::extents{7}, 4); - test_extent>(Kokkos::extents{}, 1); - test_extent>(Kokkos::extents{}, 3); - test_extent>(Kokkos::extents{7}, 5); + test_extent>(Kokkos::extents{}); + test_extent>(Kokkos::extents{}); + test_extent>(Kokkos::extents{}); + test_extent>(Kokkos::extents{7}); + test_extent>(Kokkos::extents{}); + test_extent>(Kokkos::extents{}); + test_extent>(Kokkos::extents{7}); + + test_extent>(Kokkos::extents{}, 0); + test_extent>(Kokkos::extents{}, 4); + test_extent>(Kokkos::extents{7}, 4); + test_extent>(Kokkos::extents{}, 1); + test_extent>(Kokkos::extents{}, 3); + test_extent>(Kokkos::extents{7}, 5); } // is_always_exhaustive -static_assert(KokkosEx::layout_left_padded<4>::mapping>{}.is_always_exhaustive()); -static_assert(KokkosEx::layout_left_padded<4>::mapping>{}.is_always_exhaustive()); -static_assert(KokkosEx::layout_left_padded<4>::mapping>{Kokkos::extents{5}}.is_always_exhaustive()); -static_assert(KokkosEx::layout_left_padded::mapping>{}.is_always_exhaustive()); - -static_assert(!KokkosEx::layout_left_padded<4>::mapping>{}.is_always_exhaustive()); -static_assert(KokkosEx::layout_left_padded<4>::mapping>{}.is_always_exhaustive()); -static_assert(KokkosEx::layout_left_padded<4>::mapping>{}.is_always_exhaustive()); -static_assert(!KokkosEx::layout_left_padded<4>::mapping>{Kokkos::extents{5}}.is_always_exhaustive()); -static_assert(!KokkosEx::layout_left_padded::mapping>{}.is_always_exhaustive()); -static_assert(KokkosEx::layout_left_padded<0>::mapping>{}.is_always_exhaustive()); -static_assert(KokkosEx::layout_left_padded<4>::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_left_padded<4>::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_left_padded<4>::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_left_padded<4>::mapping>{Kokkos::extents{5}}.is_always_exhaustive()); +static_assert(Kokkos::layout_left_padded::mapping>{}.is_always_exhaustive()); + +static_assert(!Kokkos::layout_left_padded<4>::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_left_padded<4>::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_left_padded<4>::mapping>{}.is_always_exhaustive()); +static_assert(!Kokkos::layout_left_padded<4>::mapping>{Kokkos::extents{5}}.is_always_exhaustive()); +static_assert(!Kokkos::layout_left_padded::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_left_padded<0>::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_left_padded<4>::mapping>{}.is_always_exhaustive()); TEST(LayoutLeftTests, properties) { // is_exhaustive // Sanity check -- if it is always exhaustive it should be exhaustive ^-^ - ASSERT_TRUE((KokkosEx::layout_left_padded<4>::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_left_padded<4>::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_left_padded<4>::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_left_padded::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_left_padded<4>::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_left_padded<4>::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_left_padded<0>::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_left_padded<4>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_left_padded<4>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_left_padded<4>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_left_padded<4>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_left_padded::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_left_padded<4>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_left_padded<4>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_left_padded<0>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_left_padded<4>::mapping>{}.is_exhaustive())); // is_exhaustive with dynamic values - ASSERT_TRUE((KokkosEx::layout_left_padded::mapping>{Kokkos::extents{}, 4}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_left_padded<4>::mapping>{Kokkos::extents{8}}.is_exhaustive())); - ASSERT_FALSE((KokkosEx::layout_left_padded::mapping>{Kokkos::extents{}, 4}.is_exhaustive())); - ASSERT_FALSE((KokkosEx::layout_left_padded<4>::mapping>{Kokkos::extents{7}}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_left_padded::mapping>{Kokkos::extents{}, 4}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_left_padded<4>::mapping>{Kokkos::extents{8}}.is_exhaustive())); + ASSERT_FALSE((Kokkos::layout_left_padded::mapping>{Kokkos::extents{}, 4}.is_exhaustive())); + ASSERT_FALSE((Kokkos::layout_left_padded<4>::mapping>{Kokkos::extents{7}}.is_exhaustive())); // Equality - ASSERT_EQ((KokkosEx::layout_left_padded<0>::mapping>{}), (KokkosEx::layout_left_padded<0>::mapping>{})); - ASSERT_EQ((KokkosEx::layout_left_padded<0>::mapping>{}), (KokkosEx::layout_left_padded<4>::mapping>{})); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>{}), (KokkosEx::layout_left_padded<4>::mapping>{})); - ASSERT_NE((KokkosEx::layout_left_padded<4>::mapping>{}), (KokkosEx::layout_left_padded<4>::mapping>{})); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>{Kokkos::extents{5}}), - (KokkosEx::layout_left_padded<4>::mapping>{Kokkos::extents{5}})); - ASSERT_NE((KokkosEx::layout_left_padded<4>::mapping>{Kokkos::extents{3}}), - (KokkosEx::layout_left_padded<4>::mapping>{Kokkos::extents{5}})); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>{}), (KokkosEx::layout_left_padded<4>::mapping>{})); - ASSERT_NE((KokkosEx::layout_left_padded<4>::mapping>{}), (KokkosEx::layout_left_padded<4>::mapping>{})); - ASSERT_NE((KokkosEx::layout_left_padded<4>::mapping>{}), (KokkosEx::layout_left_padded<8>::mapping>{})); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>{Kokkos::extents{5}}), - (KokkosEx::layout_left_padded<4>::mapping>{Kokkos::extents{5}})); - ASSERT_NE((KokkosEx::layout_left_padded<4>::mapping>{Kokkos::extents{3}}), - (KokkosEx::layout_left_padded<4>::mapping>{Kokkos::extents{5}})); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>{{}, 4}), (KokkosEx::layout_left_padded<4>::mapping>{})); - ASSERT_EQ((KokkosEx::layout_left_padded::mapping>{{}, 4}), (KokkosEx::layout_left_padded::mapping>{{}, 4})); - ASSERT_NE((KokkosEx::layout_left_padded::mapping>{{}, 4}), (KokkosEx::layout_left_padded<4>::mapping>{})); - ASSERT_NE((KokkosEx::layout_left_padded::mapping>{{}, 4}), (KokkosEx::layout_left_padded::mapping>{{}, 8})); + ASSERT_EQ((Kokkos::layout_left_padded<0>::mapping>{}), (Kokkos::layout_left_padded<0>::mapping>{})); + ASSERT_EQ((Kokkos::layout_left_padded<0>::mapping>{}), (Kokkos::layout_left_padded<4>::mapping>{})); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>{}), (Kokkos::layout_left_padded<4>::mapping>{})); + ASSERT_NE((Kokkos::layout_left_padded<4>::mapping>{}), (Kokkos::layout_left_padded<4>::mapping>{})); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>{Kokkos::extents{5}}), + (Kokkos::layout_left_padded<4>::mapping>{Kokkos::extents{5}})); + ASSERT_NE((Kokkos::layout_left_padded<4>::mapping>{Kokkos::extents{3}}), + (Kokkos::layout_left_padded<4>::mapping>{Kokkos::extents{5}})); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>{}), (Kokkos::layout_left_padded<4>::mapping>{})); + ASSERT_NE((Kokkos::layout_left_padded<4>::mapping>{}), (Kokkos::layout_left_padded<4>::mapping>{})); + ASSERT_NE((Kokkos::layout_left_padded<4>::mapping>{}), (Kokkos::layout_left_padded<8>::mapping>{})); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>{Kokkos::extents{5}}), + (Kokkos::layout_left_padded<4>::mapping>{Kokkos::extents{5}})); + ASSERT_NE((Kokkos::layout_left_padded<4>::mapping>{Kokkos::extents{3}}), + (Kokkos::layout_left_padded<4>::mapping>{Kokkos::extents{5}})); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>{{}, 4}), (Kokkos::layout_left_padded<4>::mapping>{})); + ASSERT_EQ((Kokkos::layout_left_padded::mapping>{{}, 4}), (Kokkos::layout_left_padded::mapping>{{}, 4})); + ASSERT_NE((Kokkos::layout_left_padded::mapping>{{}, 4}), (Kokkos::layout_left_padded<4>::mapping>{})); + ASSERT_NE((Kokkos::layout_left_padded::mapping>{{}, 4}), (Kokkos::layout_left_padded::mapping>{{}, 8})); } TEST(LayoutLeftTests, stride) { - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>().stride(0)), 1); - ASSERT_EQ((KokkosEx::layout_left_padded<4>::mapping>().stride(1)), 8); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>().stride(0)), 1); + ASSERT_EQ((Kokkos::layout_left_padded<4>::mapping>().stride(1)), 8); } TEST(LayoutRightTests, access) { - auto mapping1 = KokkosEx::layout_left_padded<4>::mapping< + auto mapping1 = Kokkos::layout_left_padded<4>::mapping< Kokkos::extents>(); ASSERT_EQ(mapping1(0, 0), 0); ASSERT_EQ(mapping1(1, 0), 1); @@ -443,7 +441,7 @@ TEST(LayoutRightTests, access) { ASSERT_EQ(mapping1(0, 6), 48); ASSERT_EQ(mapping1(4, 6), 52); - auto mapping2 = KokkosEx::layout_left_padded::mapping< + auto mapping2 = Kokkos::layout_left_padded::mapping< Kokkos::extents>({}, 6); ASSERT_EQ(mapping2(0, 0), 0); ASSERT_EQ(mapping2(1, 0), 1); @@ -453,7 +451,7 @@ TEST(LayoutRightTests, access) { ASSERT_EQ(mapping2(0, 6), 36); ASSERT_EQ(mapping2(4, 6), 40); - auto mapping3 = KokkosEx::layout_left_padded<2>::mapping< + auto mapping3 = Kokkos::layout_left_padded<2>::mapping< Kokkos::extents>( Kokkos::extents{3}); ASSERT_EQ(mapping3(0, 0), 0); @@ -464,7 +462,7 @@ TEST(LayoutRightTests, access) { ASSERT_EQ(mapping3(0, 6), 24); ASSERT_EQ(mapping3(2, 6), 26); - auto mapping4 = KokkosEx::layout_left_padded::mapping< + auto mapping4 = Kokkos::layout_left_padded::mapping< Kokkos::extents>( Kokkos::extents{7}, 10); ASSERT_EQ(mapping4(0, 0), 0); @@ -476,7 +474,7 @@ TEST(LayoutRightTests, access) { ASSERT_EQ(mapping4(6, 6), 66); auto mapping5 = - KokkosEx::layout_left_padded::mapping< + Kokkos::layout_left_padded::mapping< Kokkos::extents>({}, 4); ASSERT_EQ(mapping5(0), 0); ASSERT_EQ(mapping5(1), 1); @@ -487,25 +485,25 @@ TEST(LayoutRightTests, access) { ASSERT_EQ(mapping5(6), 6); auto mapping6 = - KokkosEx::layout_left_padded::mapping< + Kokkos::layout_left_padded::mapping< Kokkos::extents>({}, 4); ASSERT_EQ(mapping6(), 0); } // https://github.com/kokkos/mdspan/issues/362 TEST(LayoutLeftTests, issue362) { - auto mapping = KokkosEx::layout_left_padded< 5 >::mapping< Kokkos::extents< std::size_t, 2, 2 > >(); + auto mapping = Kokkos::layout_left_padded< 5 >::mapping< Kokkos::extents< std::size_t, 2, 2 > >(); ASSERT_EQ(mapping.required_span_size(), mapping(1, 1) + 1); } TEST(LayoutLeftTests, empty_span) { { - auto mapping = KokkosEx::layout_left_padded<16>::mapping< + auto mapping = Kokkos::layout_left_padded<16>::mapping< Kokkos::extents>(); ASSERT_EQ(mapping.required_span_size(), 0); } { - auto mapping = KokkosEx::layout_left_padded<16>::mapping< + auto mapping = Kokkos::layout_left_padded<16>::mapping< Kokkos::extents>(); ASSERT_EQ(mapping.required_span_size(), 0); } @@ -518,21 +516,21 @@ TEST(LayoutLeftTests, issue393) { #if LAYOUT_LEFT_COMPILE_ISSUE393_DEATH { // static extents size not representable - [[maybe_unused]] auto mapping = KokkosEx::layout_left_padded< 2 >::mapping< Kokkos::extents< std::int8_t, 50, 50 > >(); + [[maybe_unused]] auto mapping = Kokkos::layout_left_padded< 2 >::mapping< Kokkos::extents< std::int8_t, 50, 50 > >(); } { // Padding value not representable - [[maybe_unused]] auto mapping = KokkosEx::layout_left_padded< 500 >::mapping< Kokkos::extents< std::int8_t, 2, 2 > >(); + [[maybe_unused]] auto mapping = Kokkos::layout_left_padded< 500 >::mapping< Kokkos::extents< std::int8_t, 2, 2 > >(); } { // Padding value product with remaining extents is representable - [[maybe_unused]] auto mapping = KokkosEx::layout_left_padded< 50 >::mapping< Kokkos::extents< std::int8_t, 2, 50 > >(); + [[maybe_unused]] auto mapping = Kokkos::layout_left_padded< 50 >::mapping< Kokkos::extents< std::int8_t, 2, 50 > >(); } #endif // Valid usage, should compile without narrowing warnings { - [[maybe_unused]] auto mapping = KokkosEx::layout_left_padded<5>::mapping< + [[maybe_unused]] auto mapping = Kokkos::layout_left_padded<5>::mapping< Kokkos::extents>(); } @@ -541,7 +539,7 @@ TEST(LayoutLeftTests, issue393) { // in lambdas separately auto test_extents_not_representable = []{ // extents not representable - [[maybe_unused]] auto mapping = KokkosEx::layout_left_padded<2>::mapping< + [[maybe_unused]] auto mapping = Kokkos::layout_left_padded<2>::mapping< Kokkos::dextents>{ Kokkos::dextents{50, 50}}; }; @@ -550,7 +548,7 @@ TEST(LayoutLeftTests, issue393) { auto test_padding_value_not_representable = []{ // Padding value not representable [[maybe_unused]] auto mapping = - KokkosEx::layout_left_padded::mapping< + Kokkos::layout_left_padded::mapping< Kokkos::extents>{{}, 500}; }; EXPECT_DEATH(test_padding_value_not_representable(), "" ); @@ -558,14 +556,14 @@ TEST(LayoutLeftTests, issue393) { auto test_padding_value_product_not_representable = []{ // Padding value product with remaining extents is representable [[maybe_unused]] auto mapping = - KokkosEx::layout_left_padded::mapping< + Kokkos::layout_left_padded::mapping< Kokkos::extents>{{}, 50}; }; EXPECT_DEATH(test_padding_value_product_not_representable(), "" ); auto test_padding_value_product_not_representable2 = []{ // Padding value product with remaining extents is representable - [[maybe_unused]] auto mapping = KokkosEx::layout_left_padded< + [[maybe_unused]] auto mapping = Kokkos::layout_left_padded< Kokkos::dynamic_extent>::mapping>{ Kokkos::dextents{2, 50}, 50}; }; @@ -573,7 +571,7 @@ TEST(LayoutLeftTests, issue393) { auto test_padding_value_product_not_representable3 = []{ // Padding value product with remaining extents is representable - [[maybe_unused]] auto mapping = KokkosEx::layout_left_padded<50>::mapping< + [[maybe_unused]] auto mapping = Kokkos::layout_left_padded<50>::mapping< Kokkos::dextents>{ Kokkos::dextents{2, 50}}; }; diff --git a/tests/test_layout_padded_right.cpp b/tests/test_layout_padded_right.cpp index 37f217f8..9d5f1e01 100644 --- a/tests/test_layout_padded_right.cpp +++ b/tests/test_layout_padded_right.cpp @@ -4,48 +4,46 @@ #include #include -namespace KokkosEx = MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE; - // Compile time tests // For internal traits struct fake_mapping { - using layout_type = Kokkos::Experimental::layout_right_padded<5>; + using layout_type = Kokkos::layout_right_padded<5>; }; -static_assert(!Kokkos::Experimental::detail::is_layout_right_padded_mapping< +static_assert(!Kokkos::detail::is_layout_right_padded_mapping< fake_mapping>::value); -static_assert(Kokkos::Experimental::detail::is_layout_right_padded_mapping< - Kokkos::Experimental::layout_right_padded<4>::mapping< +static_assert(Kokkos::detail::is_layout_right_padded_mapping< + Kokkos::layout_right_padded<4>::mapping< Kokkos::extents>>::value); // layout_right_padded must be trivial -static_assert(std::is_trivial_v>); -static_assert(std::is_trivial_v>); -static_assert(std::is_trivial_v>); +static_assert(std::is_trivial_v>); +static_assert(std::is_trivial_v>); +static_assert(std::is_trivial_v>); // actual padding stride // If extents_type::rank() equals zero or one, then padding_stride. -static_assert(KokkosEx::layout_right_padded<0>::mapping>::static_padding_stride == 0); -static_assert(KokkosEx::layout_right_padded<2>::mapping>::static_padding_stride == 0); -static_assert(KokkosEx::layout_right_padded<2>::mapping>::static_padding_stride == 0); -static_assert(KokkosEx::layout_right_padded<2>::mapping>::static_padding_stride == 0); -static_assert(KokkosEx::layout_right_padded::mapping>::static_padding_stride == 0); -static_assert(KokkosEx::layout_right_padded::mapping>::static_padding_stride == 0); -static_assert(KokkosEx::layout_right_padded::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_right_padded<0>::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_right_padded<2>::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_right_padded<2>::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_right_padded<2>::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_right_padded::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_right_padded::mapping>::static_padding_stride == 0); +static_assert(Kokkos::layout_right_padded::mapping>::static_padding_stride == 0); // Else, if // - padding_stride does not equal dynamic_extent and // - extents_type::static_extent(0) does not equal dynamic_extent, // then the size_t value which is the least multiple of padding_stride that is greater than or equal to extents_type::static_extent(0). -static_assert(KokkosEx::layout_right_padded<2>::mapping>::static_padding_stride == 4); -static_assert(KokkosEx::layout_right_padded<2>::mapping>::static_padding_stride == 4); +static_assert(Kokkos::layout_right_padded<2>::mapping>::static_padding_stride == 4); +static_assert(Kokkos::layout_right_padded<2>::mapping>::static_padding_stride == 4); // Otherwise, dynamic_extent. -static_assert(KokkosEx::layout_right_padded<2>::mapping>::static_padding_stride == Kokkos::dynamic_extent); -static_assert(KokkosEx::layout_right_padded::mapping>::static_padding_stride == Kokkos::dynamic_extent); -static_assert(KokkosEx::layout_right_padded::mapping>::static_padding_stride == Kokkos::dynamic_extent); +static_assert(Kokkos::layout_right_padded<2>::mapping>::static_padding_stride == Kokkos::dynamic_extent); +static_assert(Kokkos::layout_right_padded::mapping>::static_padding_stride == Kokkos::dynamic_extent); +static_assert(Kokkos::layout_right_padded::mapping>::static_padding_stride == Kokkos::dynamic_extent); namespace { @@ -171,169 +169,169 @@ void test_copy_assignment(const Extents &extents, Size padding_value) TEST(LayoutrightTests, construction) { // Default Constructor - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); - test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); + test_default_constructor_equivalence, Kokkos::extents>(); // Copy constructor - test_copy_constructor>(Kokkos::extents()); - test_copy_constructor>(Kokkos::extents()); - test_copy_constructor>(Kokkos::extents()); - test_copy_constructor>(Kokkos::extents()); - test_copy_constructor>(Kokkos::extents(10)); - test_copy_constructor>(Kokkos::extents(9, 10)); - test_copy_constructor>(Kokkos::extents(8, 9, 10)); - - test_copy_constructor>(Kokkos::extents(), 5); - test_copy_constructor>(Kokkos::extents(), 5); - test_copy_constructor>(Kokkos::extents(), 5); - test_copy_constructor>(Kokkos::extents(), 5); + test_copy_constructor>(Kokkos::extents()); + test_copy_constructor>(Kokkos::extents()); + test_copy_constructor>(Kokkos::extents()); + test_copy_constructor>(Kokkos::extents()); + test_copy_constructor>(Kokkos::extents(10)); + test_copy_constructor>(Kokkos::extents(9, 10)); + test_copy_constructor>(Kokkos::extents(8, 9, 10)); + + test_copy_constructor>(Kokkos::extents(), 5); + test_copy_constructor>(Kokkos::extents(), 5); + test_copy_constructor>(Kokkos::extents(), 5); + test_copy_constructor>(Kokkos::extents(), 5); // Copy assignment - test_copy_assignment>(Kokkos::extents()); - test_copy_assignment>(Kokkos::extents()); - test_copy_assignment>(Kokkos::extents()); - test_copy_assignment>(Kokkos::extents()); - test_copy_assignment>(Kokkos::extents(10)); - test_copy_assignment>(Kokkos::extents(9, 10)); - test_copy_assignment>(Kokkos::extents(8, 9, 10)); - - test_copy_assignment>(Kokkos::extents(), 5); - test_copy_assignment>(Kokkos::extents(), 5); - test_copy_assignment>(Kokkos::extents(), 5); - test_copy_assignment>(Kokkos::extents(), 5); + test_copy_assignment>(Kokkos::extents()); + test_copy_assignment>(Kokkos::extents()); + test_copy_assignment>(Kokkos::extents()); + test_copy_assignment>(Kokkos::extents()); + test_copy_assignment>(Kokkos::extents(10)); + test_copy_assignment>(Kokkos::extents(9, 10)); + test_copy_assignment>(Kokkos::extents(8, 9, 10)); + + test_copy_assignment>(Kokkos::extents(), 5); + test_copy_assignment>(Kokkos::extents(), 5); + test_copy_assignment>(Kokkos::extents(), 5); + test_copy_assignment>(Kokkos::extents(), 5); // Constructor only taking an extent // Direct-non-list-initializes inner-mapping with: // - ext, if extents_type::rank() is zero or one; else, - test_0_or_1_rank_padding_stride>(Kokkos::extents{}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{7}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}); - test_0_or_1_rank_padding_stride>(Kokkos::extents{7}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{7}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}); + test_0_or_1_rank_padding_stride>(Kokkos::extents{7}); // - ext.extent(0), ext.extent(P_right)..., if padding_stride is dynamic_extent - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{ 0 }); - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{ 5 }); - test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{7}); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{ 0 }); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{ 5 }); + test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{7}); // - S_right, ext.extent(P_right)..., where S_right is the least multiple of padding_stride greater than or equal to ext.extent(0) - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}); - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}); - test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{8}); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}); + test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{8}); // Constructor taking an extent and a dynamic value // Direct-non-list-initializes inner-mapping with: // - ext, if extents_type::rank() is zero or one; else, - test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 4); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 0); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 4); - test_0_or_1_rank_padding_stride>(Kokkos::extents{7}, 4); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 3); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 3255); - test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 1337); - test_0_or_1_rank_padding_stride>(Kokkos::extents{7}, 6323); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 4); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 0); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 4); + test_0_or_1_rank_padding_stride>(Kokkos::extents{7}, 4); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 3); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 3255); + test_0_or_1_rank_padding_stride>(Kokkos::extents{}, 1337); + test_0_or_1_rank_padding_stride>(Kokkos::extents{7}, 6323); // - S_right, ext.extent(P_right)..., where S_right is the least multiple of padding_value greater than or equal to ext.extent(0) - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}, 0); - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}, 4); - test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{8}, 4); - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{0}, 2); - test_padding_stride>(Kokkos::extents{}, Kokkos::extents{8}, 4); - test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{8}, 4); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}, 0); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{}, 4); + test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{8}, 4); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{0}, 2); + test_padding_stride>(Kokkos::extents{}, Kokkos::extents{8}, 4); + test_padding_stride>(Kokkos::extents{7}, Kokkos::extents{8}, 4); // Construct layout_right_padded mapping from layout_right mapping - ASSERT_EQ(KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).padded_stride.value(0)), 4); - - ASSERT_EQ(KokkosEx::layout_right_padded::mapping>(Kokkos::layout_right::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_right::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_right::mapping>()).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_right::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_right::mapping>()).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_right::mapping>(Kokkos::extents{4})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_right::mapping>(Kokkos::extents{4})).padded_stride.value(0)), 4); + ASSERT_EQ(Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right::mapping>()).padded_stride.value(0)), 4); + + ASSERT_EQ(Kokkos::layout_right_padded::mapping>(Kokkos::layout_right::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right::mapping>()).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right::mapping>()).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right::mapping>(Kokkos::extents{4})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right::mapping>(Kokkos::extents{4})).padded_stride.value(0)), 4); // Construct layout_right_padded mapping from layout stride - ASSERT_EQ(KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).padded_stride.value(0)), 8); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).padded_stride.value(0)), 8); - - ASSERT_EQ(KokkosEx::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).padded_stride.value(0)), 8); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).padded_stride.value(0)), 8); + ASSERT_EQ(Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).padded_stride.value(0)), 8); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).padded_stride.value(0)), 8); + + ASSERT_EQ(Kokkos::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{1})).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{4, 1})).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).padded_stride.value(0)), 8); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_stride::mapping>({}, std::array{8, 1})).padded_stride.value(0)), 8); // Construct layout_right_padded from another layout_right_padded - ASSERT_EQ(KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 4); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 4); - - ASSERT_EQ(KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 8); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_right_padded<4>::mapping>(Kokkos::extents(7))).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_right_padded<4>::mapping>(Kokkos::extents(7))).padded_stride.value(0)), 8); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 8); + ASSERT_EQ(Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 4); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 4); + + ASSERT_EQ(Kokkos::layout_right_padded::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 8); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right_padded<4>::mapping>(Kokkos::extents(7))).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right_padded<4>::mapping>(Kokkos::extents(7))).padded_stride.value(0)), 8); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_right_padded<4>::mapping>()).padded_stride.value(0)), 8); // Construct layout_right_padded mapping from layout_left_padded mapping - ASSERT_EQ(KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>(Kokkos::dextents(3))).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_left_padded<4>::mapping>(Kokkos::dextents(3))).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_left_padded::mapping>({}, 4)).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>(KokkosEx::layout_left_padded::mapping>({}, 4)).padded_stride.value(0)), 0); - - ASSERT_EQ(KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 0); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_left_padded::mapping>({}, 4)).extents()), (Kokkos::extents())); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>(KokkosEx::layout_left_padded::mapping>({}, 4)).padded_stride.value(0)), 0); + ASSERT_EQ(Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>(Kokkos::dextents(3))).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_left_padded<4>::mapping>(Kokkos::dextents(3))).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_left_padded::mapping>({}, 4)).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>(Kokkos::layout_left_padded::mapping>({}, 4)).padded_stride.value(0)), 0); + + ASSERT_EQ(Kokkos::layout_right_padded::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_left_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_left_padded<4>::mapping>()).padded_stride.value(0)), 0); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_left_padded::mapping>({}, 4)).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>(Kokkos::layout_left_padded::mapping>({}, 4)).padded_stride.value(0)), 0); // Construct layout_right mapping from layout_right_padded mapping - ASSERT_EQ(Kokkos::layout_right::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents(), Kokkos::extents()); - ASSERT_EQ((Kokkos::layout_right::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((Kokkos::layout_right::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); - ASSERT_EQ((Kokkos::layout_right::mapping>(KokkosEx::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ(Kokkos::layout_right::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents(), Kokkos::extents()); + ASSERT_EQ((Kokkos::layout_right::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); + ASSERT_EQ((Kokkos::layout_right::mapping>(Kokkos::layout_right_padded<4>::mapping>()).extents()), (Kokkos::extents())); } namespace @@ -355,87 +353,87 @@ namespace TEST(LayoutrightTests, extents) { - test_extent>(Kokkos::extents{}); - test_extent>(Kokkos::extents{}); - test_extent>(Kokkos::extents{}); - test_extent>(Kokkos::extents{7}); - test_extent>(Kokkos::extents{}); - test_extent>(Kokkos::extents{}); - test_extent>(Kokkos::extents{7}); - - test_extent>(Kokkos::extents{}, 0); - test_extent>(Kokkos::extents{}, 4); - test_extent>(Kokkos::extents{7}, 4); - test_extent>(Kokkos::extents{}, 1); - test_extent>(Kokkos::extents{}, 3); - test_extent>(Kokkos::extents{7}, 5); + test_extent>(Kokkos::extents{}); + test_extent>(Kokkos::extents{}); + test_extent>(Kokkos::extents{}); + test_extent>(Kokkos::extents{7}); + test_extent>(Kokkos::extents{}); + test_extent>(Kokkos::extents{}); + test_extent>(Kokkos::extents{7}); + + test_extent>(Kokkos::extents{}, 0); + test_extent>(Kokkos::extents{}, 4); + test_extent>(Kokkos::extents{7}, 4); + test_extent>(Kokkos::extents{}, 1); + test_extent>(Kokkos::extents{}, 3); + test_extent>(Kokkos::extents{7}, 5); } // is_always_exhaustive -static_assert(KokkosEx::layout_right_padded<4>::mapping>{}.is_always_exhaustive()); -static_assert(KokkosEx::layout_right_padded<4>::mapping>{}.is_always_exhaustive()); -static_assert(KokkosEx::layout_right_padded<4>::mapping>{Kokkos::extents{5}}.is_always_exhaustive()); -static_assert(KokkosEx::layout_right_padded::mapping>{}.is_always_exhaustive()); - -static_assert(!KokkosEx::layout_right_padded<4>::mapping>{}.is_always_exhaustive()); -static_assert(KokkosEx::layout_right_padded<4>::mapping>{}.is_always_exhaustive()); -static_assert(KokkosEx::layout_right_padded<4>::mapping>{}.is_always_exhaustive()); -static_assert(!KokkosEx::layout_right_padded<4>::mapping>{Kokkos::extents{5}}.is_always_exhaustive()); -static_assert(!KokkosEx::layout_right_padded::mapping>{}.is_always_exhaustive()); -static_assert(KokkosEx::layout_right_padded<0>::mapping>{}.is_always_exhaustive()); -static_assert(KokkosEx::layout_right_padded<4>::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_right_padded<4>::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_right_padded<4>::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_right_padded<4>::mapping>{Kokkos::extents{5}}.is_always_exhaustive()); +static_assert(Kokkos::layout_right_padded::mapping>{}.is_always_exhaustive()); + +static_assert(!Kokkos::layout_right_padded<4>::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_right_padded<4>::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_right_padded<4>::mapping>{}.is_always_exhaustive()); +static_assert(!Kokkos::layout_right_padded<4>::mapping>{Kokkos::extents{5}}.is_always_exhaustive()); +static_assert(!Kokkos::layout_right_padded::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_right_padded<0>::mapping>{}.is_always_exhaustive()); +static_assert(Kokkos::layout_right_padded<4>::mapping>{}.is_always_exhaustive()); TEST(LayoutrightTests, properties) { // is_exhaustive // Sanity check -- if it is always exhaustive it should be exhaustive ^-^ - ASSERT_TRUE((KokkosEx::layout_right_padded<4>::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_right_padded<4>::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_right_padded<4>::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_right_padded::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_right_padded<4>::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_right_padded<4>::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_right_padded<0>::mapping>{}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_right_padded<4>::mapping>{}.is_exhaustive())); - ASSERT_FALSE((KokkosEx::layout_right_padded<4>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_right_padded<4>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_right_padded<4>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_right_padded<4>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_right_padded::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_right_padded<4>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_right_padded<4>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_right_padded<0>::mapping>{}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_right_padded<4>::mapping>{}.is_exhaustive())); + ASSERT_FALSE((Kokkos::layout_right_padded<4>::mapping>{}.is_exhaustive())); // is_exhaustive with dynamic values - ASSERT_TRUE((KokkosEx::layout_right_padded::mapping>{Kokkos::extents{}, 4}.is_exhaustive())); - ASSERT_TRUE((KokkosEx::layout_right_padded<4>::mapping>{Kokkos::extents{8}}.is_exhaustive())); - ASSERT_FALSE((KokkosEx::layout_right_padded::mapping>{Kokkos::extents{}, 4}.is_exhaustive())); - ASSERT_FALSE((KokkosEx::layout_right_padded<4>::mapping>{Kokkos::extents{7}}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_right_padded::mapping>{Kokkos::extents{}, 4}.is_exhaustive())); + ASSERT_TRUE((Kokkos::layout_right_padded<4>::mapping>{Kokkos::extents{8}}.is_exhaustive())); + ASSERT_FALSE((Kokkos::layout_right_padded::mapping>{Kokkos::extents{}, 4}.is_exhaustive())); + ASSERT_FALSE((Kokkos::layout_right_padded<4>::mapping>{Kokkos::extents{7}}.is_exhaustive())); // Equality - ASSERT_EQ((KokkosEx::layout_right_padded<0>::mapping>{}), (KokkosEx::layout_right_padded<0>::mapping>{})); - ASSERT_EQ((KokkosEx::layout_right_padded<0>::mapping>{}), (KokkosEx::layout_right_padded<4>::mapping>{})); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>{}), (KokkosEx::layout_right_padded<4>::mapping>{})); - ASSERT_NE((KokkosEx::layout_right_padded<4>::mapping>{}), (KokkosEx::layout_right_padded<4>::mapping>{})); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>{Kokkos::extents{5}}), - (KokkosEx::layout_right_padded<4>::mapping>{Kokkos::extents{5}})); - ASSERT_NE((KokkosEx::layout_right_padded<4>::mapping>{Kokkos::extents{3}}), - (KokkosEx::layout_right_padded<4>::mapping>{Kokkos::extents{5}})); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>{}), (KokkosEx::layout_right_padded<4>::mapping>{})); - ASSERT_NE((KokkosEx::layout_right_padded<4>::mapping>{}), (KokkosEx::layout_right_padded<4>::mapping>{})); - ASSERT_NE((KokkosEx::layout_right_padded<4>::mapping>{}), (KokkosEx::layout_right_padded<8>::mapping>{})); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>{Kokkos::extents{5}}), - (KokkosEx::layout_right_padded<4>::mapping>{Kokkos::extents{5}})); - ASSERT_NE((KokkosEx::layout_right_padded<4>::mapping>{Kokkos::extents{3}}), - (KokkosEx::layout_right_padded<4>::mapping>{Kokkos::extents{5}})); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>{{}, 4}), (KokkosEx::layout_right_padded<4>::mapping>{})); - ASSERT_EQ((KokkosEx::layout_right_padded::mapping>{{}, 4}), (KokkosEx::layout_right_padded::mapping>{{}, 4})); - ASSERT_NE((KokkosEx::layout_right_padded::mapping>{{}, 4}), (KokkosEx::layout_right_padded<4>::mapping>{})); - ASSERT_NE((KokkosEx::layout_right_padded::mapping>{{}, 4}), (KokkosEx::layout_right_padded::mapping>{{}, 8})); + ASSERT_EQ((Kokkos::layout_right_padded<0>::mapping>{}), (Kokkos::layout_right_padded<0>::mapping>{})); + ASSERT_EQ((Kokkos::layout_right_padded<0>::mapping>{}), (Kokkos::layout_right_padded<4>::mapping>{})); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>{}), (Kokkos::layout_right_padded<4>::mapping>{})); + ASSERT_NE((Kokkos::layout_right_padded<4>::mapping>{}), (Kokkos::layout_right_padded<4>::mapping>{})); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>{Kokkos::extents{5}}), + (Kokkos::layout_right_padded<4>::mapping>{Kokkos::extents{5}})); + ASSERT_NE((Kokkos::layout_right_padded<4>::mapping>{Kokkos::extents{3}}), + (Kokkos::layout_right_padded<4>::mapping>{Kokkos::extents{5}})); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>{}), (Kokkos::layout_right_padded<4>::mapping>{})); + ASSERT_NE((Kokkos::layout_right_padded<4>::mapping>{}), (Kokkos::layout_right_padded<4>::mapping>{})); + ASSERT_NE((Kokkos::layout_right_padded<4>::mapping>{}), (Kokkos::layout_right_padded<8>::mapping>{})); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>{Kokkos::extents{5}}), + (Kokkos::layout_right_padded<4>::mapping>{Kokkos::extents{5}})); + ASSERT_NE((Kokkos::layout_right_padded<4>::mapping>{Kokkos::extents{3}}), + (Kokkos::layout_right_padded<4>::mapping>{Kokkos::extents{5}})); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>{{}, 4}), (Kokkos::layout_right_padded<4>::mapping>{})); + ASSERT_EQ((Kokkos::layout_right_padded::mapping>{{}, 4}), (Kokkos::layout_right_padded::mapping>{{}, 4})); + ASSERT_NE((Kokkos::layout_right_padded::mapping>{{}, 4}), (Kokkos::layout_right_padded<4>::mapping>{})); + ASSERT_NE((Kokkos::layout_right_padded::mapping>{{}, 4}), (Kokkos::layout_right_padded::mapping>{{}, 8})); } TEST(LayoutRightTests, stride) { - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>().stride(0)), 8); - ASSERT_EQ((KokkosEx::layout_right_padded<4>::mapping>().stride(1)), 1); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>().stride(0)), 8); + ASSERT_EQ((Kokkos::layout_right_padded<4>::mapping>().stride(1)), 1); } TEST(LayoutRightTests, access) { - auto mapping1 = KokkosEx::layout_right_padded<4>::mapping>(); + auto mapping1 = Kokkos::layout_right_padded<4>::mapping>(); ASSERT_EQ(mapping1(0, 0), 0); ASSERT_EQ(mapping1(0, 1), 1); ASSERT_EQ(mapping1(0, 4), 4); @@ -444,7 +442,7 @@ TEST(LayoutRightTests, access) ASSERT_EQ(mapping1(6, 0), 48); ASSERT_EQ(mapping1(6, 4), 52); - auto mapping2 = KokkosEx::layout_right_padded::mapping< + auto mapping2 = Kokkos::layout_right_padded::mapping< Kokkos::extents>({}, 6); ASSERT_EQ(mapping2(0, 0), 0); ASSERT_EQ(mapping2(0, 1), 1); @@ -454,7 +452,7 @@ TEST(LayoutRightTests, access) ASSERT_EQ(mapping2(6, 0), 36); ASSERT_EQ(mapping2(6, 4), 40); - auto mapping3 = KokkosEx::layout_right_padded<2>::mapping< + auto mapping3 = Kokkos::layout_right_padded<2>::mapping< Kokkos::extents>( Kokkos::extents{3}); ASSERT_EQ(mapping3(0, 0), 0); @@ -466,7 +464,7 @@ TEST(LayoutRightTests, access) ASSERT_EQ(mapping3(6, 2), 26); auto mapping4 = - KokkosEx::layout_right_padded::mapping< + Kokkos::layout_right_padded::mapping< Kokkos::extents>( Kokkos::extents{7}, 10); ASSERT_EQ(mapping4(0, 0), 0); @@ -478,7 +476,7 @@ TEST(LayoutRightTests, access) ASSERT_EQ(mapping4(6, 6), 66); auto mapping5 = - KokkosEx::layout_right_padded::mapping< + Kokkos::layout_right_padded::mapping< Kokkos::extents>({}, 4); ASSERT_EQ(mapping5(0), 0); ASSERT_EQ(mapping5(1), 1); @@ -489,25 +487,25 @@ TEST(LayoutRightTests, access) ASSERT_EQ(mapping5(6), 6); auto mapping6 = - KokkosEx::layout_right_padded::mapping< + Kokkos::layout_right_padded::mapping< Kokkos::extents>({}, 4); ASSERT_EQ(mapping6(), 0); } // https://github.com/kokkos/mdspan/issues/362 TEST(LayoutRightTests, issue362) { - auto mapping = KokkosEx::layout_right_padded< 5 >::mapping< Kokkos::extents< std::size_t, 2, 2 > >(); + auto mapping = Kokkos::layout_right_padded< 5 >::mapping< Kokkos::extents< std::size_t, 2, 2 > >(); ASSERT_EQ(mapping.required_span_size(), mapping(1, 1) + 1); } TEST(LayoutRightTests, empty_span) { { - auto mapping = KokkosEx::layout_right_padded<16>::mapping< + auto mapping = Kokkos::layout_right_padded<16>::mapping< Kokkos::extents>(); ASSERT_EQ(mapping.required_span_size(), 0); } { - auto mapping = KokkosEx::layout_right_padded<16>::mapping< + auto mapping = Kokkos::layout_right_padded<16>::mapping< Kokkos::extents>(); ASSERT_EQ(mapping.required_span_size(), 0); } @@ -520,21 +518,21 @@ TEST(LayoutRightTests, issue393) { #if LAYOUT_RIGHT_COMPILE_ISSUE393_DEATH { // static extents size not representable - [[maybe_unused]] auto mapping = KokkosEx::layout_right_padded< 2 >::mapping< Kokkos::extents< std::int8_t, 50, 50 > >(); + [[maybe_unused]] auto mapping = Kokkos::layout_right_padded< 2 >::mapping< Kokkos::extents< std::int8_t, 50, 50 > >(); } { // Padding value not representable - [[maybe_unused]] auto mapping = KokkosEx::layout_right_padded< 500 >::mapping< Kokkos::extents< std::int8_t, 2, 2 > >(); + [[maybe_unused]] auto mapping = Kokkos::layout_right_padded< 500 >::mapping< Kokkos::extents< std::int8_t, 2, 2 > >(); } { // Padding value product with remaining extents is representable - [[maybe_unused]] auto mapping = KokkosEx::layout_right_padded< 50 >::mapping< Kokkos::extents< std::int8_t, 50, 2 > >(); + [[maybe_unused]] auto mapping = Kokkos::layout_right_padded< 50 >::mapping< Kokkos::extents< std::int8_t, 50, 2 > >(); } #endif // Valid usage, should compile without narrowing warnings { - [[maybe_unused]] auto mapping = KokkosEx::layout_right_padded<5>::mapping< + [[maybe_unused]] auto mapping = Kokkos::layout_right_padded<5>::mapping< Kokkos::extents>(); } @@ -543,7 +541,7 @@ TEST(LayoutRightTests, issue393) { // in lambdas separately auto test_extents_not_representable = []{ // extents not representable - [[maybe_unused]] auto mapping = KokkosEx::layout_right_padded<2>::mapping< + [[maybe_unused]] auto mapping = Kokkos::layout_right_padded<2>::mapping< Kokkos::dextents>{ Kokkos::dextents{50, 50}}; }; @@ -552,7 +550,7 @@ TEST(LayoutRightTests, issue393) { auto test_padding_value_not_representable = []{ // Padding value not representable [[maybe_unused]] auto mapping = - KokkosEx::layout_right_padded::mapping< + Kokkos::layout_right_padded::mapping< Kokkos::extents>{{}, 500}; }; EXPECT_DEATH(test_padding_value_not_representable(), "" ); @@ -560,14 +558,14 @@ TEST(LayoutRightTests, issue393) { auto test_padding_value_product_not_representable = []{ // Padding value product with remaining extents is representable [[maybe_unused]] auto mapping = - KokkosEx::layout_right_padded::mapping< + Kokkos::layout_right_padded::mapping< Kokkos::extents>{{}, 50}; }; EXPECT_DEATH(test_padding_value_product_not_representable(), "" ); auto test_padding_value_product_not_representable2 = []{ // Padding value product with remaining extents is representable - [[maybe_unused]] auto mapping = KokkosEx::layout_right_padded< + [[maybe_unused]] auto mapping = Kokkos::layout_right_padded< Kokkos::dynamic_extent>::mapping>{ Kokkos::dextents{50, 2}, 50}; }; @@ -575,7 +573,7 @@ TEST(LayoutRightTests, issue393) { auto test_padding_value_product_not_representable3 = []{ // Padding value product with remaining extents is representable - [[maybe_unused]] auto mapping = KokkosEx::layout_right_padded<50>::mapping< + [[maybe_unused]] auto mapping = Kokkos::layout_right_padded<50>::mapping< Kokkos::dextents>{ Kokkos::dextents{50, 2}}; }; diff --git a/tests/test_submdspan.cpp b/tests/test_submdspan.cpp index 9c7d7a02..b14396de 100644 --- a/tests/test_submdspan.cpp +++ b/tests/test_submdspan.cpp @@ -104,9 +104,9 @@ template using args_t = std::index_sequence; template -using layout_left_padded = Kokkos::Experimental::layout_left_padded; +using layout_left_padded = Kokkos::layout_left_padded; template -using layout_right_padded = Kokkos::Experimental::layout_right_padded; +using layout_right_padded = Kokkos::layout_right_padded; using submdspan_test_types = ::testing::Types< @@ -466,6 +466,6 @@ TEST(TestSubmdspanIssue362, LayoutRightPadded) { // The bottom-right 2x2 matrix auto m2 = submdspan(m1, std::pair(2, 4), std::pair(3, 5)); - + EXPECT_EQ(m2.mapping().required_span_size(), m2.mapping()(1, 1) + 1); } diff --git a/tests/test_submdspan_static_slice.cpp b/tests/test_submdspan_static_slice.cpp index b10f153d..b0617a1b 100644 --- a/tests/test_submdspan_static_slice.cpp +++ b/tests/test_submdspan_static_slice.cpp @@ -175,7 +175,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Left_iddd_FullIndexFull) { { using expected_extents_type = Kokkos::dextents; - using expected_layout_type = Kokkos::Experimental::layout_left_padded; + using expected_layout_type = Kokkos::layout_left_padded; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&] (auto integralConstant) { @@ -202,7 +202,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Left_i345_FullIndexFull) { { using expected_extents_type = Kokkos::extents; - using expected_layout_type = Kokkos::Experimental::layout_left_padded<12>; + using expected_layout_type = Kokkos::layout_left_padded<12>; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&] (auto integralConstant) { @@ -382,7 +382,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Left_iddd_TupleFullTuple) { { using expected_extents_type = Kokkos::dextents; - using expected_layout_type = Kokkos::Experimental::layout_left_padded; + using expected_layout_type = Kokkos::layout_left_padded; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&] (auto sliceSpec0, auto sliceSpec1) { @@ -396,7 +396,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Left_iddd_TupleFullTuple) { } { using expected_extents_type = Kokkos::extents; - using expected_layout_type = Kokkos::Experimental::layout_left_padded; + using expected_layout_type = Kokkos::layout_left_padded; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&] (auto sliceSpec0, auto sliceSpec1) { @@ -424,7 +424,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Left_i345_TupleFullTuple) { { using expected_extents_type = Kokkos::extents; - using expected_layout_type = Kokkos::Experimental::layout_left_padded<3>; + using expected_layout_type = Kokkos::layout_left_padded<3>; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&] (auto sliceSpec0, auto sliceSpec1) { @@ -438,7 +438,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Left_i345_TupleFullTuple) { } { using expected_extents_type = Kokkos::extents; - using expected_layout_type = Kokkos::Experimental::layout_left_padded<3>; + using expected_layout_type = Kokkos::layout_left_padded<3>; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&] (auto sliceSpec0, auto sliceSpec1) { @@ -466,7 +466,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Right_iddd_TupleFullTuple) { { using expected_extents_type = Kokkos::dextents; - using expected_layout_type = Kokkos::Experimental::layout_right_padded; + using expected_layout_type = Kokkos::layout_right_padded; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&] (auto sliceSpec0, auto sliceSpec1) { @@ -480,7 +480,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Right_iddd_TupleFullTuple) { } { using expected_extents_type = Kokkos::extents; - using expected_layout_type = Kokkos::Experimental::layout_right_padded; + using expected_layout_type = Kokkos::layout_right_padded; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&] (auto sliceSpec0, auto sliceSpec1) { @@ -508,7 +508,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Right_i345_TupleFullTuple) { { using expected_extents_type = Kokkos::extents; - using expected_layout_type = Kokkos::Experimental::layout_right_padded<5>; + using expected_layout_type = Kokkos::layout_right_padded<5>; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&] (auto sliceSpec0, auto sliceSpec1) { @@ -522,7 +522,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Right_i345_TupleFullTuple) { } { using expected_extents_type = Kokkos::extents; - using expected_layout_type = Kokkos::Experimental::layout_right_padded<5>; + using expected_layout_type = Kokkos::layout_right_padded<5>; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&] (auto sliceSpec0, auto sliceSpec1) { @@ -598,7 +598,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Right_idd_FullTuple) { input_extents_type input_extents{3, 4}; { using expected_extents_type = Kokkos::dextents; - using expected_layout_type = Kokkos::Experimental::layout_right_padded; + using expected_layout_type = Kokkos::layout_right_padded; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&](auto sliceSpec) { @@ -611,7 +611,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Right_idd_FullTuple) { } { using expected_extents_type = Kokkos::extents; - using expected_layout_type = Kokkos::Experimental::layout_right_padded; + using expected_layout_type = Kokkos::layout_right_padded; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&](auto sliceSpec) { @@ -633,7 +633,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Left_idd_TupleFull) { input_extents_type input_extents{3, 4}; { using expected_extents_type = Kokkos::dextents; - using expected_layout_type = Kokkos::Experimental::layout_left_padded; + using expected_layout_type = Kokkos::layout_left_padded; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&](auto sliceSpec) { @@ -646,7 +646,7 @@ TEST(TestMdspan, SubmdspanStaticSlice_Left_idd_TupleFull) { } { using expected_extents_type = Kokkos::extents; - using expected_layout_type = Kokkos::Experimental::layout_left_padded; + using expected_layout_type = Kokkos::layout_left_padded; using expected_output_mdspan_type = Kokkos::mdspan; auto runTest = [&](auto sliceSpec) {