From: Daniel Arndt Date: Thu, 26 Jan 2023 14:27:08 +0000 (-0500) Subject: Use DEAL_II_CONSTEXPR_IN_CONDITIONAL X-Git-Tag: v9.5.0-rc1~595^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14571%2Fhead;p=dealii.git Use DEAL_II_CONSTEXPR_IN_CONDITIONAL --- 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(