Skip to content

Commit c770d5c

Browse files
author
Yancey
authored
fix build error with testing and gpu on (#10932)
1 parent cd8700f commit c770d5c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

paddle/fluid/operators/detail/sendrecvop_utils.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,14 @@ void SerializeToByteBuffer(const std::string& name, framework::Variable* var,
149149
}
150150

151151
if (platform::is_gpu_place(ctx.GetPlace())) {
152+
#ifdef PADDLE_WITH_CUDA
152153
// GPU data is copied to CPU buffer when sending,
153154
// free the buffer when possible.
154155
destroy_callback = [](void* backing) {
155156
platform::CUDAPinnedPlace cuda_pinned;
156157
memory::Free(cuda_pinned, backing);
157158
};
159+
#endif
158160
}
159161

160162
std::string header;

0 commit comments

Comments
 (0)