Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue when compiling with HIP #15862

Merged
merged 2 commits into from
Aug 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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