Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug of cuda-11 compilation #390

Merged
merged 1 commit into from
Mar 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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