From a8d7640129c50aceb86d57536409d85de56dc92f Mon Sep 17 00:00:00 2001 From: Christian Trott Date: Wed, 21 Aug 2024 12:55:24 -0600 Subject: [PATCH] Use macros to protect use of SharedSpace if constexpr protection is not enough, false branches still need to be parsable. --- core/unit_test/TestViewBadAlloc.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/unit_test/TestViewBadAlloc.hpp b/core/unit_test/TestViewBadAlloc.hpp index 7cb2f91655d..24ee0d8942c 100644 --- a/core/unit_test/TestViewBadAlloc.hpp +++ b/core/unit_test/TestViewBadAlloc.hpp @@ -68,19 +68,17 @@ TEST(TEST_CATEGORY, view_bad_alloc) { test_view_bad_alloc(); +#if !defined(KOKKOS_ENABLE_OPENACC) && !defined(KOKKOS_ENABLE_OPENMPTARGET) constexpr bool execution_space_is_device = std::is_same_v && !std::is_same_v; if constexpr (execution_space_is_device) { - if constexpr (Kokkos::has_shared_space) { - test_view_bad_alloc(); - } - if constexpr (Kokkos::has_shared_host_pinned_space) { - test_view_bad_alloc(); - } + test_view_bad_alloc(); + test_view_bad_alloc(); } +#endif } } // namespace