forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
infer_request.hpp
66 lines (48 loc) · 2.49 KB
/
infer_request.hpp
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (C) 2018-2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <ie_common.h>
#include <cpp_interfaces/interface/ie_iexecutable_network_internal.hpp>
#include <cpp_interfaces/interface/ie_iinfer_request_internal.hpp>
#include <map>
#include <memory>
#include <openvino/itt.hpp>
#include <string>
#include <unordered_map>
#include <vector>
namespace HeteroPlugin {
class HeteroInferRequest : public InferenceEngine::IInferRequestInternal {
public:
typedef std::shared_ptr<HeteroInferRequest> Ptr;
struct SubRequestDesc {
InferenceEngine::SoExecutableNetworkInternal _network;
InferenceEngine::SoIInferRequestInternal _request;
openvino::itt::handle_t _profilingTask;
};
using SubRequestsList = std::vector<SubRequestDesc>;
HeteroInferRequest(InferenceEngine::InputsDataMap networkInputs,
InferenceEngine::OutputsDataMap networkOutputs,
const SubRequestsList& inferRequests,
const std::unordered_map<std::string, std::string>& blobNameMap);
HeteroInferRequest(const std::vector<std::shared_ptr<const ov::Node>>& networkInputs,
const std::vector<std::shared_ptr<const ov::Node>>& networkOutputs,
const SubRequestsList& inferRequests,
const std::unordered_map<std::string, std::string>& blobNameMap);
void InferImpl() override;
void SetBlob(const std::string& name, const InferenceEngine::Blob::Ptr& blob) override;
InferenceEngine::Blob::Ptr GetBlob(const std::string& name) override;
void SetBlob(const std::string& name,
const InferenceEngine::Blob::Ptr& blob,
const InferenceEngine::PreProcessInfo& info) override;
const InferenceEngine::PreProcessInfo& GetPreProcess(const std::string& name) const override;
std::vector<std::shared_ptr<InferenceEngine::IVariableStateInternal>> QueryState() override;
std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> GetPerformanceCounts() const override;
SubRequestsList _inferRequests;
std::map<std::string, InferenceEngine::Blob::Ptr> _blobs;
std::map<std::string, InferenceEngine::SoIInferRequestInternal> _subRequestFromBlobName;
private:
void CreateInferRequest(const std::unordered_map<std::string, std::string>& subgraphInputToOutputBlobNames);
std::vector<std::shared_ptr<InferenceEngine::IVariableStateInternal>> memoryStates;
};
} // namespace HeteroPlugin