diff --git a/CMakeLists.txt b/CMakeLists.txt index bdd81dba1da..d7faed5ef3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,8 +124,10 @@ endif() find_package(CUDA) if(CUDA_FOUND) + set(CUDA_CAPABILITY 50 CACHE STRING "CUDA capability without '.'") set(CUDA_PROPAGATE_HOST_FLAGS ON) set(KALDI_CUDA_NVCC_FLAGS "--default-stream=per-thread;-std=c++${CMAKE_CXX_STANDARD}") + list(APPEND KALDI_CUDA_NVCC_FLAGS "-gencode arch=compute_${CUDA_CAPABILITY},code=sm_${CUDA_CAPABILITY}") if(MSVC) list(APPEND KALDI_CUDA_NVCC_FLAGS "-Xcompiler /permissive-,/FS,/wd4819,/EHsc,/bigobj") list(APPEND KALDI_CUDA_NVCC_FLAGS "-Xcompiler /wd4018,/wd4244,/wd4267,/wd4291,/wd4305")