未验证 提交 97e76cb9 编写于 作者: Z Zeng Jinle 提交者: GitHub

refine dev_ctx.Wait() exception throw, test=develop (#21600)

上级 1dcf6a72
...@@ -324,16 +324,10 @@ void CUDADeviceContext::Wait() const { ...@@ -324,16 +324,10 @@ void CUDADeviceContext::Wait() const {
} }
#endif #endif
if (cudaSuccess != e_sync) { PADDLE_ENFORCE_CUDA_SUCCESS(
LOG(FATAL) << "cudaStreamSynchronize " << cudaGetErrorString(e_sync) e_sync, platform::errors::Fatal(
<< " errno: " << e_sync; "cudaStreamSynchronize raises error: %s, errono: %d",
} cudaGetErrorString(e_sync), static_cast<int>(e_sync)));
cudaError_t e_get = cudaGetLastError();
if (cudaSuccess != e_get) {
LOG(FATAL) << "cudaGetLastError " << cudaGetErrorString(e_get)
<< " errno: " << e_get;
}
} }
int CUDADeviceContext::GetComputeCapability() const { int CUDADeviceContext::GetComputeCapability() const {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册