Skip to content

Commit

Permalink
kokkos#295: fix a few more tests that changed meaning after the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nmm0 committed Nov 10, 2023
1 parent 8e2b196 commit 38c7841
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/test_mdarray_ctors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ TEST(TestMdarrayCtorFromContainerSizes, 1d_dynamic) {
std::vector<int> d{42};
// ptr to fill, extents, is_layout_right
mdarray_values<1>::fill(d.data(),Kokkos::extents<int, 1>(),true);
KokkosEx::mdarray<int, Kokkos::dextents<int, 1>> m({},d);
KokkosEx::mdarray<int, Kokkos::dextents<int, 1>> m(Kokkos::extents<int, 1>{},d);
// mdarray, rank, rank_dynamic, ext0, ext1, ext2, stride0, stride1, stride2, ptr, ptr_matches, exhaustive
check_correctness(m, 1, 1, 1, 0, 0, 1, 0, 0, d.data(), false, true);
}
Expand All @@ -275,7 +275,7 @@ TEST(TestMdarrayCtorFromContainerSizes, 2d_dynamic) {
std::vector<int> d{42,1,2,3,4,41};
// ptr to fill, extents, is_layout_right
mdarray_values<2>::fill(d.data(),Kokkos::extents<int, 2,3>(),true);
KokkosEx::mdarray<int, Kokkos::dextents<int, 2>> m({},d);
KokkosEx::mdarray<int, Kokkos::dextents<int, 2>> m(Kokkos::extents<int, 2,3>{},d);
// mdarray, rank, rank_dynamic, ext0, ext1, ext2, stride0, stride1, stride2, ptr, ptr_matches, exhaustive
check_correctness(m, 2, 2, 2, 3, 0, 3, 1, 0, d.data(), false, true);
}
Expand All @@ -284,7 +284,7 @@ TEST(TestMdarrayCtorFromContainerSizes, 2d_mixed) {
std::vector<int> d{42,1,2,3,4,41};
// ptr to fill, extents, is_layout_right
mdarray_values<2>::fill(d.data(),Kokkos::extents<int, 2,3>(),true);
KokkosEx::mdarray<int, Kokkos::extents<int, 2,Kokkos::dynamic_extent>> m({},d);
KokkosEx::mdarray<int, Kokkos::extents<int, 2,Kokkos::dynamic_extent>> m(Kokkos::extents<int, 2,3>{},d);
// mdarray, rank, rank_dynamic, ext0, ext1, ext2, stride0, stride1, stride2, ptr, ptr_matches, exhaustive
check_correctness(m, 2, 1, 2, 3, 0, 3, 1, 0, d.data(), false, true);
}
Expand Down Expand Up @@ -313,7 +313,7 @@ TEST(TestMdarrayCtorFromMoveContainerSizes, 1d_dynamic) {
auto ptr = d.data();
// ptr to fill, extents, is_layout_right
mdarray_values<1>::fill(ptr,Kokkos::extents<int, 1>(),true);
KokkosEx::mdarray<int, Kokkos::dextents<int, 1>> m({},std::move(d));
KokkosEx::mdarray<int, Kokkos::dextents<int, 1>> m(Kokkos::extents<int, 1>{},std::move(d));
// mdarray, rank, rank_dynamic, ext0, ext1, ext2, stride0, stride1, stride2, ptr, ptr_matches, exhaustive
check_correctness(m, 1, 1, 1, 0, 0, 1, 0, 0, ptr, true, true);
}
Expand All @@ -323,7 +323,7 @@ TEST(TestMdarrayCtorFromMoveContainerSizes, 2d_dynamic) {
auto ptr = d.data();
// ptr to fill, extents, is_layout_right
mdarray_values<2>::fill(ptr,Kokkos::extents<int, 2,3>(),true);
KokkosEx::mdarray<int, Kokkos::dextents<int, 2>> m({},std::move(d));
KokkosEx::mdarray<int, Kokkos::dextents<int, 2>> m(Kokkos::extents<int, 2,3>{},std::move(d));
// mdarray, rank, rank_dynamic, ext0, ext1, ext2, stride0, stride1, stride2, ptr, ptr_matches, exhaustive
check_correctness(m, 2, 2, 2, 3, 0, 3, 1, 0, ptr, true, true);
}
Expand All @@ -333,7 +333,7 @@ TEST(TestMdarrayCtorFromMoveContainerSizes, 2d_mixed) {
auto ptr = d.data();
// ptr to fill, extents, is_layout_right
mdarray_values<2>::fill(ptr,Kokkos::extents<int, 2,3>(),true);
KokkosEx::mdarray<int, Kokkos::extents<int, 2,Kokkos::dynamic_extent>> m({},std::move(d));
KokkosEx::mdarray<int, Kokkos::extents<int, 2,Kokkos::dynamic_extent>> m(Kokkos::extents<int, 2,3>{},std::move(d));
// mdarray, rank, rank_dynamic, ext0, ext1, ext2, stride0, stride1, stride2, ptr, ptr_matches, exhaustive
check_correctness(m, 2, 1, 2, 3, 0, 3, 1, 0, ptr, true, true);
}
Expand Down Expand Up @@ -483,7 +483,7 @@ TEST(TestMdarrayCtorWithPMR, 2d_mixed) {
// Construct from container only
TEST(TestMdarrayCtorDataStdArray, test_mdarray_ctor_data_carray) {
std::array<int, 1> d = {42};
KokkosEx::mdarray<int, Kokkos::extents<int, 1>, Kokkos::layout_right, std::array<int, 1>> m(d);
KokkosEx::mdarray<int, Kokkos::extents<int, 1>, Kokkos::layout_right, std::array<int, 1>> m({}, d);
ASSERT_EQ(m.rank(), 1);
ASSERT_EQ(m.rank_dynamic(), 0);
ASSERT_EQ(m.extent(0), 1);
Expand Down

0 comments on commit 38c7841

Please sign in to comment.