Merge pull request #17571 from tomoaki0705:fixAutomaticCC

This commit is contained in:
Alexander Alekhin 2020-06-18 07:39:14 +00:00
commit 6bd87e8146

View File

@ -102,7 +102,7 @@ if(CUDA_FOUND)
else()
set(CC_LIST ${ARGN})
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}")
execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" ${NVCC_OPTION} "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
@ -112,7 +112,7 @@ if(CUDA_FOUND)
set(${result_list} "${${result_list}} ${target_arch}")
endif()
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")
endif()
endmacro()
@ -125,7 +125,7 @@ if(CUDA_FOUND)
endmacro()
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()
set(__cuda_arch_ptx "")