From 771a41440f7df77e7ca1b23df23c970b0ae04602 Mon Sep 17 00:00:00 2001 From: sneaxiy <32832641+sneaxiy@users.noreply.github.com> Date: Tue, 19 Apr 2022 10:15:37 +0800 Subject: [PATCH] fix ln (#41918) --- paddle/fluid/operators/layer_norm_kernel.cu.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/layer_norm_kernel.cu.h b/paddle/fluid/operators/layer_norm_kernel.cu.h index c0a4b88fc7..5b5ddddaaf 100644 --- a/paddle/fluid/operators/layer_norm_kernel.cu.h +++ b/paddle/fluid/operators/layer_norm_kernel.cu.h @@ -130,7 +130,9 @@ __forceinline__ __device__ U BlockReduceSum(U val, U *shared) { ##__VA_ARGS__) static __device__ __forceinline__ float real_sqrt(float x) { return sqrtf(x); } -static __device__ __forceinline__ double real_sqrt(double x) { return sqrt(x); } +static __device__ __forceinline__ double real_sqrt(double x) { + return ::sqrt(x); +} template struct PairForLayerNorm { @@ -162,7 +164,7 @@ __inline__ __device__ float rsqrt_(const float val) { template <> __inline__ __device__ double rsqrt_(const double val) { - return rsqrt(val); + return ::rsqrt(val); } #if CUDA_ARCH_FP16_SUPPORTED(__CUDA_ARCH__) -- GitLab