Skip to content

Commit

Permalink
Don't set TORCH_CUDA_ARCH_LIST by default
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Jun 6, 2024
1 parent 214e7cf commit f751df6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ if(GPU_RUNTIME STREQUAL "CUDA")
if(NOT OPENSPLAT_MAX_CUDA_COMPATIBILITY)
if(NOT CMAKE_CUDA_ARCHITECTURES)
SET(CMAKE_CUDA_ARCHITECTURES 70;75;80)
elseif (NOT TORCH_CUDA_ARCH_LIST)
# Set torch cuda architecture list
set(TORCH_CUDA_ARCH_LIST ${CMAKE_CUDA_ARCHITECTURES})
list(TRANSFORM TORCH_CUDA_ARCH_LIST REPLACE "([0-9])([0-9])" "\\1.\\2")
string(REPLACE ";" " " TORCH_CUDA_ARCH_LIST "${TORCH_CUDA_ARCH_LIST}")
message(STATUS "** Updated TORCH_CUDA_ARCH_LIST to ${TORCH_CUDA_ARCH_LIST} **")
endif()
else()
# Build for maximum compatibility
Expand Down Expand Up @@ -110,11 +116,6 @@ if(GPU_RUNTIME STREQUAL "CUDA")
endforeach()
message("Set CUDA flags: " ${CMAKE_CUDA_FLAGS})
endif()
# Set torch cuda architecture list
set(TORCH_CUDA_ARCH_LIST ${CMAKE_CUDA_ARCHITECTURES})
list(TRANSFORM TORCH_CUDA_ARCH_LIST REPLACE "([0-9])([0-9])" "\\1.\\2")
string(REPLACE ";" " " TORCH_CUDA_ARCH_LIST "${TORCH_CUDA_ARCH_LIST}")
message(STATUS "** Updated TORCH_CUDA_ARCH_LIST to ${TORCH_CUDA_ARCH_LIST} **")
endif()
elseif(GPU_RUNTIME STREQUAL "HIP")
set(USE_HIP ON CACHE BOOL "Use HIP for GPU acceleration")
Expand Down

0 comments on commit f751df6

Please sign in to comment.