fix build for older versions of CUDA

This commit is contained in:
Bram Wasti
2016-12-22 13:16:41 -08:00
parent d4a783405f
commit fc74eae082

View File

@ -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})