未验证 提交 8f2b0860 编写于 作者: C chentianyu03 提交者: GitHub

rename TensoCopy (#38036)

上级 513d1f97
...@@ -769,7 +769,7 @@ static void LaunchReduceKernel(const Tx* x_data, ...@@ -769,7 +769,7 @@ static void LaunchReduceKernel(const Tx* x_data,
} }
} }
void TensorCopy(const DenseTensor& src, DenseTensor* dst) { static void AsyncCopy(const DenseTensor& src, DenseTensor* dst) {
paddle::platform::DeviceContextPool& pool = paddle::platform::DeviceContextPool& pool =
paddle::platform::DeviceContextPool::Instance(); paddle::platform::DeviceContextPool::Instance();
const paddle::platform::CUDADeviceContext* dev_ctx; const paddle::platform::CUDADeviceContext* dev_ctx;
...@@ -817,7 +817,7 @@ void TensorReduceFunctorImpl(const pten::DenseTensor& x, ...@@ -817,7 +817,7 @@ void TensorReduceFunctorImpl(const pten::DenseTensor& x,
if (config.reduce_num == 1) { if (config.reduce_num == 1) {
auto out_dims = y->dims(); auto out_dims = y->dims();
if (x.dtype() == y->dtype()) { if (x.dtype() == y->dtype()) {
TensorCopy(x, y); AsyncCopy(x, y);
y->Resize(out_dims); y->Resize(out_dims);
} else { } else {
PD_VISIT_ALL_TYPES(y->dtype(), "CastKernelImpl", ([&] { PD_VISIT_ALL_TYPES(y->dtype(), "CastKernelImpl", ([&] {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册