File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -312,10 +312,25 @@ if(STDEXEC_ENABLE_CUDA)
312312 target_compile_features (nvexec INTERFACE cuda_std_20 )
313313 target_link_libraries (nvexec INTERFACE STDEXEC::stdexec )
314314
315+ set (_gpus)
316+ foreach (_arch IN LISTS CMAKE_CUDA_ARCHITECTURES)
317+ if (_arch MATCHES "-real" )
318+ string (REPLACE "-real" "" _arch "${_arch} " )
319+ string (PREPEND _arch "cc" )
320+ elseif (_arch MATCHES "-virtual" )
321+ string (REPLACE "-virtual" "" _arch "${_arch} " )
322+ string (PREPEND _arch "cc" )
323+ elseif (_arch MATCHES "^[0-9]+$" )
324+ string (PREPEND _arch "cc" )
325+ endif ()
326+ list (APPEND _gpus "${_arch} " )
327+ endforeach ()
328+ list (JOIN _gpus "," _gpus)
329+
315330 target_compile_options (nvexec INTERFACE
316- $<$<AND :$<CXX_COMPILER_ID :NVHPC >,$<COMPILE_LANGUAGE :CXX >>:-stdpar -gpu =cc ${CMAKE_CUDA_ARCHITECTURES } >)
331+ $<$<AND :$<CXX_COMPILER_ID :NVHPC >,$<COMPILE_LANGUAGE :CXX >>:-stdpar -gpu =${_gpus } >)
317332 target_link_options (nvexec INTERFACE
318- $<$<AND :$<CXX_COMPILER_ID :NVHPC >,$<COMPILE_LANGUAGE :CXX >>:-stdpar -gpu =cc ${CMAKE_CUDA_ARCHITECTURES } >)
333+ $<$<AND :$<CXX_COMPILER_ID :NVHPC >,$<COMPILE_LANGUAGE :CXX >>:-stdpar -gpu =${_gpus } >)
319334
320335 install (TARGETS nvexec
321336 EXPORT stdexec-exports
You can’t perform that action at this time.
0 commit comments