Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tools/CMake/AMReXSetDefines.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ endif()
if (AMReX_HIP)
add_amrex_define( AMREX_USE_HIP NO_LEGACY )
add_amrex_define( NDEBUG ) # This address a bug that causes slow build times
if (${AMReX_AMD_ARCH} MATCHES "gfx1[01].*")
if (${AMReX_AMD_ARCH} MATCHES "gfx1[012].*")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if (${AMReX_AMD_ARCH} MATCHES "gfx1[012].*")
if (${AMReX_AMD_ARCH} MATCHES "gfx1???")

Could you tell me if this works?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

"gfx1???" gives an error during compilation.

CMake Error at Submodules/AMReX/Tools/CMake/AMReXSetDefines.cmake:68 (if):
if given arguments:

"gfx1201" "MATCHES" "gfx1???"

Regular expression "gfx1???" cannot compile
Call Stack (most recent call first):
Submodules/AMReX/Src/CMakeLists.txt:45 (include)

Copy link
Copy Markdown
Member

@AlexanderSinn AlexanderSinn May 6, 2026

Choose a reason for hiding this comment

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

Can you try

if (${AMReX_AMD_ARCH} MATCHES "^gfx1..[a-z0-9]($|:)")

this should also cover the case of extra options like gfx90a:sramecc+:xnack+

https://godbolt.org/z/baGYGaG8o

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Didn't know CMake's regex does not support ?.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It does, but it is a modifier for the previous character (can match 0 or 1) and there can only be one question mark in a row.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I got confused with shell.

add_amrex_define( AMREX_AMDGCN_WAVEFRONT_SIZE=32 NO_LEGACY )
else ()
add_amrex_define( AMREX_AMDGCN_WAVEFRONT_SIZE=64 NO_LEGACY )
Expand Down
Loading