From c027dd2166551920c1bc54e306c9168926ced3f1 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 26 Jan 2023 09:27:08 -0500 Subject: [PATCH] Use DEAL_II_CONSTEXPR_IN_CONDITIONAL --- include/deal.II/base/partitioner.templates.h | 44 ++++++-------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/include/deal.II/base/partitioner.templates.h b/include/deal.II/base/partitioner.templates.h index b0206001c0..b27d484ee9 100644 --- a/include/deal.II/base/partitioner.templates.h +++ b/include/deal.II/base/partitioner.templates.h @@ -121,12 +121,9 @@ namespace Utilities for (unsigned int i = 0; i < n_import_targets; ++i) { # if defined(DEAL_II_MPI_WITH_DEVICE_SUPPORT) -# ifdef DEAL_II_HAVE_CXX17 - if constexpr (std::is_same::value) -# else - if (std::is_same::value) -# endif + if DEAL_II_CONSTEXPR_IN_CONDITIONAL (std::is_same< + MemorySpaceType, + MemorySpace::Default>::value) { const auto chunk_size = import_indices_plain_dev[i].size(); using IndexType = decltype(chunk_size); @@ -224,12 +221,8 @@ namespace Utilities { const unsigned int chunk_size = ghost_range.second - ghost_range.first; -# ifdef DEAL_II_HAVE_CXX17 - if constexpr (std::is_same::value) -# else - if (std::is_same::value) -# endif + if DEAL_II_CONSTEXPR_IN_CONDITIONAL ( + std::is_same::value) { // If source and destination are overlapping, we must be // careful to use an appropriate copy function. @@ -400,13 +393,8 @@ namespace Utilities if (ghost_array_ptr + offset != ghost_array.data() + my_ghosts->first) { -# ifdef DEAL_II_HAVE_CXX17 - if constexpr (std::is_same::value) -# else - if (std::is_same::value) -# endif + if DEAL_II_CONSTEXPR_IN_CONDITIONAL ( + std::is_same::value) { if (offset > my_ghosts->first) std::copy_backward(ghost_array.data() + @@ -611,12 +599,9 @@ namespace Utilities const Number *read_position = temporary_storage.data(); # if defined(DEAL_II_MPI_WITH_DEVICE_SUPPORT) -# ifdef DEAL_II_HAVE_CXX17 - if constexpr (std::is_same::value) -# else - if (std::is_same::value) -# endif + if DEAL_II_CONSTEXPR_IN_CONDITIONAL (std::is_same< + MemorySpaceType, + MemorySpace::Default>::value) { if (vector_operation == dealii::VectorOperation::add) { @@ -794,12 +779,9 @@ namespace Utilities Assert(ghost_array.begin() != nullptr, ExcInternalError()); # if defined(DEAL_II_MPI_WITH_DEVICE_SUPPORT) -# ifdef DEAL_II_HAVE_CXX17 - if constexpr (std::is_same::value) -# else - if (std::is_same::value) -# endif + if DEAL_II_CONSTEXPR_IN_CONDITIONAL (std::is_same< + MemorySpaceType, + MemorySpace::Default>::value) { Kokkos::deep_copy( Kokkos::View( -- 2.39.5