Skip to content

Commit

Permalink
Merge pull request #15862 from Rombur/hip
Browse files Browse the repository at this point in the history
Fix issue when compiling with HIP
  • Loading branch information
marcfehling committed Aug 9, 2023
2 parents c9d13aa + 381fcbc commit 21bdb65
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions include/deal.II/base/numbers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
// 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
Expand Down

0 comments on commit 21bdb65

Please sign in to comment.