Skip to content

Commit

Permalink
fix build error with testing and gpu on (#10932)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yancey committed May 25, 2018
1 parent cd8700f commit c770d5c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions paddle/fluid/operators/detail/sendrecvop_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ void SerializeToByteBuffer(const std::string& name, framework::Variable* var,
}

if (platform::is_gpu_place(ctx.GetPlace())) {
#ifdef PADDLE_WITH_CUDA
// GPU data is copied to CPU buffer when sending,
// free the buffer when possible.
destroy_callback = [](void* backing) {
platform::CUDAPinnedPlace cuda_pinned;
memory::Free(cuda_pinned, backing);
};
#endif
}

std::string header;
Expand Down

0 comments on commit c770d5c

Please sign in to comment.