Skip to content

Commit ab576e1

Browse files
authored
Allow C++20 HIP builds (#4739)
This removes the hard-coded C++17 compiler flag when HIP is turned on, so codes are able to use C++20 with HIP.
1 parent fa7a06d commit ab576e1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Tools/CMake/AMReXParallelBackends.cmake

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,8 @@ if (AMReX_HIP)
366366
#
367367
target_compile_options(amrex_${D}d PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-munsafe-fp-atomics>)
368368

369-
# ROCm 5.5: forgets to enforce C++17 (default seems lower)
370-
# https://github.com/AMReX-Codes/amrex/issues/3337
371-
#
372-
target_compile_options(amrex_${D}d PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-std=c++17>)
369+
# Ensure ROCm builds enable at least C++17 without overriding higher standards
370+
target_compile_features(amrex_${D}d PUBLIC cxx_std_17)
373371
endforeach()
374372

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

0 commit comments

Comments
 (0)