From 1df0f63b2567a3850b6fe843917602e570cdd232 Mon Sep 17 00:00:00 2001 From: zhiqiu Date: Thu, 29 Jul 2021 03:30:32 +0000 Subject: [PATCH] fix compile --- paddle/fluid/framework/tensor_util.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/tensor_util.cc b/paddle/fluid/framework/tensor_util.cc index 259b14c493e7a..15021b6267b65 100644 --- a/paddle/fluid/framework/tensor_util.cc +++ b/paddle/fluid/framework/tensor_util.cc @@ -118,7 +118,8 @@ void TensorCopy(const Tensor& src, const platform::Place& dst_place, npu_pinned_tensor.Resize(src.dims()); auto npu_pinned_ptr = npu_pinned_tensor.mutable_data(npu_pinned_place, src.type()); - memory::Copy(npu_pinned_place, npu_pinned_ptr, src_place, src_ptr, size); + memory::Copy(npu_pinned_place, npu_pinned_ptr, + BOOST_GET_CONST(platform::CPUPlace, src_place), src_ptr, size); // 2. async copy npu pinned tensor -> npu tensor memory::Copy(