Skip to content

Commit

Permalink
Update ToArray test with Kokkos 4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuichi Asahi committed Oct 15, 2024
1 parent 61c3826 commit f0a9ada
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions common/unit_test/Test_Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,21 +544,11 @@ TEST(IndexSequence, 3Dto5D) {

TEST(ToArray, lvalue) {
std::array<int, 3> arr{1, 2, 3};
Kokkos::Array<int, 3> ref_arr{1, 2, 3};
auto kokkos_arr = KokkosFFT::Impl::to_array(arr);
for (std::size_t i = 0; i < arr.size(); ++i) {
ASSERT_EQ(kokkos_arr[i], ref_arr[i]);
}
ASSERT_EQ(KokkosFFT::Impl::to_array(arr), (Kokkos::Array{1, 2, 3}));
}

TEST(ToArray, rvalue) {
Kokkos::Array<int, 3> ref_arr{1, 2, 3};
auto kokkos_arr = KokkosFFT::Impl::to_array(std::array{1, 2, 3});
for (std::size_t i = 0; i < ref_arr.size(); ++i) {
ASSERT_EQ(kokkos_arr[i], ref_arr[i]);
}
// [TO DO] Need to update Kokkos version for compile time test
// GTEST_SKIP() << "Skipping ToArray::rvalue compile time test";
// static_assert(KokkosFFT::Impl::to_array(std::array{1, 2}) ==
// Kokkos::Array{1, 2});
GTEST_SKIP() << "Skipping ToArray::rvalue compile time test";
static_assert(KokkosFFT::Impl::to_array(std::array{1, 2}) ==
Kokkos::Array{1, 2});
}

0 comments on commit f0a9ada

Please sign in to comment.