Skip to content

Commit 3f789e9

Browse files
committed
Fix invalid code
1 parent e31f660 commit 3f789e9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/public/utils.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,11 @@ macro(torch_cuda_get_nvcc_gencode_flag store_var)
467467
"CUDA_ARCH_NAME is no longer used. Use TORCH_CUDA_ARCH_LIST instead. "
468468
"Right now, CUDA_ARCH_NAME is ${CUDA_ARCH_NAME} and "
469469
"TORCH_CUDA_ARCH_LIST is ${TORCH_CUDA_ARCH_LIST}.")
470-
set(TORCH_CUDA_ARCH_LIST TORCH_CUDA_ARCH_LIST ${CUDA_ARCH_NAME})
470+
if(NOT TORCH_CUDA_ARCH_LIST)
471+
set(TORCH_CUDA_ARCH_LIST ${CUDA_ARCH_NAME})
472+
else()
473+
list(APPEND TORCH_CUDA_ARCH_LIST ${CUDA_ARCH_NAME})
474+
endif()
471475
endif()
472476

473477
torch_cuda_select_nvcc_arch_flags(${store_var} ${TORCH_CUDA_ARCH_LIST})

0 commit comments

Comments
 (0)