diff --git a/paddle/fluid/inference/tensorrt/plugin/gelu_op_plugin.cu b/paddle/fluid/inference/tensorrt/plugin/gelu_op_plugin.cu index 6a718d47b1542b3cce97f6ff1f8744b4d58a8102..f94da83b9084f39df2998d07f142a9eada265053 100644 --- a/paddle/fluid/inference/tensorrt/plugin/gelu_op_plugin.cu +++ b/paddle/fluid/inference/tensorrt/plugin/gelu_op_plugin.cu @@ -63,7 +63,7 @@ __global__ void gelu_kernel(const T a, int n, const T* input, T* output) { const int idx = blockIdx.x * TPB + threadIdx.x; if (idx < n) { const T in = input[idx]; - const T cdf = 0.5 * (1.0 + erf(in * 0.5 * a)); + const T cdf = 0.5f * (1.0f + erff(in * 0.5f * a)); output[idx] = in * cdf; } }