add Ampere CC
authorTomoaki Teshima <tomoaki.teshima@gmail.com>
Fri, 19 Jun 2020 11:46:18 +0000 (20:46 +0900)
committerTomoaki Teshima <tomoaki.teshima@gmail.com>
Fri, 19 Jun 2020 11:46:18 +0000 (20:46 +0900)
  * Ampere has CC 8.0
  * Arm64 server support has been added in CUDA 11 (only V100 for now)

cmake/OpenCVDetectCUDA.cmake

index a0fa192..b63a55c 100644 (file)
@@ -72,13 +72,14 @@ if(CUDA_FOUND)
 
   message(STATUS "CUDA detected: " ${CUDA_VERSION})
 
-  set(_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta" "Turing")
+  set(_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta" "Turing" "Ampere")
   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")
   if(NOT CMAKE_CROSSCOMPILING)
     list(APPEND _generations "Auto")
   endif()
@@ -141,6 +142,8 @@ if(CUDA_FOUND)
     set(__cuda_arch_bin ${_arch_volta})
   elseif(CUDA_GENERATION STREQUAL "Turing")
     set(__cuda_arch_bin ${_arch_turing})
+  elseif(CUDA_GENERATION STREQUAL "Ampere")
+    set(__cuda_arch_bin ${_arch_ampere})
   elseif(CUDA_GENERATION STREQUAL "Auto")
     ocv_detect_native_cuda_arch(_nvcc_res _nvcc_out)
     if(NOT _nvcc_res EQUAL 0)
@@ -158,7 +161,8 @@ if(CUDA_FOUND)
       ocv_detect_native_cuda_arch(_nvcc_res _nvcc_out)
       if(NOT _nvcc_res EQUAL 0)
         message(STATUS "Automatic detection of CUDA generation failed. Going to build for all known architectures.")
-        set(__cuda_arch_bin "5.3 6.2 7.2")
+        # TX1 (5.3) TX2 (6.2) Xavier (7.2) V100 (7.0)
+        set(__cuda_arch_bin "5.3 6.2 7.2 7.0")
       else()
         set(__cuda_arch_bin "${_nvcc_out}")
       endif()
@@ -171,6 +175,7 @@ if(CUDA_FOUND)
           ${_arch_pascal}
           ${_arch_volta}
           ${_arch_turing}
+          ${_arch_ampere}
       )
     endif()
   endif()