return device infer request in passthrough mode (#11253)
Signed-off-by: fishbell <bell.song@intel.com>
This commit is contained in:
parent
4145291e84
commit
f6e5ec9684
@ -91,6 +91,8 @@ MultiDeviceExecutableNetwork::MultiDeviceExecutableNetwork(const DeviceMap<Infer
|
|||||||
auto& network = networkValue.second;
|
auto& network = networkValue.second;
|
||||||
GenerateWorkers(device, network);
|
GenerateWorkers(device, network);
|
||||||
}
|
}
|
||||||
|
if (_networksPerDevice.size() == 1)
|
||||||
|
_passthroughExeNet = _networksPerDevice.begin()->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultiDeviceExecutableNetwork::GenerateWorkers(const std::string& device, const SoExecutableNetworkInternal& executableNetwork) {
|
void MultiDeviceExecutableNetwork::GenerateWorkers(const std::string& device, const SoExecutableNetworkInternal& executableNetwork) {
|
||||||
@ -328,6 +330,7 @@ MultiDeviceExecutableNetwork::MultiDeviceExecutableNetwork(const std::string&
|
|||||||
} else {
|
} else {
|
||||||
// only one device need to load network, do not need to load it async
|
// only one device need to load network, do not need to load it async
|
||||||
_loadContext[ACTUALDEVICE].task();
|
_loadContext[ACTUALDEVICE].task();
|
||||||
|
_passthroughExeNet = _loadContext[ACTUALDEVICE].executableNetwork;
|
||||||
}
|
}
|
||||||
WaitFirstNetworkReady();
|
WaitFirstNetworkReady();
|
||||||
}
|
}
|
||||||
@ -706,6 +709,11 @@ InferenceEngine::IInferRequestInternal::Ptr MultiDeviceExecutableNetwork::Create
|
|||||||
}
|
}
|
||||||
|
|
||||||
IInferRequestInternal::Ptr MultiDeviceExecutableNetwork::CreateInferRequest() {
|
IInferRequestInternal::Ptr MultiDeviceExecutableNetwork::CreateInferRequest() {
|
||||||
|
if (_passthroughExeNet) {
|
||||||
|
auto res = _passthroughExeNet->CreateInferRequest();
|
||||||
|
res->setPointerToExecutableNetworkInternal(shared_from_this());
|
||||||
|
return res;
|
||||||
|
}
|
||||||
IInferRequestInternal::Ptr syncRequestImpl;
|
IInferRequestInternal::Ptr syncRequestImpl;
|
||||||
if (this->_plugin) {
|
if (this->_plugin) {
|
||||||
const auto& core = _plugin->GetCore();
|
const auto& core = _plugin->GetCore();
|
||||||
|
@ -165,6 +165,7 @@ private:
|
|||||||
unsigned int _cpuHelpInferCount = 0;
|
unsigned int _cpuHelpInferCount = 0;
|
||||||
double _cpuHelpFps = 0.0;
|
double _cpuHelpFps = 0.0;
|
||||||
Time _cpuHelpReleaseTime;
|
Time _cpuHelpReleaseTime;
|
||||||
|
InferenceEngine::SoExecutableNetworkInternal _passthroughExeNet;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace MultiDevicePlugin
|
} // namespace MultiDevicePlugin
|
||||||
|
Loading…
Reference in New Issue
Block a user