From 0aa036957f2e73113a8b4e229a6be69564697a88 Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Tue, 8 Aug 2023 17:07:25 -0400 Subject: [PATCH] Fix issue when compiling with HIP --- include/deal.II/base/numbers.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/deal.II/base/numbers.h b/include/deal.II/base/numbers.h index 12b7973592..a516fcaead 100644 --- a/include/deal.II/base/numbers.h +++ b/include/deal.II/base/numbers.h @@ -37,11 +37,10 @@ #define DEAL_II_HOST_DEVICE_ALWAYS_INLINE KOKKOS_FORCEINLINE_FUNCTION // clang++ assumes that all constexpr functions are __host__ __device__ when -// compiling CUDA code, i.e, when Kokkos was configured with CUDA 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__) +// 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 -- 2.39.5