Skip to content

Commit e8254f9

Browse files
authored
Merge pull request #3 from cgcgcg/muelu-changes-to-spgemm-pr
MueLu: Modify deepcopy regression test logic
2 parents 9dcfd9e + e08982c commit e8254f9

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

packages/muelu/test/unit_tests/Regression.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,18 @@ TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Regression, H2D, Scalar, LocalOrdinal, GlobalO
106106
TEST_EQUALITY(2, H->GetGlobalNumLevels());
107107

108108
// When Kokkos Kernels uses TPLs, some Kokkos::deep_copy in the Kokkos Kernels native implementations are not called.
109-
#if defined(KOKKOSKERNELS_ENABLE_TPL_CUSPARSE) \
110-
|| defined(KOKKOSKERNELS_ENABLE_TPL_ROCSPARSE) \
111-
|| defined(KOKKOSKERNELS_ENABLE_TPL_MKL)
112-
constexpr int kkNativeDeepCopies = 0;
113-
#else
114-
constexpr int kkNativeDeepCopies = 8;
109+
int kkNativeDeepCopies = 8;
110+
#if defined(KOKKOSKERNELS_ENABLE_TPL_MKL)
111+
if constexpr (Node::is_cpu)
112+
kkNativeDeepCopies = 0;
113+
#endif
114+
#if defined(KOKKOSKERNELS_ENABLE_TPL_CUSPARSE)
115+
if constexpr (std::is_same_v<typename Node::execution_space, Kokkos::Cuda>)
116+
kkNativeDeepCopies = 0;
117+
#endif
118+
#if defined(KOKKOSKERNELS_ENABLE_TPL_ROCSPARSE)
119+
if constexpr (std::is_same_v<typename Node::execution_space, Kokkos::HIP>)
120+
kkNativeDeepCopies = 0;
115121
#endif
116122

117123
if (Node::is_cpu) {

packages/muelu/test/unit_tests_kokkos/Regression.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,18 @@ TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Regression, H2D, Scalar, LocalOrdinal, GlobalO
111111
TEST_EQUALITY(2, H->GetGlobalNumLevels());
112112

113113
// When Kokkos Kernels uses TPLs, some Kokkos::deep_copy in the Kokkos Kernels native implementations are not called.
114-
#if defined(KOKKOSKERNELS_ENABLE_TPL_CUSPARSE) \
115-
|| defined(KOKKOSKERNELS_ENABLE_TPL_ROCSPARSE) \
116-
|| defined(KOKKOSKERNELS_ENABLE_TPL_MKL)
117-
constexpr int kkNativeDeepCopies = 0;
118-
#else
119-
constexpr int kkNativeDeepCopies = 8;
114+
int kkNativeDeepCopies = 8;
115+
#if defined(KOKKOSKERNELS_ENABLE_TPL_MKL)
116+
if constexpr (Node::is_cpu)
117+
kkNativeDeepCopies = 0;
118+
#endif
119+
#if defined(KOKKOSKERNELS_ENABLE_TPL_CUSPARSE)
120+
if constexpr (std::is_same_v<typename Node::execution_space, Kokkos::Cuda>)
121+
kkNativeDeepCopies = 0;
122+
#endif
123+
#if defined(KOKKOSKERNELS_ENABLE_TPL_ROCSPARSE)
124+
if constexpr (std::is_same_v<typename Node::execution_space, Kokkos::HIP>)
125+
kkNativeDeepCopies = 0;
120126
#endif
121127

122128
if (Node::is_cpu) {

0 commit comments

Comments
 (0)