mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
fix build for older versions of CUDA
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
# Known NVIDIA GPU achitectures Caffe2 can be compiled for.
|
||||
# This list will be used for CUDA_ARCH_NAME = All option
|
||||
set(Caffe2_known_gpu_archs "20 21(20) 30 35 50 52 60 61")
|
||||
set(Caffe2_known_gpu_archs7 "20 21(20) 30 35 50 52")
|
||||
|
||||
################################################################################################
|
||||
# A function for automatic detection of GPUs installed (if autodetection is enabled)
|
||||
@ -169,6 +170,11 @@ endif()
|
||||
|
||||
set(HAVE_CUDA TRUE)
|
||||
message(STATUS "CUDA detected: " ${CUDA_VERSION})
|
||||
if (${CUDA_VERSION} LESS 8.0)
|
||||
set(Caffe2_known_gpu_archs ${Caffe2_known_gpu_archs7})
|
||||
list(APPEND CUDA_NVCC_FLAGS "-D_MWAITXINTRIN_H_INCLUDED")
|
||||
list(APPEND CUDA_NVCC_FLAGS "-D__STRICT_ANSI__")
|
||||
endif()
|
||||
include_directories(SYSTEM ${CUDA_INCLUDE_DIRS})
|
||||
list(APPEND Caffe2_LINKER_LIBS ${CUDA_CUDART_LIBRARY}
|
||||
${CUDA_curand_LIBRARY} ${CUDA_CUBLAS_LIBRARIES})
|
||||
|
Reference in New Issue
Block a user