diff --git a/cmake/cuda.cmake b/cmake/cuda.cmake index 1719164a7fd4f70962b3c81179b619f3ddf7a928..514937f760d4178287dcd6619c2b5ea00046f677 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})