File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -88,15 +88,24 @@ if(CUDA_FOUND)
88
88
set (__cuda_arch_bin "3.2" )
89
89
set (__cuda_arch_ptx "" )
90
90
elseif (AARCH64 )
91
- set (__cuda_arch_bin "5.3" )
91
+ execute_process ( COMMAND "${CUDA_NVCC_EXECUTABLE} " "${OpenCV_SOURCE_DIR} /cmake/checks/OpenCVDetectCudaArch.cu" "--run"
92
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY} /CMakeTmp/"
93
+ RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
94
+ ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE )
95
+ if (NOT _nvcc_res EQUAL 0 )
96
+ message (STATUS "Automatic detection of CUDA generation failed. Going to build for all known architectures." )
97
+ set (__cuda_arch_bin "5.3 6.2" )
98
+ else ()
99
+ set (__cuda_arch_bin "${_nvcc_out} " )
100
+ string (REPLACE "2.1" "2.1(2.0)" __cuda_arch_bin "${__cuda_arch_bin} " )
101
+ endif ()
92
102
set (__cuda_arch_ptx "" )
93
103
else ()
94
104
if (${CUDA_VERSION} VERSION_LESS "8.0" )
95
105
set (__cuda_arch_bin "2.0 3.0 3.5 3.7 5.0 5.2" )
96
106
else ()
97
107
set (__cuda_arch_bin "2.0 3.0 3.5 3.7 5.0 5.2 6.0 6.1" )
98
108
endif ()
99
- set (__cuda_arch_ptx "" )
100
109
endif ()
101
110
endif ()
102
111
You can’t perform that action at this time.
0 commit comments