Skip to content

Commit

Permalink
CMake: Enforce >= C++17 for ROCm (#3355)
Browse files Browse the repository at this point in the history
## Summary

Check if this adds the C++17 flags again or if there is an undocumented
change in defaults that we need to manually address for AMD's Clang
fork'd compilers now.

## Additional background

For #3337
  • Loading branch information
ax3l committed Jun 14, 2023
1 parent 96b811d commit 41a6700
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Tools/CMake/AMReXParallelBackends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ if (AMReX_HIP)
# ROCm 4.5: use unsafe floating point atomics, otherwise atomicAdd is much slower
#
target_compile_options(amrex_${D}d PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-munsafe-fp-atomics>)

# ROCm 5.5: forgets to enforce C++17 (default seems lower)
# https://github.com/AMReX-Codes/amrex/issues/3337
#
target_compile_options(amrex_${D}d PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-std=c++17>)
endforeach()

# Equivalently, relocatable-device-code (RDC) flags are needed for `extern`
Expand Down

0 comments on commit 41a6700

Please sign in to comment.