Skip to content

Commit

Permalink
Merge pull request opencv#23062 from cudawarped:cuda_add_lovelace_hopper
Browse files Browse the repository at this point in the history
CUDA: add Ada Lovelace and Hopper CC
  • Loading branch information
asmorkalov authored Jan 9, 2023
2 parents fdf2151 + 927aa1e commit b16a4ba
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions cmake/OpenCVDetectCUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,20 @@ if(CUDA_FOUND)
message(STATUS "CUDA detected: " ${CUDA_VERSION})

OCV_OPTION(CUDA_ENABLE_DEPRECATED_GENERATION "Enable deprecated generations in the list" OFF)
set(_generations "Maxwell" "Pascal" "Volta" "Turing" "Ampere")
set(_generations "Maxwell" "Pascal" "Volta" "Turing" "Ampere" "Lovelace" "Hopper")
if(CUDA_ENABLE_DEPRECATED_GENERATION)
set(_generations "Fermi" "${_generations}")
set(_generations "Kepler" "${_generations}")
endif()
set(_arch_fermi "2.0")
set(_arch_kepler "3.0;3.5;3.7")
set(_arch_maxwell "5.0;5.2")
set(_arch_pascal "6.0;6.1")
set(_arch_volta "7.0")
set(_arch_turing "7.5")
set(_arch_ampere "8.0;8.6")
set(_arch_fermi "2.0")
set(_arch_kepler "3.0;3.5;3.7")
set(_arch_maxwell "5.0;5.2")
set(_arch_pascal "6.0;6.1")
set(_arch_volta "7.0")
set(_arch_turing "7.5")
set(_arch_ampere "8.0;8.6")
set(_arch_lovelace "8.9")
set(_arch_hopper "9.0")
if(NOT CMAKE_CROSSCOMPILING)
list(APPEND _generations "Auto")
endif()
Expand Down Expand Up @@ -241,6 +243,10 @@ if(CUDA_FOUND)
set(__cuda_arch_bin ${_arch_turing})
elseif(CUDA_GENERATION STREQUAL "Ampere")
set(__cuda_arch_bin ${_arch_ampere})
elseif(CUDA_GENERATION STREQUAL "Lovelace")
set(__cuda_arch_bin ${_arch_lovelace})
elseif(CUDA_GENERATION STREQUAL "Hopper")
set(__cuda_arch_bin ${_arch_hopper})
elseif(CUDA_GENERATION STREQUAL "Auto")
ocv_detect_native_cuda_arch(_nvcc_res _nvcc_out)
if(NOT _nvcc_res EQUAL 0)
Expand Down Expand Up @@ -286,6 +292,8 @@ if(CUDA_FOUND)
${_arch_volta}
${_arch_turing}
${_arch_ampere}
${_arch_lovelace}
${_arch_hopper}
)
endif()
endif()
Expand Down

0 comments on commit b16a4ba

Please sign in to comment.