提交 2fe39f8c 编写于 作者: L liaogang 提交者: Yu Yang

modify flags.cmake to support modern gpu arch

Change-Id: Ie237127bb0f537998827ab29ffde2526c21c6dd1
上级 eb26ebf9
......@@ -76,7 +76,7 @@ endforeach()
function(specify_cuda_arch cuda_version cuda_arch)
if(${cuda_version} VERSION_GREATER "8.0")
foreach(capability 60 61 62)
foreach(capability 61 62)
if(${cuda_arch} STREQUAL ${capability})
list(APPEND __arch_flags " -gencode arch=compute_${cuda_arch},code=sm_${cuda_arch}")
endif()
......@@ -90,12 +90,17 @@ function(specify_cuda_arch cuda_version cuda_arch)
endif()
endfunction()
# Common cuda architectures
# Common gpu architectures: Kepler, Maxwell
foreach(capability 30 35 50)
list(APPEND __arch_flags " -gencode arch=compute_${capability},code=sm_${capability}")
endforeach()
# Custom cuda architecture
# Modern gpu architectures: Pascal
if (CUDA_VERSION VERSION_GREATER "8.0")
list(APPEND __arch_flags " -gencode arch=compute_60,code=sm_60")
endif()
# Custom gpu architecture
set(CUDA_ARCH)
if(CUDA_ARCH)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册