From: Bruno Turcksin Date: Tue, 8 Aug 2023 21:07:25 +0000 (-0400) Subject: Fix issue when compiling with HIP X-Git-Tag: relicensing~603^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0aa036957f2e73113a8b4e229a6be69564697a88;p=dealii.git Fix issue when compiling with HIP --- 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