Skip to content

Commit 4cebcde

Browse files
committed
Support NVHPC stdpar=multicore and AMDGPU interpose-alloc
1 parent 084ef3b commit 4cebcde

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Diff for: src/std/model.cmake

+12-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ register_flag_optional(NVHPC_OFFLOAD
2020
ccnative - Compiles for compute capability of current device"
2121
"")
2222

23+
register_flag_optional(NVHPC_MULTICORE
24+
"Enable multicore parallelization with the NVHPC SDK."
25+
"")
26+
2327
register_flag_optional(ACPP_OFFLOAD
2428
"Enable offloading support (via the non-standard `-acpp-stdpar`) for AdaptiveCpp."
2529
"OFF")
@@ -76,7 +80,14 @@ macro(setup)
7680
# propagate flags to linker so that it links with the gpu stuff as well
7781
register_append_cxx_flags(ANY ${NVHPC_FLAGS})
7882
register_append_link_flags(${NVHPC_FLAGS})
83+
endif ()
84+
if (NVHPC_MULTICORE)
85+
set(NVHPC_FLAGS -stdpar=multicore)
86+
# propagate flags to linker so that it links with the gpu stuff as well
87+
register_append_cxx_flags(ANY ${NVHPC_FLAGS})
88+
register_append_link_flags(${NVHPC_FLAGS})
7989
endif ()
90+
8091
if (ACPP_OFFLOAD)
8192
set(ACPP_FLAGS --acpp-stdpar)
8293
register_append_cxx_flags(ANY ${ACPP_FLAGS})
@@ -95,10 +106,9 @@ macro(setup)
95106
endif ()
96107
if (AMDGPU_TARGET_OFFLOAD)
97108
set(AMDGPU_TARGET_OFFLOAD_FLAGS --hipstdpar --offload-arch=${AMDGPU_TARGET_OFFLOAD})
98-
if (NOT AMDGPU_TARGET_OFFLOAD MATCHES "^gfx9")
109+
if (NOT AMDGPU_TARGET_OFFLOAD MATCHES "^gfx9" OR AMDGPU_INTERPOSE_ALLOC)
99110
list(APPEND AMDGPU_TARGET_OFFLOAD_FLAGS --hipstdpar-interpose-alloc)
100111
endif ()
101-
102112
register_append_cxx_flags(ANY ${AMDGPU_TARGET_OFFLOAD_FLAGS})
103113
register_append_link_flags(--hipstdpar)
104114
endif ()

0 commit comments

Comments
 (0)