From 710073b0aca922ed1ee3bdef5f185f397aacdd25 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Wed, 10 Apr 2024 16:48:56 -0600 Subject: [PATCH] irecv: remove mdspan tests --- unit_tests/test_isendirecv.cpp | 72 ++-------------------------------- 1 file changed, 3 insertions(+), 69 deletions(-) diff --git a/unit_tests/test_isendirecv.cpp b/unit_tests/test_isendirecv.cpp index 3da3b244..058ea05f 100644 --- a/unit_tests/test_isendirecv.cpp +++ b/unit_tests/test_isendirecv.cpp @@ -18,6 +18,8 @@ #include "KokkosComm.hpp" +#include "view_builder.hpp" + template class IsendIrecv : public testing::Test { public: @@ -95,72 +97,4 @@ TYPED_TEST(IsendIrecv, 1D_noncontig) { } } -#if KOKKOSCOMM_ENABLE_MDSPAN - -TYPED_TEST(IsendIrecv, 1D_mdspan_contig) { - using ScalarType = typename TestFixture::Scalar; - - std::vector v(100); - auto a = mdspan(&v[2], 13); // 13 scalars starting at index 2 - - int rank; - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - if (0 == rank) { - int dst = 1; - for (size_t i = 0; i < a.extent(0); ++i) { - a[i] = i; - } - KokkosComm::Req req = KokkosComm::isend(Kokkos::DefaultExecutionSpace(), a, - dst, 0, MPI_COMM_WORLD); - req.wait(); - } else if (1 == rank) { - int src = 0; - KokkosComm::Req req = KokkosComm::irecv(Kokkos::DefaultExecutionSpace(), a, - src, 0, MPI_COMM_WORLD); - req.wait(); - int errs = 0; - for (size_t i = 0; i < a.extent(0); ++i) { - errs += (a[i] != ScalarType(i)); - } - ASSERT_EQ(errs, 0); - } -} - -TYPED_TEST(IsendIrecv, 1D_mdspan_noncontig) { - using ScalarType = typename TestFixture::Scalar; - - std::vector v(100); - - using ExtentsType = dextents; - ExtentsType shape{10}; - std::array strides{10}; - - mdspan a( - &v[2], layout_stride::mapping{shape, strides}); - - int rank; - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - if (0 == rank) { - int dst = 1; - for (size_t i = 0; i < a.extent(0); ++i) { - a[i] = i; - } - KokkosComm::Req req = KokkosComm::isend(Kokkos::DefaultExecutionSpace(), a, - dst, 0, MPI_COMM_WORLD); - req.wait(); - } else if (1 == rank) { - int src = 0; - KokkosComm::Req req = KokkosComm::irecv(Kokkos::DefaultExecutionSpace(), a, - src, 0, MPI_COMM_WORLD); - req.wait(); - int errs = 0; - for (size_t i = 0; i < a.extent(0); ++i) { - errs += (a[i] != ScalarType(i)); - } - ASSERT_EQ(errs, 0); - } -} - -#endif // KOKKOSCOMM_ENABLE_MDSPAN \ No newline at end of file +#endif // KOKKOSCOMM_ENABLE_MDSPAN