@@ -78,7 +78,12 @@ if(CUDA_FOUND)
78
78
79
79
message (STATUS "CUDA detected: " ${CUDA_VERSION} )
80
80
81
- set (_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta" "Turing" "Ampere" )
81
+ OCV_OPTION (CUDA_ENABLE_DEPRECATED_GENERATION "Enable deprecated generations in the list" OFF )
82
+ set (_generations "Maxwell" "Pascal" "Volta" "Turing" "Ampere" )
83
+ if (CUDA_ENABLE_DEPRECATED_GENERATION )
84
+ set (_generations "Fermi" "${_generations} " )
85
+ set (_generations "Kepler" "${_generations} " )
86
+ endif ()
82
87
set (_arch_fermi "2.0" )
83
88
set (_arch_kepler "3.0;3.5;3.7" )
84
89
set (_arch_maxwell "5.0;5.2" )
@@ -199,10 +204,6 @@ if(CUDA_FOUND)
199
204
endif ()
200
205
endmacro ()
201
206
202
- macro (ocv_wipeout_deprecated _arch_bin_list )
203
- string (REPLACE "2.1" "2.1(2.0)" ${_arch_bin_list} "${${_arch_bin_list} }" )
204
- endmacro ()
205
-
206
207
set (__cuda_arch_ptx "" )
207
208
if (CUDA_GENERATION STREQUAL "Fermi" )
208
209
set (__cuda_arch_bin ${_arch_fermi} )
@@ -265,18 +266,21 @@ if(CUDA_FOUND)
265
266
)
266
267
endif ()
267
268
endif ()
268
- ocv_wipeout_deprecated (__cuda_arch_bin )
269
269
270
270
set (CUDA_ARCH_BIN ${__cuda_arch_bin} CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported" )
271
271
set (CUDA_ARCH_PTX ${__cuda_arch_ptx} CACHE STRING "Specify 'virtual' PTX architectures to build PTX intermediate code for" )
272
272
273
273
string (REGEX REPLACE "\\ ." "" ARCH_BIN_NO_POINTS "${CUDA_ARCH_BIN} " )
274
274
string (REGEX REPLACE "\\ ." "" ARCH_PTX_NO_POINTS "${CUDA_ARCH_PTX} " )
275
275
276
- # Check if user specified 1.0 compute capability: we don't support it
277
- if (" ${CUDA_ARCH_BIN} ${CUDA_ARCH_PTX} " MATCHES " 1.0" )
278
- message (SEND_ERROR "CUDA: 1.0 compute capability is not supported - exclude it from ARCH/PTX list are re-run CMake" )
279
- endif ()
276
+ # Check if user specified 1.0/2.1 compute capability: we don't support it
277
+ macro (ocv_wipeout_deprecated_cc target_cc )
278
+ if (" ${CUDA_ARCH_BIN} ${CUDA_ARCH_PTX} " MATCHES " ${target_cc} " )
279
+ message (SEND_ERROR "CUDA: ${target_cc} compute capability is not supported - exclude it from ARCH/PTX list and re-run CMake" )
280
+ endif ()
281
+ endmacro ()
282
+ ocv_wipeout_deprecated_cc ("1.0" )
283
+ ocv_wipeout_deprecated_cc ("2.1" )
280
284
281
285
# NVCC flags to be set
282
286
set (NVCC_FLAGS_EXTRA "" )
0 commit comments