未验证 提交 45073b7c 编写于 作者: Q qingqing01 提交者: GitHub

Always synchronize when copy data on GPU from C++ to Numpy array. (#9110)

上级 d284cf88
......@@ -72,6 +72,7 @@ struct CastToPyBufferImpl<true, I, ARGS...> {
paddle::platform::GpuMemcpyAsync(
dst_ptr, src_ptr, sizeof(CUR_TYPE) * tensor.numel(),
cudaMemcpyDeviceToHost, dev_ctx->stream());
dev_ctx->Wait();
#else
PADDLE_THROW("'CUDAPlace' is not supported in CPU only device.");
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册