This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexecutable_network.cpp
49 lines (41 loc) · 1.6 KB
/
executable_network.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
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (C) 2018-2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "executable_network.hpp"
// ------------------------------ExecutableNetwork----------------------------
namespace MultiDevicePlugin {
using namespace InferenceEngine;
ExecutableNetwork::ExecutableNetwork(const Schedule::Ptr& schedule,
const ScheduleContext::Ptr& sContext):
_schedule(schedule),
_sContext(sContext) {
_schedule->init(_sContext);
}
ExecutableNetwork::~ExecutableNetwork() {
}
IInferPtr ExecutableNetwork::CreateInferRequestImpl(
const std::vector<std::shared_ptr<const ov::Node>>& inputs,
const std::vector<std::shared_ptr<const ov::Node>>& outputs) {
return _schedule->CreateInferRequestImpl(inputs, outputs);
}
IInferPtr ExecutableNetwork::CreateInferRequestImpl(
InferenceEngine::InputsDataMap networkInputs,
InferenceEngine::OutputsDataMap networkOutputs) {
return _schedule->CreateInferRequestImpl(networkInputs, networkOutputs);
}
IInferRequestInternal::Ptr ExecutableNetwork::CreateInferRequest() {
SetExeNetworkForContext();
return _schedule->CreateInferRequest();
}
void ExecutableNetwork::SetExeNetworkForContext() {
// Maybe different API will call this function, so add call once here
// for every AutoSchedule instance
std::call_once(_oc, [this]() {
_sContext->_executableNetwork = shared_from_this();
});
}
std::string ExecutableNetwork::GetLogTag() const noexcept {
return _sContext->_LogTag;
}
} // namespace MultiDevicePlugin