forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasync_infer_request.cpp
31 lines (27 loc) · 1.4 KB
/
async_infer_request.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (C) 2018-2025 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "async_infer_request.hpp"
ov::auto_plugin::AsyncInferRequest::AsyncInferRequest(const Schedule::Ptr& schedule,
const std::shared_ptr<ov::auto_plugin::InferRequest>& request,
const std::shared_ptr<ov::threading::ITaskExecutor>& callback_executor) :
IAsyncInferRequest(request, nullptr, callback_executor),
m_schedule(schedule),
m_inferrequest(request) {
auto pipeline = m_schedule->get_async_pipeline(m_inferrequest, &m_worker_inferrequest);
if (pipeline.size() > 0) {
m_pipeline = std::move(pipeline);
}
}
std::vector<ov::ProfilingInfo> ov::auto_plugin::AsyncInferRequest::get_profiling_info() const {
check_state();
auto scheduled_request = std::dynamic_pointer_cast<InferRequest>(m_inferrequest);
return scheduled_request->get_profiling_info();
}
void ov::auto_plugin::AsyncInferRequest::infer_thread_unsafe() {
start_async_thread_unsafe();
}
ov::auto_plugin::AsyncInferRequest::~AsyncInferRequest() {
stop_and_wait();
}