Skip to content

Commit

Permalink
Support NVHPC stdpar=multicore and AMDGPU interpose-alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalobg committed Aug 14, 2024
1 parent 084ef3b commit 4cebcde
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/std/model.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ register_flag_optional(NVHPC_OFFLOAD
ccnative - Compiles for compute capability of current device"
"")

register_flag_optional(NVHPC_MULTICORE
"Enable multicore parallelization with the NVHPC SDK."
"")

register_flag_optional(ACPP_OFFLOAD
"Enable offloading support (via the non-standard `-acpp-stdpar`) for AdaptiveCpp."
"OFF")
Expand Down Expand Up @@ -76,7 +80,14 @@ macro(setup)
# propagate flags to linker so that it links with the gpu stuff as well
register_append_cxx_flags(ANY ${NVHPC_FLAGS})
register_append_link_flags(${NVHPC_FLAGS})
endif ()
if (NVHPC_MULTICORE)
set(NVHPC_FLAGS -stdpar=multicore)
# propagate flags to linker so that it links with the gpu stuff as well
register_append_cxx_flags(ANY ${NVHPC_FLAGS})
register_append_link_flags(${NVHPC_FLAGS})
endif ()

if (ACPP_OFFLOAD)
set(ACPP_FLAGS --acpp-stdpar)
register_append_cxx_flags(ANY ${ACPP_FLAGS})
Expand All @@ -95,10 +106,9 @@ macro(setup)
endif ()
if (AMDGPU_TARGET_OFFLOAD)
set(AMDGPU_TARGET_OFFLOAD_FLAGS --hipstdpar --offload-arch=${AMDGPU_TARGET_OFFLOAD})
if (NOT AMDGPU_TARGET_OFFLOAD MATCHES "^gfx9")
if (NOT AMDGPU_TARGET_OFFLOAD MATCHES "^gfx9" OR AMDGPU_INTERPOSE_ALLOC)
list(APPEND AMDGPU_TARGET_OFFLOAD_FLAGS --hipstdpar-interpose-alloc)
endif ()

register_append_cxx_flags(ANY ${AMDGPU_TARGET_OFFLOAD_FLAGS})
register_append_link_flags(--hipstdpar)
endif ()
Expand Down

0 comments on commit 4cebcde

Please sign in to comment.