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

Fix issue when compiling with HIP #15862

merged 2 commits into from Aug 9, 2023

Conversation

Rombur
Copy link
Member

@Rombur Rombur commented Aug 8, 2023

With this PR I can compile and run deal.II on Frontier.

@@ -41,7 +41,7 @@
// 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__)
#if defined(__clang__) && defined(__CUDA__) || defined(KOKKOS_ENABLE_HIP)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always forget if && has precedence over ||.

Suggested change
#if defined(__clang__) && defined(__CUDA__) || defined(KOKKOS_ENABLE_HIP)
#if (defined(__clang__) && defined(__CUDA__)) || defined(KOKKOS_ENABLE_HIP)

Also, the above command also doesn't match anymore. Maybe, say something like

// clang++ assumes that all constexpr functions are __host__ __device__ when `Kokkos` was configured with  `HIP` or `CUDA` support. [...]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always forget if && has precedence over ||

It doesn't matter since all the HIP compiler are clang based

@Rombur
Copy link
Member Author

Rombur commented Aug 8, 2023

/rebuild

include/deal.II/base/numbers.h Outdated Show resolved Hide resolved
Co-authored-by: Marc Fehling <mafehling.git@gmail.com>
@marcfehling marcfehling merged commit 21bdb65 into dealii:master Aug 9, 2023
12 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants