Skip to content

Commit

Permalink
fix bug of cuda-11 compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
denghuilu committed Mar 1, 2021
1 parent fd66059 commit 90938c4
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion source/op/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ include_directories(cub)

message(STATUS "CUDA major version is " ${CUDA_VERSION_MAJOR})

if (${CUDA_VERSION_MAJOR} GREATER "10")
if (${CUDA_VERSION_MAJOR} GREATER "11")
# nvcc flags
set(CUDA_NVCC_FLAGS -gencode arch=compute_60,code=sm_60; # Pascal – GP100/Tesla P100 – DGX-1 (Generic Pascal)
-gencode arch=compute_61,code=sm_61; # Pascal - GTX 1080, GTX 1070, GTX 1060, GTX 1050, GTX 1030, Titan Xp, Tesla P40, Tesla P4, Discrete GPU on the NVIDIA Drive PX2
-gencode arch=compute_70,code=sm_70; # Volta - GV100/Tesla V100, GTX 1180 (GV104)
-gencode arch=compute_75,code=sm_75; # Turing - RTX 2080, Titan RTX, Quadro R8000
-gencode arch=compute_80,code=sm_80; # Anpere - A100
-gencode arch=compute_86,code=sm_86; # Anpere - RTX 3090
-O3; -Xcompiler -fPIC;
)
elseif (${CUDA_VERSION_MAJOR} STREQUAL "11" AND ${CUDA_VERSION_MINOR} GREATER "0")
# nvcc flags
set(CUDA_NVCC_FLAGS -gencode arch=compute_50,code=sm_50;
-gencode arch=compute_52,code=sm_52; # Tesla M40, Tesla M40, Quadro M6000...
Expand All @@ -32,6 +42,18 @@ if (${CUDA_VERSION_MAJOR} GREATER "10")
-gencode arch=compute_86,code=sm_86; # Anpere - RTX 3090
-O3; -Xcompiler -fPIC;
)
elseif (${CUDA_VERSION_MAJOR} STREQUAL "11" AND ${CUDA_VERSION_MINOR} STREQUAL "0")
# nvcc flags
set(CUDA_NVCC_FLAGS -gencode arch=compute_50,code=sm_50;
-gencode arch=compute_52,code=sm_52; # Tesla M40, Tesla M40, Quadro M6000...
-gencode arch=compute_53,code=sm_53;
-gencode arch=compute_60,code=sm_60; # Pascal – GP100/Tesla P100 – DGX-1 (Generic Pascal)
-gencode arch=compute_61,code=sm_61; # Pascal - GTX 1080, GTX 1070, GTX 1060, GTX 1050, GTX 1030, Titan Xp, Tesla P40, Tesla P4, Discrete GPU on the NVIDIA Drive PX2
-gencode arch=compute_70,code=sm_70; # Volta - GV100/Tesla V100, GTX 1180 (GV104)
-gencode arch=compute_75,code=sm_75; # Turing - RTX 2080, Titan RTX, Quadro R8000
-gencode arch=compute_80,code=sm_80; # Anpere - A100
-O3; -Xcompiler -fPIC;
)
elseif (${CUDA_VERSION_MAJOR} STREQUAL "10")
set(CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30; # Tesla K10, Quadro K600 K420 K410,
-gencode arch=compute_35,code=sm_35; # Tesla K20 K40, TITAN Z Black, GTX 780Ti 780
Expand Down

0 comments on commit 90938c4

Please sign in to comment.