From c1133028261b5da35ff6e23279c18d3be4e6a046 Mon Sep 17 00:00:00 2001 From: Zhaolong Xing Date: Sun, 12 Apr 2020 19:10:26 +0800 Subject: [PATCH] fix cuda9, volta, turing compile error (#23730) --- cmake/cuda.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/cuda.cmake b/cmake/cuda.cmake index 1719164a7fd..514937f760d 100644 --- a/cmake/cuda.cmake +++ b/cmake/cuda.cmake @@ -101,10 +101,14 @@ function(select_nvcc_arch_flags out_variable) elseif(${CUDA_ARCH_NAME} STREQUAL "Pascal") set(cuda_arch_bin "60 61") elseif(${CUDA_ARCH_NAME} STREQUAL "Volta") - add_definitions("-DSUPPORTS_CUDA_FP16") + if (NOT ${CUDA_VERSION} LESS 10.0) + add_definitions("-DSUPPORTS_CUDA_FP16") + endif() set(cuda_arch_bin "70") elseif(${CUDA_ARCH_NAME} STREQUAL "Turing") - add_definitions("-DSUPPORTS_CUDA_FP16") + if (NOT ${CUDA_VERSION} LESS 10.0) + add_definitions("-DSUPPORTS_CUDA_FP16") + endif() set(cuda_arch_bin "75") elseif(${CUDA_ARCH_NAME} STREQUAL "All") set(cuda_arch_bin ${paddle_known_gpu_archs}) -- GitLab