File tree 2 files changed +8
-6
lines changed
onnxruntime/core/providers/openvino
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -761,12 +761,14 @@ void BasicBackend::Infer(OrtKernelContext* ctx) {
761
761
try {
762
762
StartAsyncInference (context, infer_request);
763
763
} catch (const std::runtime_error& e) {
764
+ inferRequestsQueue_->putIdleRequest (std::move (infer_request));
764
765
ORT_THROW (log_tag + " Exception at StartAsyncInference: " + e.what ());
765
766
}
766
767
#endif
767
768
try {
768
769
CompleteAsyncInference (context, infer_request);
769
770
} catch (const std::runtime_error& e) {
771
+ inferRequestsQueue_->putIdleRequest (std::move (infer_request));
770
772
ORT_THROW (log_tag + " Exception at CompleteAsyncInference: " + e.what ());
771
773
}
772
774
Original file line number Diff line number Diff line change @@ -380,29 +380,29 @@ void OVInferRequest::StartAsync() {
380
380
try {
381
381
ovInfReq.start_async ();
382
382
} catch (const Exception& e) {
383
- ORT_THROW (log_tag + " Couldn't start Inference: " + e.what ());
383
+ throw std::runtime_error (log_tag + " Couldn't start Inference: " + e.what ());
384
384
} catch (...) {
385
- ORT_THROW (log_tag + " In Error Couldn't start Inference" );
385
+ throw std::runtime_error (log_tag + " In Error Couldn't start Inference" );
386
386
}
387
387
}
388
388
389
389
void OVInferRequest::Infer () {
390
390
try {
391
391
ovInfReq.infer ();
392
392
} catch (const Exception& e) {
393
- ORT_THROW (log_tag + " Couldn't start Inference: " + e.what ());
393
+ throw std::runtime_error (log_tag + " Couldn't start Inference: " + e.what ());
394
394
} catch (...) {
395
- ORT_THROW (log_tag + " In Error Couldn't start Inference" );
395
+ throw std::runtime_error (log_tag + " In Error Couldn't start Inference" );
396
396
}
397
397
}
398
398
399
399
void OVInferRequest::WaitRequest () {
400
400
try {
401
401
ovInfReq.wait ();
402
402
} catch (const Exception& e) {
403
- ORT_THROW (log_tag + " Wait Model Failed: " + e.what ());
403
+ throw std::runtime_error (log_tag + " Wait Model Failed: " + e.what ());
404
404
} catch (...) {
405
- ORT_THROW (log_tag + " Wait Mode Failed" );
405
+ throw std::runtime_error (log_tag + " Wait Mode Failed" );
406
406
}
407
407
}
408
408
You can’t perform that action at this time.
0 commit comments