Skip to content

Commit

Permalink
make selected_row not depends on fluid (PaddlePaddle#44835)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiu authored Aug 3, 2022
1 parent 3b32835 commit 5eaa55d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion paddle/phi/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions paddle/phi/core/selected_rows_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ struct TensorCopyVisitor {
void apply() const {
// TODO(Yancey1989): support other place
phi::CPUPlace cpu;
paddle::memory::Copy(cpu,
dst_->mutable_data<T>(cpu) + dst_offset_,
cpu,
src_.data<T>() + src_offset_,
size_ * sizeof(T));
std::memcpy(dst_->mutable_data<T>(cpu) + dst_offset_,
src_.data<T>() + src_offset_,
size_ * sizeof(T));
}

phi::DenseTensor* dst_;
Expand Down

0 comments on commit 5eaa55d

Please sign in to comment.