update CUDA architecture flags initialization

* remove obsolete paths
* add Pascal arch support
This commit is contained in:
Vladislav Vinogradov 2016-07-13 13:03:16 +03:00
parent 112903c2bd
commit d76f258aeb

View File

@ -43,7 +43,7 @@ if(CUDA_FOUND)
message(STATUS "CUDA detected: " ${CUDA_VERSION})
set(_generations "Fermi" "Kepler")
set(_generations "Fermi" "Kepler" "Maxwell" "Pascal")
if(NOT CMAKE_CROSSCOMPILING)
list(APPEND _generations "Auto")
endif()
@ -63,13 +63,13 @@ if(CUDA_FOUND)
set(__cuda_arch_ptx "")
if(CUDA_GENERATION STREQUAL "Fermi")
set(__cuda_arch_bin "2.0 2.1(2.0)")
set(__cuda_arch_bin "2.0")
elseif(CUDA_GENERATION STREQUAL "Kepler")
if(${CUDA_VERSION} VERSION_LESS "5.0")
set(__cuda_arch_bin "3.0")
else()
set(__cuda_arch_bin "3.0 3.5")
endif()
elseif(CUDA_GENERATION STREQUAL "Maxwell")
set(__cuda_arch_bin "5.0")
elseif(CUDA_GENERATION STREQUAL "Pascal")
set(__cuda_arch_bin "6.0")
elseif(CUDA_GENERATION STREQUAL "Auto")
execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" "--run"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
@ -91,14 +91,12 @@ if(CUDA_FOUND)
set(__cuda_arch_bin "5.3")
set(__cuda_arch_ptx "")
else()
if(${CUDA_VERSION} VERSION_LESS "5.0")
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
elseif(${CUDA_VERSION} VERSION_GREATER "6.5")
set(__cuda_arch_bin "2.0 2.1(2.0) 3.0 3.5")
if(${CUDA_VERSION} VERSION_LESS "8.0")
set(__cuda_arch_bin "2.0 3.0 3.5 5.0")
else()
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5")
set(__cuda_arch_bin "2.0 3.0 3.5 5.0 6.0")
endif()
set(__cuda_arch_ptx "3.0")
set(__cuda_arch_ptx "")
endif()
endif()