@@ -38,27 +38,10 @@ if(USE_CUDA)
3838 list (APPEND TVM_RUNTIME_LINKER_LIBS ${CUDA_CUDA_LIBRARY} )
3939 list (APPEND TVM_RUNTIME_LINKER_LIBS ${CUDA_NVRTC_LIBRARY} )
4040
41- # Compatibility with cmake 3.18+
42- #
43- # The updates to the cutlass kernels made in TVM PR#16244 require
44- # symbols provided in cuda 7.5+. While the cuda architecture is
45- # specified by setting `NVCC_FLAGS` in the `CMakeLists.txt` for each
46- # kernel, cmake 3.18+ also sets it based on the
47- # `CMAKE_CUDA_ARCHITECTURES` value. If not set, cmake will explicitly
48- # pass the compute capability as nvidia's default of 5.2, *EVEN IF* it
49- # has already been specified in `NVCC_FLAGS`. Because the kernels
50- # cannot compile with compute capability of 5.2, this causes
51- # compilation errors.
52- #
53- # By setting `CMAKE_CUDA_ARCHITECTURES` to `OFF`, cmake does not add
54- # 5.2 as a target architecture.
55- #
56- # See https://cmake.org/cmake/help/latest/policy/CMP0104.html for
57- # details on CMake's policy for CUDA architecture flags.
58- #
59- # See https://cmake.org/cmake/help/latest/policy/CMP0104.html for the
60- # default CUDA architecture for each version of CUDA.
61- set (CMAKE_CUDA_ARCHITECTURES OFF )
41+ if (NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
42+ message (STATUS "CMAKE_CUDA_ARCHITECTURES not set, using native" )
43+ set (CMAKE_CUDA_ARCHITECTURES native)
44+ endif ()
6245
6346 if (USE_CUDNN)
6447 message (STATUS "Build with cuDNN support" )
0 commit comments