Skip to content

Commit

Permalink
Merge pull request #3 from cgcgcg/muelu-changes-to-spgemm-pr
Browse files Browse the repository at this point in the history
MueLu: Modify deepcopy regression test logic
  • Loading branch information
cwpearson authored Jul 25, 2024
2 parents 9dcfd9e + e08982c commit e8254f9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
18 changes: 12 additions & 6 deletions packages/muelu/test/unit_tests/Regression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,18 @@ TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Regression, H2D, Scalar, LocalOrdinal, GlobalO
TEST_EQUALITY(2, H->GetGlobalNumLevels());

// When Kokkos Kernels uses TPLs, some Kokkos::deep_copy in the Kokkos Kernels native implementations are not called.
#if defined(KOKKOSKERNELS_ENABLE_TPL_CUSPARSE) \
|| defined(KOKKOSKERNELS_ENABLE_TPL_ROCSPARSE) \
|| defined(KOKKOSKERNELS_ENABLE_TPL_MKL)
constexpr int kkNativeDeepCopies = 0;
#else
constexpr int kkNativeDeepCopies = 8;
int kkNativeDeepCopies = 8;
#if defined(KOKKOSKERNELS_ENABLE_TPL_MKL)
if constexpr (Node::is_cpu)
kkNativeDeepCopies = 0;
#endif
#if defined(KOKKOSKERNELS_ENABLE_TPL_CUSPARSE)
if constexpr (std::is_same_v<typename Node::execution_space, Kokkos::Cuda>)
kkNativeDeepCopies = 0;
#endif
#if defined(KOKKOSKERNELS_ENABLE_TPL_ROCSPARSE)
if constexpr (std::is_same_v<typename Node::execution_space, Kokkos::HIP>)
kkNativeDeepCopies = 0;
#endif

if (Node::is_cpu) {
Expand Down
18 changes: 12 additions & 6 deletions packages/muelu/test/unit_tests_kokkos/Regression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,18 @@ TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Regression, H2D, Scalar, LocalOrdinal, GlobalO
TEST_EQUALITY(2, H->GetGlobalNumLevels());

// When Kokkos Kernels uses TPLs, some Kokkos::deep_copy in the Kokkos Kernels native implementations are not called.
#if defined(KOKKOSKERNELS_ENABLE_TPL_CUSPARSE) \
|| defined(KOKKOSKERNELS_ENABLE_TPL_ROCSPARSE) \
|| defined(KOKKOSKERNELS_ENABLE_TPL_MKL)
constexpr int kkNativeDeepCopies = 0;
#else
constexpr int kkNativeDeepCopies = 8;
int kkNativeDeepCopies = 8;
#if defined(KOKKOSKERNELS_ENABLE_TPL_MKL)
if constexpr (Node::is_cpu)
kkNativeDeepCopies = 0;
#endif
#if defined(KOKKOSKERNELS_ENABLE_TPL_CUSPARSE)
if constexpr (std::is_same_v<typename Node::execution_space, Kokkos::Cuda>)
kkNativeDeepCopies = 0;
#endif
#if defined(KOKKOSKERNELS_ENABLE_TPL_ROCSPARSE)
if constexpr (std::is_same_v<typename Node::execution_space, Kokkos::HIP>)
kkNativeDeepCopies = 0;
#endif

if (Node::is_cpu) {
Expand Down

0 comments on commit e8254f9

Please sign in to comment.