Public Member Functions | Protected Member Functions | Protected Attributes
InferenceEngine::InferencePluginInternal Class Referenceabstract

Optimal implementation of IInferencePlugin interface to avoid duplication in all plugins. More...

#include <ie_plugin_internal.hpp>

Inheritance diagram for InferenceEngine::InferencePluginInternal:
InferenceEngine::IInferencePlugin

Public Member Functions

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 need and use them simultaneously (up to the limitation of the HW resources) More...
 
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. More...
 
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. More...
 
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 removes Inference Engine magic and plugin name. More...
 
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 removes Inference Engine magic and plugin name. More...
 
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. More...
 
void SetCore (ICore *core) noexcept override
 Sets pointer to ICore interface. More...
 
ICoreGetCore () const noexcept override
 Gets reference to ICore interface. More...
 
void AddExtension (InferenceEngine::IExtensionPtr) override
 Registers extension within plugin. More...
 
void QueryNetwork (const ICNNNetwork &, const std::map< std::string, std::string > &, QueryNetworkResult &) const override
 Queries a plugin about supported layers in network. More...
 
void SetName (const std::string &pluginName) noexcept override
 Sets a name for a plugin. More...
 
std::string GetName () const noexcept override
 Provides a name of a plugin. More...
 
Parameter GetConfig (const std::string &, const std::map< std::string, Parameter > &) const override
 Gets configuration dedicated to plugin behaviour. More...
 
Parameter GetMetric (const std::string &, const std::map< std::string, Parameter > &) const override
 Gets general runtime metric for dedicated hardware. More...
 
RemoteContext::Ptr CreateContext (const ParamMap &) override
 Creates a remote context instance based on a map of parameters. More...
 
RemoteContext::Ptr GetDefaultContext () override
 Provides a default remote context instance if supported by a plugin. More...
 
- Public Member Functions inherited from InferenceEngine::IInferencePlugin
void SetVersion (const Version &version)
 Sets a plugin version. More...
 
Version GetVersion () const
 Gets a plugin version. More...
 
void Release () noexcept override
 

Protected Member Functions

 ~InferencePluginInternal () override=default
 Destroys the object.
 
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 need and use them simultaneously (up to the limitation of the HW resources) More...
 
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 many networks as they need and use them simultaneously (up to the limitation of the HW resources) More...
 
virtual ExecutableNetwork ImportNetworkImpl (std::istream &networkModel, const std::map< std::string, std::string > &config)
 Creates an executable network from an previously exported network. More...
 
virtual ExecutableNetwork ImportNetworkImpl (std::istream &networkModel, const RemoteContext::Ptr &context, const std::map< std::string, std::string > &config)
 Imports network wit RemoteContext. More...
 
- Protected Member Functions inherited from InferenceEngine::IInferencePlugin
 ~IInferencePlugin () override=default
 Destroys the object.
 

Protected Attributes

std::string _pluginName
 A device name that plugins enables.
 
std::map< std::string, std::string > _config
 A map config keys -> values.
 
ICore_core = nullptr
 A pointer to ICore interface.
 

Additional Inherited Members

- Public Types inherited from InferenceEngine::IInferencePlugin
using Ptr = std::shared_ptr< IInferencePlugin >
 A shared pointer to IInferencePlugin interface.
 

Detailed Description

Optimal implementation of IInferencePlugin interface to avoid duplication in all plugins.

Member Function Documentation

◆ AddExtension()

void InferenceEngine::InferencePluginInternal::AddExtension ( InferenceEngine::IExtensionPtr  extension)
inlineoverridevirtual

Registers extension within plugin.

Parameters
extension- pointer to already loaded extension

Implements InferenceEngine::IInferencePlugin.

◆ CreateContext()

RemoteContext::Ptr InferenceEngine::InferencePluginInternal::CreateContext ( const ParamMap params)
inlineoverridevirtual

Creates a remote context instance based on a map of parameters.

Parameters
[in]paramsThe map of parameters
Returns
A remote context object

Implements InferenceEngine::IInferencePlugin.

◆ GetConfig()

Parameter InferenceEngine::InferencePluginInternal::GetConfig ( const std::string &  name,
const std::map< std::string, Parameter > &  options 
) const
inlineoverridevirtual

Gets configuration dedicated to plugin behaviour.

Parameters
name- value of config corresponding to config key
options- configuration details for config
Returns
Value of config corresponding to config key

Implements InferenceEngine::IInferencePlugin.

◆ GetCore()

ICore* InferenceEngine::InferencePluginInternal::GetCore ( ) const
inlineoverridevirtualnoexcept

Gets reference to ICore interface.

Returns
Reference to ICore interface

Implements InferenceEngine::IInferencePlugin.

◆ GetDefaultContext()

RemoteContext::Ptr InferenceEngine::InferencePluginInternal::GetDefaultContext ( )
inlineoverridevirtual

Provides a default remote context instance if supported by a plugin.

Returns
The default context.

Implements InferenceEngine::IInferencePlugin.

◆ GetMetric()

Parameter InferenceEngine::InferencePluginInternal::GetMetric ( const std::string &  name,
const std::map< std::string, Parameter > &  options 
) const
inlineoverridevirtual

Gets general runtime metric for dedicated hardware.

Parameters
name- metric name to request
options- configuration details for metric
Returns
Metric value corresponding to metric key

Implements InferenceEngine::IInferencePlugin.

◆ GetName()

std::string InferenceEngine::InferencePluginInternal::GetName ( ) const
inlineoverridevirtualnoexcept

Provides a name of a plugin.

Returns
The name.

Implements InferenceEngine::IInferencePlugin.

◆ ImportNetwork() [1/3]

IExecutableNetwork::Ptr InferenceEngine::InferencePluginInternal::ImportNetwork ( const std::string &  modelFileName,
const std::map< std::string, std::string > &  config 
)
inlineoverridevirtual

Creates an executable network from an previously exported network.

Parameters
modelFileName- path to the location of the exported file
configA string -> string map of parameters
Returns
A reference to a shared ptr of the returned network interface

Implements InferenceEngine::IInferencePlugin.

◆ ImportNetwork() [2/3]

ExecutableNetwork InferenceEngine::InferencePluginInternal::ImportNetwork ( std::istream &  networkModel,
const RemoteContext::Ptr context,
const std::map< std::string, std::string > &  config 
)
inlineoverridevirtual

Creates an executable network from an previously exported network using plugin implementation and removes Inference Engine magic and plugin name.

Parameters
networkModelReference to network model output stream
context- a pointer to plugin context derived from RemoteContext class used to execute the network
configA string -> string map of parameters
Returns
An Executable network

Implements InferenceEngine::IInferencePlugin.

◆ ImportNetwork() [3/3]

ExecutableNetwork InferenceEngine::InferencePluginInternal::ImportNetwork ( std::istream &  networkModel,
const std::map< std::string, std::string > &  config 
)
inlineoverridevirtual

Creates an executable network from an previously exported network using plugin implementation and removes Inference Engine magic and plugin name.

Parameters
networkModelReference to network model output stream
configA string -> string map of parameters
Returns
An Executable network

Implements InferenceEngine::IInferencePlugin.

◆ ImportNetworkImpl() [1/2]

virtual ExecutableNetwork InferenceEngine::InferencePluginInternal::ImportNetworkImpl ( std::istream &  networkModel,
const RemoteContext::Ptr context,
const std::map< std::string, std::string > &  config 
)
inlineprotectedvirtual

Imports network wit RemoteContext.

Parameters
networkModelReference to network model output stream
context- a pointer to plugin context derived from RemoteContext class used to execute the network
configA string -> string map of parameters
Returns
An Executable network

◆ ImportNetworkImpl() [2/2]

virtual ExecutableNetwork InferenceEngine::InferencePluginInternal::ImportNetworkImpl ( std::istream &  networkModel,
const std::map< std::string, std::string > &  config 
)
inlineprotectedvirtual

Creates an executable network from an previously exported network.

Note
The function is called from IInferencePlugin::ImportNetwork(std::istream&, const RemoteContext::Ptr&, const std::map<std::string, std::string>&) performs common steps first and calls this plugin-dependent implementation after.
Parameters
networkModelReference to network model output stream
configA string -> string map of parameters
Returns
An Executable network

◆ LoadExeNetworkImpl() [1/2]

virtual ExecutableNetworkInternal::Ptr InferenceEngine::InferencePluginInternal::LoadExeNetworkImpl ( const ICNNNetwork network,
const std::map< std::string, std::string > &  config 
)
protectedpure virtual

Creates an executable network from a parsed network object, users can create as many networks as they need and use them simultaneously (up to the limitation of the HW resources)

Note
The function is used in InferencePluginInternal::LoadNetwork(const ICNNNetwork&, const std::map<std::string, std::string>&) which performs common steps first and calls this plugin-dependent method implementation after.
Parameters
networkA network object
configstring-string map of config parameters relevant only for this load operation
Returns
Shared pointer to the ExecutableNetwork object

◆ LoadExeNetworkImpl() [2/2]

virtual ExecutableNetworkInternal::Ptr InferenceEngine::InferencePluginInternal::LoadExeNetworkImpl ( const ICNNNetwork network,
RemoteContext::Ptr  context,
const std::map< std::string, std::string > &  config 
)
inlineprotectedvirtual

Creates an executable network using remote context from a parsed network object, users can create as many networks as they need and use them simultaneously (up to the limitation of the HW resources)

Note
The function is used in InferencePluginInternal::LoadNetwork(const ICNNNetwork&, const std::map<std::string, std::string>&, RemoteContext::Ptr) which performs common steps first and calls this plugin-dependent method implementation after.
Parameters
networkA network object
contextA remote context
configstring-string map of config parameters relevant only for this load operation
Returns
Shared pointer to the ExecutableNetwork object

◆ LoadNetwork() [1/2]

ExecutableNetwork InferenceEngine::InferencePluginInternal::LoadNetwork ( const ICNNNetwork network,
const std::map< std::string, std::string > &  config 
)
inlineoverridevirtual

Creates an executable network from an pares network object, users can create as many networks as they need and use them simultaneously (up to the limitation of the HW resources)

Parameters
networkA network object acquired from InferenceEngine::Core::ReadNetwork
configA string-string map of config parameters relevant only for this load operation
Returns
Created Executable Network object

Implements InferenceEngine::IInferencePlugin.

◆ LoadNetwork() [2/2]

ExecutableNetwork InferenceEngine::InferencePluginInternal::LoadNetwork ( const ICNNNetwork network,
const std::map< std::string, std::string > &  config,
RemoteContext::Ptr  context 
)
inlineoverridevirtual

Creates an executable network from network object, on specified remote context.

Parameters
network- a network object acquired from InferenceEngine::Core::ReadNetwork
configstring-string map of config parameters relevant only for this load operation
context- a pointer to plugin context derived from RemoteContext class used to execute the network
Returns
Created Executable Network object

Implements InferenceEngine::IInferencePlugin.

◆ QueryNetwork()

void InferenceEngine::InferencePluginInternal::QueryNetwork ( const ICNNNetwork network,
const std::map< std::string, std::string > &  config,
QueryNetworkResult res 
) const
inlineoverridevirtual

Queries a plugin about supported layers in network.

Parameters
[in]networkThe network object to query
[in]configThe map of configuration parameters
resThe result of query operator containing supported layers map

Implements InferenceEngine::IInferencePlugin.

◆ SetConfig()

void InferenceEngine::InferencePluginInternal::SetConfig ( const std::map< std::string, std::string > &  config)
inlineoverridevirtual

Sets configuration for plugin, acceptable keys can be found in ie_plugin_config.hpp.

Parameters
configstring-string map of config parameters

Implements InferenceEngine::IInferencePlugin.

◆ SetCore()

void InferenceEngine::InferencePluginInternal::SetCore ( ICore core)
inlineoverridevirtualnoexcept

Sets pointer to ICore interface.

Parameters
corePointer to Core interface

Implements InferenceEngine::IInferencePlugin.

◆ SetName()

void InferenceEngine::InferencePluginInternal::SetName ( const std::string &  name)
inlineoverridevirtualnoexcept

Sets a name for a plugin.

Parameters
[in]nameThe name

Implements InferenceEngine::IInferencePlugin.


The documentation for this class was generated from the following file: