Go to the documentation of this file.
20 #include "cpp_interfaces/impl/ie_executable_network_internal.hpp"
33 static inline void parsePluginName(std::istream& networkModel) {
35 auto currentPos = networkModel.tellg();
36 networkModel.read(magic.data(), magic.size());
38 if (exportedWithName) {
39 networkModel.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
41 networkModel.seekg(currentPos, networkModel.beg);
60 const std::map<std::string, std::string>& config)
override {
61 return LoadNetworkImplPrivate(network, config);
66 return LoadNetworkImplPrivate(network, config, context);;
70 const std::map<std::string, std::string>& config)
override {
77 const std::map<std::string, std::string>& config)
override {
78 parsePluginName(networkModel);
79 return ImportNetworkImpl(networkModel, config);
84 const std::map<std::string, std::string>& config)
override {
85 parsePluginName(networkModel);
86 return ImportNetworkImpl(networkModel, context, config);
89 void SetConfig(
const std::map<std::string, std::string>& config)
override {
95 assert(
nullptr != core);
112 void SetName(
const std::string& pluginName) noexcept
override {
113 _pluginName = pluginName;
116 std::string
GetName() const noexcept
override {
121 const std::map<std::string, Parameter>& )
const override {
126 const std::map<std::string, Parameter>& )
const override {
148 const std::map<std::string, std::string>& config,
154 copyInputOutputInfo(networkInputs, networkOutputs, networkInputsCloned, networkOutputsCloned);
157 if (
nullptr == context) {
158 impl = LoadExeNetworkImpl(network, config);
160 impl = LoadExeNetworkImpl(network, context, config);
163 impl->setNetworkInputs(networkInputsCloned);
164 impl->setNetworkOutputs(networkOutputsCloned);
165 impl->SetPointerToPlugin(shared_from_this());
167 auto executableNetwork = make_executable_network(impl);
183 const std::map<std::string, std::string>& config) = 0;
198 const std::map<std::string, std::string>& config) {
215 const std::map<std::string, std::string>& config) {
231 const std::map<std::string, std::string>& config) {
Inference Engine Plugin API namespace.
ExecutableNetwork LoadNetwork(const ICNNNetwork &network, const std::map< std::string, std::string > &config) override
Creates an executable network from an pares network object, users can create as many networks as they...
Definition: ie_plugin_internal.hpp:59
Optimal implementation of IInferencePlugin interface to avoid duplication in all plugins.
Definition: ie_plugin_internal.hpp:51
void QueryNetwork(const ICNNNetwork &, const std::map< std::string, std::string > &, QueryNetworkResult &) const override
Queries a plugin about supported layers in network.
Definition: ie_plugin_internal.hpp:107
virtual void getOutputsInfo(OutputsDataMap &out) const noexcept=0
Inference Engine plugin API wrapper, to be used by particular implementors.
void SetName(const std::string &pluginName) noexcept override
Sets a name for a plugin.
Definition: ie_plugin_internal.hpp:112
std::map< std::string, std::string > _config
A map config keys -> values.
Definition: ie_plugin_internal.hpp:236
void SetConfig(const std::map< std::string, std::string > &config) override
Sets configuration for plugin, acceptable keys can be found in ie_plugin_config.hpp.
Definition: ie_plugin_internal.hpp:89
ExecutableNetwork LoadNetwork(const ICNNNetwork &network, const std::map< std::string, std::string > &config, RemoteContext::Ptr context) override
Creates an executable network from network object, on specified remote context.
Definition: ie_plugin_internal.hpp:64
virtual ExecutableNetwork ImportNetworkImpl(std::istream &networkModel, const std::map< std::string, std::string > &config)
Creates an executable network from an previously exported network.
Definition: ie_plugin_internal.hpp:214
std::shared_ptr< IExecutableNetwork > Ptr
virtual ExecutableNetworkInternal::Ptr LoadExeNetworkImpl(const ICNNNetwork &network, const std::map< std::string, std::string > &config)=0
Creates an executable network from a parsed network object, users can create as many networks as they...
static void copyInputOutputInfo(const InputsDataMap &networkInputs, const OutputsDataMap &networkOutputs, InputsDataMap &_networkInputs, OutputsDataMap &_networkOutputs)
Copies InputInfo and output Data.
Definition: ie_iplugin_internal.hpp:57
#define NOT_IMPLEMENTED_str
Defines the not implemented message.
Definition: exception2status.hpp:132
virtual ExecutableNetwork ImportNetworkImpl(std::istream &networkModel, const RemoteContext::Ptr &context, const std::map< std::string, std::string > &config)
Imports network wit RemoteContext.
Definition: ie_plugin_internal.hpp:229
IExecutableNetwork::Ptr ImportNetwork(const std::string &modelFileName, const std::map< std::string, std::string > &config) override
Creates an executable network from an previously exported network.
Definition: ie_plugin_internal.hpp:69
void AddExtension(InferenceEngine::IExtensionPtr) override
Registers extension within plugin.
Definition: ie_plugin_internal.hpp:103
A namespace with non-public Inference Engine Plugin API.
Definition: caseless.hpp:19
std::string GetName() const noexcept override
Provides a name of a plugin.
Definition: ie_plugin_internal.hpp:116
virtual ExecutableNetworkInternal::Ptr LoadExeNetworkImpl(const ICNNNetwork &network, RemoteContext::Ptr context, const std::map< std::string, std::string > &config)
Creates an executable network using remote context from a parsed network object, users can create as ...
Definition: ie_plugin_internal.hpp:196
std::shared_ptr< ExecutableNetworkInternal > Ptr
A shared pointer to ExecutableNetworkInternal object.
Definition: ie_executable_network_internal.hpp:31
std::map< std::string, Parameter > ParamMap
std::array< char, 4 > ExportMagic
Type of magic value.
Definition: ie_icore.hpp:113
std::shared_ptr< RemoteContext > Ptr
ExecutableNetwork ImportNetwork(std::istream &networkModel, const std::map< std::string, std::string > &config) override
Creates an executable network from an previously exported network using plugin implementation and rem...
Definition: ie_plugin_internal.hpp:76
#define THROW_IE_EXCEPTION
virtual void getInputsInfo(InputsDataMap &inputs) const noexcept=0
RemoteContext::Ptr CreateContext(const ParamMap &) override
Creates a remote context instance based on a map of parameters.
Definition: ie_plugin_internal.hpp:130
~InferencePluginInternal() override=default
Destroys the object.
constexpr static const ExportMagic exportMagic
Magic number used by ie core to identify exported network with plugin name.
Definition: ie_icore.hpp:119
Minimal ICore interface to allow plugin to get information from Core Inference Engine class.
Definition: ie_icore.hpp:29
ICore * GetCore() const noexcept override
Gets reference to ICore interface.
Definition: ie_plugin_internal.hpp:99
ExecutableNetwork ImportNetwork(std::istream &networkModel, const RemoteContext::Ptr &context, const std::map< std::string, std::string > &config) override
Creates an executable network from an previously exported network using plugin implementation and rem...
Definition: ie_plugin_internal.hpp:82
RemoteContext::Ptr GetDefaultContext() override
Provides a default remote context instance if supported by a plugin.
Definition: ie_plugin_internal.hpp:134
void SetCore(ICore *core) noexcept override
Sets pointer to ICore interface.
Definition: ie_plugin_internal.hpp:94
Parameter GetMetric(const std::string &, const std::map< std::string, Parameter > &) const override
Gets general runtime metric for dedicated hardware.
Definition: ie_plugin_internal.hpp:125
inference engine executanle network API wrapper, to be used by particular implementors
std::string _pluginName
A device name that plugins enables.
Definition: ie_plugin_internal.hpp:235
Parameter GetConfig(const std::string &, const std::map< std::string, Parameter > &) const override
Gets configuration dedicated to plugin behaviour.
Definition: ie_plugin_internal.hpp:120
std::map< std::string, DataPtr > OutputsDataMap
An API of plugin to be implemented by a plugin.
Definition: ie_iplugin_internal.hpp:91