fix build error of automatic CC detection

pull/17571/head
Tomoaki Teshima 5 years ago
parent d321a34f7c
commit 1cba763189
  1. 6
      cmake/OpenCVDetectCUDA.cmake

@ -101,7 +101,7 @@ if(CUDA_FOUND)
else() else()
set(CC_LIST ${ARGN}) set(CC_LIST ${ARGN})
foreach(target_arch ${CC_LIST}) foreach(target_arch ${CC_LIST})
string(REPLACE "." "" target_arch_short ${target_arch}) string(REPLACE "." "" target_arch_short "${target_arch}")
set(NVCC_OPTION "-gencode;arch=compute_${target_arch_short},code=sm_${target_arch_short}") set(NVCC_OPTION "-gencode;arch=compute_${target_arch_short},code=sm_${target_arch_short}")
execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" ${NVCC_OPTION} "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" ${NVCC_OPTION} "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
@ -111,7 +111,7 @@ if(CUDA_FOUND)
set(${result_list} "${${result_list}} ${target_arch}") set(${result_list} "${${result_list}} ${target_arch}")
endif() endif()
endforeach() endforeach()
string(STRIP ${${result_list}} ${result_list}) string(STRIP "${${result_list}}" ${result_list})
set(CUDA_SUPPORTED_CC ${${result_list}} CACHE INTERNAL "List of supported compute capability") set(CUDA_SUPPORTED_CC ${${result_list}} CACHE INTERNAL "List of supported compute capability")
endif() endif()
endmacro() endmacro()
@ -124,7 +124,7 @@ if(CUDA_FOUND)
endmacro() endmacro()
macro(ocv_wipeout_deprecated _arch_bin_list) macro(ocv_wipeout_deprecated _arch_bin_list)
string(REPLACE "2.1" "2.1(2.0)" ${_arch_bin_list} ${${_arch_bin_list}}) string(REPLACE "2.1" "2.1(2.0)" ${_arch_bin_list} "${${_arch_bin_list}}")
endmacro() endmacro()
set(__cuda_arch_ptx "") set(__cuda_arch_ptx "")

Loading…
Cancel
Save