From 0617a3edeeef830498cb373e0adc64343d3c2f5e Mon Sep 17 00:00:00 2001 From: sneaxiy <32832641+sneaxiy@users.noreply.github.com> Date: Thu, 20 Jan 2022 00:14:53 +0800 Subject: [PATCH] fix gelu compile on CUDA 10 (#39045) --- paddle/fluid/operators/gelu_op.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/operators/gelu_op.cu b/paddle/fluid/operators/gelu_op.cu index da7ed05ddf..17f74464a8 100644 --- a/paddle/fluid/operators/gelu_op.cu +++ b/paddle/fluid/operators/gelu_op.cu @@ -24,7 +24,7 @@ namespace operators { #ifdef __NVCC__ template static __device__ __forceinline__ float FP32FastTanh(float x) { -#if __CUDA_ARCH__ >= 750 && !defined(_WIN32) +#if __CUDA_ARCH__ >= 750 && CUDA_VERSION >= 11000 && !defined(_WIN32) if (FastMode) { float y; asm("tanh.approx.f32 %0,%1; \n\t" : "=f"(y) : "f"(x)); -- GitLab