From df8325f571b43c806dec9c23a14877fe4b98244c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 7 Feb 2025 09:14:51 -0700 Subject: [PATCH] Move misplaced #defines from numbers.h to config.h. --- include/deal.II/base/config.h.in | 15 +++++++++++++++ include/deal.II/base/numbers.h | 13 ------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/include/deal.II/base/config.h.in b/include/deal.II/base/config.h.in index 448ece008d..65e8e55fff 100644 --- a/include/deal.II/base/config.h.in +++ b/include/deal.II/base/config.h.in @@ -110,6 +110,21 @@ #cmakedefine DEAL_II_RESTRICT @DEAL_II_RESTRICT@ #cmakedefine DEAL_II_COMPILER_HAS_DIAGNOSTIC_PRAGMA + +#define DEAL_II_HOST_DEVICE KOKKOS_FUNCTION +#define DEAL_II_HOST_DEVICE_ALWAYS_INLINE KOKKOS_FORCEINLINE_FUNCTION + +// clang++ assumes that all constexpr functions are __host__ __device__ when +// Kokkos was configured with CUDA or HIP support. This is problematic +// when calling non-constexpr functions in constexpr functions. Hence, we +// need a way to annotate functions explicitly as host-only. +#if (defined(__clang__) && defined(__CUDA__)) || defined(KOKKOS_ENABLE_HIP) +# define DEAL_II_HOST __host__ +#else +# define DEAL_II_HOST +#endif + + /*********************************************************************** * CPU features: * diff --git a/include/deal.II/base/numbers.h b/include/deal.II/base/numbers.h index 2a1b8918af..fb8926155c 100644 --- a/include/deal.II/base/numbers.h +++ b/include/deal.II/base/numbers.h @@ -27,19 +27,6 @@ #include #include -#define DEAL_II_HOST_DEVICE KOKKOS_FUNCTION -#define DEAL_II_HOST_DEVICE_ALWAYS_INLINE KOKKOS_FORCEINLINE_FUNCTION - -// clang++ assumes that all constexpr functions are __host__ __device__ when -// Kokkos was configured with CUDA or HIP support. This is problematic -// when calling non-constexpr functions in constexpr functions. Hence, we -// need a way to annotate functions explicitly as host-only. -#if (defined(__clang__) && defined(__CUDA__)) || defined(KOKKOS_ENABLE_HIP) -# define DEAL_II_HOST __host__ -#else -# define DEAL_II_HOST -#endif - // Forward-declare the automatic differentiation types so we can add prototypes // for our own wrappers. #ifdef DEAL_II_WITH_ADOLC -- 2.39.5