File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
onnxruntime/core/providers/openvino Expand file tree Collapse file tree 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) {
761761 try {
762762 StartAsyncInference (context, infer_request);
763763 } catch (const std::runtime_error& e) {
764+ inferRequestsQueue_->putIdleRequest (std::move (infer_request));
764765 ORT_THROW (log_tag + " Exception at StartAsyncInference: " + e.what ());
765766 }
766767#endif
767768 try {
768769 CompleteAsyncInference (context, infer_request);
769770 } catch (const std::runtime_error& e) {
771+ inferRequestsQueue_->putIdleRequest (std::move (infer_request));
770772 ORT_THROW (log_tag + " Exception at CompleteAsyncInference: " + e.what ());
771773 }
772774
Original file line number Diff line number Diff line change @@ -380,29 +380,29 @@ void OVInferRequest::StartAsync() {
380380 try {
381381 ovInfReq.start_async ();
382382 } 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 ());
384384 } 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" );
386386 }
387387}
388388
389389void OVInferRequest::Infer () {
390390 try {
391391 ovInfReq.infer ();
392392 } 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 ());
394394 } 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" );
396396 }
397397}
398398
399399void OVInferRequest::WaitRequest () {
400400 try {
401401 ovInfReq.wait ();
402402 } 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 ());
404404 } catch (...) {
405- ORT_THROW (log_tag + " Wait Mode Failed" );
405+ throw std::runtime_error (log_tag + " Wait Mode Failed" );
406406 }
407407}
408408
You can’t perform that action at this time.
0 commit comments