Skip to content

Commit

Permalink
fix OrtValue Release condition (microsoft#1182)
Browse files Browse the repository at this point in the history
CUDAFence::CanRelease should also check wirte_event_
  • Loading branch information
yufenglee authored Jun 22, 2019
1 parent 204bd38 commit 2bfbcd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion onnxruntime/core/providers/cuda/cuda_fence.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2bfbcd3

Please sign in to comment.