diff --git a/paddle/phi/kernels/funcs/elementwise_base.h b/paddle/phi/kernels/funcs/elementwise_base.h index daaf88a23950fb6f1bb9876e84e26c728a119f36..3e68462c88a5cb605a0153917780fbb3b6f728a5 100644 --- a/paddle/phi/kernels/funcs/elementwise_base.h +++ b/paddle/phi/kernels/funcs/elementwise_base.h @@ -768,7 +768,7 @@ __global__ void VectorizedElementwiseKernel( ins, outs, data_offset, read_lens * BLOCK_NUM_X, read_lens, func); } - int remain = numel - data_offset; + kps::IndexType remain = numel - data_offset; if (remain > 0) { VectorizedElementwiseKernelImpl( - ins, outs, data_offset, remain, read_lens, func); + ins, outs, data_offset, static_cast(remain), read_lens, func); } }