fix OrtValue Release condition (#1182)

CUDAFence::CanRelease should also check wirte_event_
This commit is contained in:
Yufeng Li 2019-06-22 11:29:23 -07:00 committed by GitHub
parent 204bd38d6a
commit 2bfbcd323a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,7 +43,8 @@ void CUDAFence::BeforeUsingAsOutput(onnxruntime::ProviderType provider_type, int
}
bool CUDAFence::CanRelease() {
return cudaEventQuery(read_event_) == cudaSuccess;
return cudaEventQuery(read_event_) == cudaSuccess &&
cudaEventQuery(write_event_) == cudaSuccess;
}
void CUDAFence::AfterUsedAsInput(int queue_id) {