diff --git a/paddle/phi/core/CMakeLists.txt b/paddle/phi/core/CMakeLists.txt index b119dd3c5366047981d5315161d6810606f135b1..099cc87834cc6cdef770a71add9a4c795a760536 100644 --- a/paddle/phi/core/CMakeLists.txt +++ b/paddle/phi/core/CMakeLists.txt @@ -65,7 +65,7 @@ cc_library( cc_library( selected_rows SRCS selected_rows_impl.cc selected_rows.cc - DEPS tensor_base dense_tensor phi_enforce ddim memcpy) + DEPS tensor_base dense_tensor phi_enforce ddim) cc_library( phi_device_context SRCS device_context.cc diff --git a/paddle/phi/core/selected_rows_impl.cc b/paddle/phi/core/selected_rows_impl.cc index 7e5fd51343a09aa4ae974ad30f3265169489862c..a5a121cd60b27da69c13480f2caf2f9ccfc30b74 100644 --- a/paddle/phi/core/selected_rows_impl.cc +++ b/paddle/phi/core/selected_rows_impl.cc @@ -58,11 +58,9 @@ struct TensorCopyVisitor { void apply() const { // TODO(Yancey1989): support other place phi::CPUPlace cpu; - paddle::memory::Copy(cpu, - dst_->mutable_data(cpu) + dst_offset_, - cpu, - src_.data() + src_offset_, - size_ * sizeof(T)); + std::memcpy(dst_->mutable_data(cpu) + dst_offset_, + src_.data() + src_offset_, + size_ * sizeof(T)); } phi::DenseTensor* dst_;