Skip to content

Commit bc19652

Browse files
authored
Merge pull request #1617 from ericniebler/default-cmake-cuda-architectures-to-native
if `CMAKE_CUDA_ARCHITECTURES` is not set, set it to `"native"`
2 parents d9da54e + eb905a1 commit bc19652

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)