From 5eaa55da6ca4f0676f0cc288cafa784d752e75d3 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Wed, 3 Aug 2022 14:27:30 +0800 Subject: [PATCH] make selected_row not depends on fluid (#44835) --- paddle/phi/core/CMakeLists.txt | 2 +- paddle/phi/core/selected_rows_impl.cc | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/paddle/phi/core/CMakeLists.txt b/paddle/phi/core/CMakeLists.txt index b119dd3c53..099cc87834 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 7e5fd51343..a5a121cd60 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_; -- GitLab