Skip to content

Commit eb905a1

Browse files
committed
if CMAKE_CUDA_ARCHITECTURES is not set, set it to "native"
1 parent d9da54e commit eb905a1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ if(STDEXEC_ENABLE_CUDA)
311311
target_compile_features(nvexec INTERFACE cuda_std_20)
312312
target_link_libraries(nvexec INTERFACE STDEXEC::stdexec)
313313

314+
if(NOT CMAKE_CUDA_ARCHITECTURES)
315+
set(CMAKE_CUDA_ARCHITECTURES "native")
316+
endif()
317+
314318
set(_gpus)
315319
foreach(_arch IN LISTS CMAKE_CUDA_ARCHITECTURES)
316320
if(_arch MATCHES "-real")
@@ -321,6 +325,8 @@ if(STDEXEC_ENABLE_CUDA)
321325
string(PREPEND _arch "cc")
322326
elseif(_arch MATCHES "^[0-9]+$")
323327
string(PREPEND _arch "cc")
328+
elseif(_arch MATCHES "^native$")
329+
string(PREPEND _arch "cc")
324330
endif()
325331
list(APPEND _gpus "${_arch}")
326332
endforeach()

0 commit comments

Comments
 (0)