in caching allocator, ignore and clear the error if not ready

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18584

Differential Revision: D14675041

Pulled By: bddppq

fbshipit-source-id: c1fab797e0d224e0a481a0395a3f9975c4265ff6
This commit is contained in:
Jeff Daily
2019-03-28 17:43:22 -07:00
committed by Facebook Github Bot
parent 600eeecbf4
commit 2f174e9453

View File

@ -554,6 +554,8 @@ struct THCCachingAllocator
cudaError_t err = cudaEventQuery(event);
if (err == cudaErrorNotReady) {
// ignore and clear the error if not ready
cudaGetLastError();
break;
} else if (err != cudaSuccess) {
C10_CUDA_CHECK(err);