Merge pull request #26920 from ConnorBaker:fix/cmake-matches-uses-regex

cmake/OpenCVDetectCUDAUtils.cmake: use IN_LIST to avoid regex matching valid capabilities
This commit is contained in:
Alexander Smorkalov 2025-02-14 11:54:05 +03:00 committed by GitHub
commit e4b23cf96a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -310,12 +310,12 @@ macro(ocv_set_cuda_arch_bin_and_ptx nvcc_executable)
# Check if user specified 1.0/2.1 compute capability: we don't support it
macro(ocv_wipeout_deprecated_cc target_cc)
if(" ${CUDA_ARCH_BIN} ${CUDA_ARCH_PTX}" MATCHES " ${target_cc}")
if(${target_cc} IN_LIST ARCH_BIN_NO_POINTS OR ${target_cc} IN_LIST ARCH_PTX_NO_POINTS)
message(SEND_ERROR "CUDA: ${target_cc} compute capability is not supported - exclude it from ARCH/PTX list and re-run CMake")
endif()
endmacro()
ocv_wipeout_deprecated_cc("1.0")
ocv_wipeout_deprecated_cc("2.1")
ocv_wipeout_deprecated_cc("10")
ocv_wipeout_deprecated_cc("21")
endmacro()
macro(ocv_set_nvcc_threads_for_vs)