interface InferenceEngine::IInferencePlugin¶
Overview¶
An API of plugin to be implemented by a plugin. More…
#include <ie_iplugin_internal.hpp>
template IInferencePlugin: public std::enable_shared_from_this< IInferencePlugin >
{
// typedefs
typedef std::shared_ptr<IInferencePlugin> Ptr;
// classes
class VersionStore;
// methods
void SetVersion(const Version& version);
const Version& GetVersion() const;
virtual std::string GetName() const;
virtual void SetName(const std::string& name);
virtual std::shared_ptr<IExecutableNetworkInternal> LoadNetwork(
const CNNNetwork& network,
const std::map<std::string, std::string>& config
);
virtual std::shared_ptr<IExecutableNetworkInternal> LoadNetwork(
const CNNNetwork& network,
const std::map<std::string, std::string>& config,
const std::shared_ptr<RemoteContext>& context
);
virtual std::shared_ptr<IExecutableNetworkInternal> LoadNetwork(
const std::string& modelPath,
const std::map<std::string, std::string>& config
);
virtual void AddExtension(const std::shared_ptr<IExtension>& extension);
virtual void SetConfig(const std::map<std::string, std::string>& config);
virtual Parameter GetConfig(
const std::string& name,
const std::map<std::string, Parameter>& options
) const;
virtual Parameter GetMetric(
const std::string& name,
const std::map<std::string, Parameter>& options
) const;
virtual std::shared_ptr<RemoteContext> CreateContext(const ParamMap& params);
virtual std::shared_ptr<RemoteContext> GetDefaultContext(const ParamMap& params);
virtual std::shared_ptr<IExecutableNetworkInternal> ImportNetwork(
const std::string& modelFileName,
const std::map<std::string, std::string>& config
);
virtual std::shared_ptr<IExecutableNetworkInternal> ImportNetwork(
std::istream& networkModel,
const std::map<std::string, std::string>& config
);
virtual std::shared_ptr<IExecutableNetworkInternal> ImportNetwork(
std::istream& networkModel,
const std::shared_ptr<RemoteContext>& context,
const std::map<std::string, std::string>& config
);
virtual void SetCore(std::weak_ptr<ov::ICore> core);
virtual std::shared_ptr<ov::ICore> GetCore() const;
const std::shared_ptr<ExecutorManager>& executorManager() const;
virtual QueryNetworkResult QueryNetwork(
const CNNNetwork& network,
const std::map<std::string, std::string>& config
) const;
protected:
};
Detailed Documentation¶
An API of plugin to be implemented by a plugin.
Typedefs¶
typedef std::shared_ptr<IInferencePlugin> Ptr
A shared pointer to IInferencePlugin interface.
Methods¶
void SetVersion(const Version& version)
Sets a plugin version.
Parameters:
version |
A version to set |
const Version& GetVersion() const
Gets a plugin version.
Returns:
A const InferenceEngine::Version object
virtual std::string GetName() const
Provides a name of a plugin.
Returns:
The name.
virtual void SetName(const std::string& name)
Sets a name for a plugin.
Parameters:
name |
The name |
virtual std::shared_ptr<IExecutableNetworkInternal> LoadNetwork(
const CNNNetwork& network,
const std::map<std::string, std::string>& config
)
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:
network |
A network object acquired from InferenceEngine::Core::ReadNetwork |
config |
A string-string map of config parameters relevant only for this load operation |
Returns:
Created Executable Network object
virtual std::shared_ptr<IExecutableNetworkInternal> LoadNetwork(
const CNNNetwork& network,
const std::map<std::string, std::string>& config,
const std::shared_ptr<RemoteContext>& context
)
Creates an executable network from network object, on specified remote context.
Parameters:
network |
A network object acquired from InferenceEngine::Core::ReadNetwork |
config |
string-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
virtual std::shared_ptr<IExecutableNetworkInternal> LoadNetwork(
const std::string& modelPath,
const std::map<std::string, std::string>& config
)
Creates an executable network from model file path.
Parameters:
modelPath |
A path to model |
config |
A string-string map of config parameters relevant only for this load operation |
Returns:
Created Executable Network object
virtual void AddExtension(const std::shared_ptr<IExtension>& extension)
Registers extension within plugin.
Parameters:
extension |
|
virtual void SetConfig(const std::map<std::string, std::string>& config)
Sets configuration for plugin, acceptable keys can be found in ie_plugin_config.hpp
.
Parameters:
config |
string-string map of config parameters |
Gets configuration dedicated to plugin behaviour.
Parameters:
name |
|
options |
|
Returns:
Value of config corresponding to config key
Gets general runtime metric for dedicated hardware.
Parameters:
name |
|
options |
|
Returns:
Metric value corresponding to metric key
virtual std::shared_ptr<RemoteContext> CreateContext(const ParamMap& params)
Creates a remote context instance based on a map of parameters.
Parameters:
params |
The map of parameters |
Returns:
A remote context object
virtual std::shared_ptr<RemoteContext> GetDefaultContext(const ParamMap& params)
Provides a default remote context instance if supported by a plugin.
Parameters:
params |
The map of parameters |
Returns:
The default context.
virtual std::shared_ptr<IExecutableNetworkInternal> ImportNetwork(
const std::string& modelFileName,
const std::map<std::string, std::string>& config
)
Creates an executable network from an previously exported network.
Deprecated Use ImportNetwork(std::istream& networkModel, const std::map<std::string, std::string>& config)
Parameters:
modelFileName |
|
config |
A string -> string map of parameters |
Returns:
An Executable network
virtual std::shared_ptr<IExecutableNetworkInternal> ImportNetwork(
std::istream& networkModel,
const std::map<std::string, std::string>& config
)
Creates an executable network from an previously exported network using plugin implementation and removes Inference Engine magic and plugin name.
Parameters:
networkModel |
Reference to network model output stream |
config |
A string -> string map of parameters |
Returns:
An Executable network
virtual std::shared_ptr<IExecutableNetworkInternal> ImportNetwork(
std::istream& networkModel,
const std::shared_ptr<RemoteContext>& context,
const std::map<std::string, std::string>& config
)
Creates an executable network from an previously exported network using plugin implementation and removes Inference Engine magic and plugin name.
Parameters:
networkModel |
Reference to network model output stream |
context |
A pointer to plugin context derived from RemoteContext class used to execute the network |
config |
A string -> string map of parameters |
Returns:
An Executable network
virtual void SetCore(std::weak_ptr<ov::ICore> core)
Sets pointer to ICore interface.
Parameters:
core |
Pointer to Core interface |
virtual std::shared_ptr<ov::ICore> GetCore() const
Gets reference to ICore interface.
Returns:
Reference to ICore interface
const std::shared_ptr<ExecutorManager>& executorManager() const
Gets reference to tasks execution manager.
Returns:
Reference to ExecutorManager interface
virtual QueryNetworkResult QueryNetwork(
const CNNNetwork& network,
const std::map<std::string, std::string>& config
) const
Queries a plugin about supported layers in network.
Parameters:
network |
The network object to query |
config |
The map of configuration parameters |
Returns:
The result of query operator containing supported layers map