From e08982c10241c2a213d9c3d08b2625053a3b68b1 Mon Sep 17 00:00:00 2001 From: Christian Glusa Date: Thu, 25 Jul 2024 09:48:12 -0600 Subject: [PATCH] MueLu: Modify deepcopy regression test logic Signed-off-by: Christian Glusa --- packages/muelu/test/unit_tests/Regression.cpp | 18 ++++++++++++------ .../test/unit_tests_kokkos/Regression.cpp | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/packages/muelu/test/unit_tests/Regression.cpp b/packages/muelu/test/unit_tests/Regression.cpp index 6e646ae6ad4b..ae269988adfd 100644 --- a/packages/muelu/test/unit_tests/Regression.cpp +++ b/packages/muelu/test/unit_tests/Regression.cpp @@ -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) + kkNativeDeepCopies = 0; +#endif +#if defined(KOKKOSKERNELS_ENABLE_TPL_ROCSPARSE) + if constexpr (std::is_same_v) + kkNativeDeepCopies = 0; #endif if (Node::is_cpu) { diff --git a/packages/muelu/test/unit_tests_kokkos/Regression.cpp b/packages/muelu/test/unit_tests_kokkos/Regression.cpp index e7fc082839dc..a492d5529ecf 100644 --- a/packages/muelu/test/unit_tests_kokkos/Regression.cpp +++ b/packages/muelu/test/unit_tests_kokkos/Regression.cpp @@ -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) + kkNativeDeepCopies = 0; +#endif +#if defined(KOKKOSKERNELS_ENABLE_TPL_ROCSPARSE) + if constexpr (std::is_same_v) + kkNativeDeepCopies = 0; #endif if (Node::is_cpu) {