fix build error with testing and gpu on (#10932)

shanyi15-patch-3
Yancey 7 years ago committed by GitHub
parent cd8700f172
commit c770d5c0ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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;

Loading…
Cancel
Save