Skip to content

Commit

Permalink
Fixed bug to assign correct cuda ARCH when using ALL and running only…
Browse files Browse the repository at this point in the history
… single cmake command. (also added Turing to arch)
  • Loading branch information
skokec committed Mar 26, 2019
1 parent 7802d5f commit 9c262f2
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions cmake/Cuda.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
# Known NVIDIA GPU achitectures DAUConvNet can be compiled for.
# This list will be used for CUDA_ARCH_NAME = All option
if ("${CUDA_VERSION}" VERSION_GREATER "10.0" OR "${CUDA_VERSION}" VERSION_EQUAL "10.0")
set(cuda_known_gpu_archs "50 60 61 70 75")
elseif ("${CUDA_VERSION}" VERSION_GREATER "9.0" OR "${CUDA_VERSION}" VERSION_EQUAL "9.0")
set(cuda_known_gpu_archs "50 60 61 70")
elseif ("${CUDA_VERSION}" VERSION_GREATER "8.0" OR "${CUDA_VERSION}" VERSION_EQUAL "8.0")
set(cuda_known_gpu_archs "50 60 61")
else()
set(cuda_known_gpu_archs "50")
endif()

################################################################################################
# A function for automatic detection of GPUs installed (if autodetection is enabled)
# Usage:
Expand Down Expand Up @@ -60,7 +48,7 @@ endfunction()
# dau_conv_cuda_select_nvcc_arch_flags(out_variable)
function(dau_conv_cuda_select_nvcc_arch_flags out_variable)
# List of arch names
set(__archs_names "Maxwell" "Pascal" "Volta" "All" "Manual")
set(__archs_names "Maxwell" "Pascal" "Volta" "Turing" "All" "Manual")
set(__archs_name_default "All")
if(NOT CMAKE_CROSSCOMPILING)
list(APPEND __archs_names "Auto")
Expand Down Expand Up @@ -178,6 +166,19 @@ endmacro()
find_package(CUDA 5.5 QUIET)
find_cuda_helper_libs(curand) # cmake 2.8.7 compartibility which doesn't search for curand

# Known NVIDIA GPU achitectures DAUConvNet can be compiled for.
# This list will be used for CUDA_ARCH_NAME = All option
if ("${CUDA_VERSION}" VERSION_GREATER "10.0" OR "${CUDA_VERSION}" VERSION_EQUAL "10.0")
set(cuda_known_gpu_archs "50 60 61 70 75")
elseif ("${CUDA_VERSION}" VERSION_GREATER "9.0" OR "${CUDA_VERSION}" VERSION_EQUAL "9.0")
set(cuda_known_gpu_archs "50 60 61 70")
elseif ("${CUDA_VERSION}" VERSION_GREATER "8.0" OR "${CUDA_VERSION}" VERSION_EQUAL "8.0")
set(cuda_known_gpu_archs "50 60 61")
else()
set(cuda_known_gpu_archs "50")
endif()


if(NOT CUDA_FOUND)
return()
endif()
Expand Down

0 comments on commit 9c262f2

Please sign in to comment.