]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix issue when compiling with HIP
authorBruno Turcksin <bruno.turcksin@gmail.com>
Tue, 8 Aug 2023 21:07:25 +0000 (17:07 -0400)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Tue, 8 Aug 2023 21:51:58 +0000 (17:51 -0400)
include/deal.II/base/numbers.h

index 12b79735929d46fe7bf4dd17f7d0b009a0329ad5..a516fcaead12945539b27ee441b3b7bce83cac80 100644 (file)
 #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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.