forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
async_infer_request.cpp
36 lines (30 loc) · 1.13 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
32
33
34
35
36
// Copyright (C) 2018-2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "async_infer_request.hpp"
namespace MultiDevicePlugin {
AsyncInferRequest::AsyncInferRequest(const Schedule::Ptr& schedule,
const IInferPtr& inferRequest,
const IE::ITaskExecutor::Ptr& callbackExecutor):
AsyncInferRequestThreadSafeDefault(inferRequest, nullptr, callbackExecutor),
_schedule(schedule),
_inferRequest(inferRequest) {
auto pipeline = _schedule->GetPipeline(_inferRequest, &_workerInferRequest);
if (pipeline.size() > 0) {
_pipeline = std::move(pipeline);
}
}
void AsyncInferRequest::Infer_ThreadUnsafe() {
InferUsingAsync();
}
std::map<std::string, IE::InferenceEngineProfileInfo>
AsyncInferRequest::GetPerformanceCounts() const {
CheckState();
auto multiDeviceInfer = std::dynamic_pointer_cast<MultiDeviceInferRequest>(_inferRequest);
return multiDeviceInfer->GetPerformanceCounts();
}
AsyncInferRequest::~AsyncInferRequest() {
StopAndWait();
}
} // namespace MultiDevicePlugin