diff --git a/paddle/phi/kernels/gpu/cast_impl.h b/paddle/phi/kernels/gpu/cast_impl.h index f73d396572541ba4388c5a3421bf37638938271c..c209705a7418ffb0dc785d59aa61e5e62af05ac6 100644 --- a/paddle/phi/kernels/gpu/cast_impl.h +++ b/paddle/phi/kernels/gpu/cast_impl.h @@ -20,7 +20,7 @@ namespace phi { template -struct CastFuctor { +struct CastFunctor { __device__ __forceinline__ OutT operator()(const InT x) const { return static_cast(x); } @@ -36,7 +36,7 @@ void CastCUDAKernelImpl(const GPUContext& dev_ctx, outputs.emplace_back(out); dev_ctx.Alloc(out); phi::funcs::ElementwiseKernel( - dev_ctx, inputs, &outputs, CastFuctor()); + dev_ctx, inputs, &outputs, CastFunctor()); } } // namespace phi diff --git a/paddle/phi/kernels/gpu/full_kernel.cu b/paddle/phi/kernels/gpu/full_kernel.cu index 684e9156609adeb0be27627558ab6f5ba9aca2be..120e908ae8cf7d628ddedfb6e28df43deceed7a1 100644 --- a/paddle/phi/kernels/gpu/full_kernel.cu +++ b/paddle/phi/kernels/gpu/full_kernel.cu @@ -20,11 +20,11 @@ limitations under the License. */ namespace phi { template -struct FullFuctor { +struct FullFunctor { OutT value; template - explicit inline FullFuctor(VType val) { + explicit inline FullFunctor(VType val) { value = static_cast(val); } @@ -50,7 +50,7 @@ void FullKernel(const Context& dev_ctx, // the data will not be loaded in the kernel because the number of // parameters in the operator is 0 phi::funcs::ElementwiseKernel( - dev_ctx, inputs, &outputs, FullFuctor(val.to())); + dev_ctx, inputs, &outputs, FullFunctor(val.to())); } } @@ -104,7 +104,7 @@ void FullLikeKernel(const Context& dev_ctx, int numel = out->numel(); if (numel > 0) { phi::funcs::ElementwiseKernel( - dev_ctx, inputs, &outputs, FullFuctor(value)); + dev_ctx, inputs, &outputs, FullFunctor(value)); } } diff --git a/paddle/phi/kernels/sparse/gpu/full_kernel.cu b/paddle/phi/kernels/sparse/gpu/full_kernel.cu index d5ccfc95c6a00eb128cd67c93e7d4211bedd1479..223561bc17913766c951d106193e39aceecc333e 100644 --- a/paddle/phi/kernels/sparse/gpu/full_kernel.cu +++ b/paddle/phi/kernels/sparse/gpu/full_kernel.cu @@ -23,11 +23,11 @@ limitations under the License. */ namespace phi { template -struct FullFuctor { +struct FullFunctor { OutT value; template - explicit inline FullFuctor(VType val) { + explicit inline FullFunctor(VType val) { value = static_cast(val); } @@ -54,7 +54,7 @@ void CooFullLikeKernel(const Context& dev_ctx, int numel = values->numel(); if (numel > 0) { phi::funcs::ElementwiseKernel( - dev_ctx, inputs, &outputs, FullFuctor(val.to())); + dev_ctx, inputs, &outputs, FullFunctor(val.to())); } out->set_dims(x.dims()); } @@ -80,7 +80,7 @@ void CsrFullLikeKernel(const Context& dev_ctx, int numel = values->numel(); if (numel > 0) { phi::funcs::ElementwiseKernel( - dev_ctx, inputs, &outputs, FullFuctor(val.to())); + dev_ctx, inputs, &outputs, FullFunctor(val.to())); } out->set_dims(x.dims()); }