Class ov::IPlugin

class IPlugin : public std::enable_shared_from_this<IPlugin>

OpenVINO Plugin Interface 2.0.

Public Functions

void set_version(const Version &version)

Sets a plugin version.

Parameters

version – A version to set

const Version &get_version() const

Returns a plugin version.

Returns

A constant ov::Version object

virtual std::shared_ptr<ov::ICompiledModel> compile_model(const std::shared_ptr<const ov::Model> &model, const ov::AnyMap &properties) const = 0

Compiles model from ov::Model object.

Parameters
  • model – A model object acquired from ov::Core::read_model or source construction

  • properties – A ov::AnyMap of properties relevant only for this load operation

Returns

Created Compiled Model object

virtual std::shared_ptr<ov::ICompiledModel> compile_model(const std::string &model_path, const ov::AnyMap &properties) const

Compiles model from ov::Model object.

Parameters
  • model_path – A path to model (path can be converted from unicode representation)

  • properties – A ov::AnyMap of properties relevant only for this load operation

Returns

Created Compiled Model object

virtual std::shared_ptr<ov::ICompiledModel> compile_model(const std::shared_ptr<const ov::Model> &model, const ov::AnyMap &properties, const ov::SoPtr<ov::IRemoteContext> &context) const = 0

Compiles model from ov::Model object, on specified remote context.

Parameters
  • model – A model object acquired from ov::Core::read_model or source construction

  • properties – A ov::AnyMap of properties relevant only for this load operation

  • context – A pointer to plugin context derived from RemoteContext class used to execute the model

Returns

Created Compiled Model object

virtual void set_property(const ov::AnyMap &properties) = 0

Sets properties for plugin, acceptable keys can be found in openvino/runtime/properties.hpp.

Parameters

properties – ov::AnyMap of properties

virtual ov::Any get_property(const std::string &name, const ov::AnyMap &arguments) const = 0

Gets properties related to plugin behaviour.

Parameters
  • nameProperty name.

  • arguments – Additional arguments to get a property.

Returns

Value of a property corresponding to the property name.

virtual ov::SoPtr<ov::IRemoteContext> create_context(const ov::AnyMap &remote_properties) const = 0

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

Parameters

remote_properties – Map of device-specific shared context remote properties.

Returns

A remote context object

virtual ov::SoPtr<ov::IRemoteContext> get_default_context(const ov::AnyMap &remote_properties) const = 0

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

Parameters

remote_properties – Map of device-specific shared context remote properties.

Returns

The default context.

virtual std::shared_ptr<ov::ICompiledModel> import_model(std::istream &model, const ov::AnyMap &properties) const = 0

Creates an compiled model from an previously exported model using plugin implementation and removes OpenVINO Runtime magic and plugin name.

Parameters
  • model – Reference to model output stream

  • properties – A ov::AnyMap of properties

Returns

An Compiled model

virtual std::shared_ptr<ov::ICompiledModel> import_model(std::istream &model, const ov::SoPtr<ov::IRemoteContext> &context, const ov::AnyMap &properties) const = 0

Creates an compiled model from an previously exported model using plugin implementation and removes OpenVINO Runtime magic and plugin name.

Parameters
  • model – Reference to model output stream

  • context – A pointer to plugin context derived from RemoteContext class used to execute the network

  • properties – A ov::AnyMap of properties

Returns

An Compiled model

virtual ov::SupportedOpsMap query_model(const std::shared_ptr<const ov::Model> &model, const ov::AnyMap &properties) const = 0

Queries a plugin about supported layers in model.

Parameters
  • modelModel object to query.

  • properties – Optional map of pairs: (property name, property value).

Returns

An object containing a map of pairs an operation name -> a device name supporting this operation.

virtual OPENVINO_SUPPRESS_DEPRECATED_START void add_extension (const std::shared_ptr< InferenceEngine::IExtension > &extension)

Registers legacy extension within plugin.

Deprecated:

This method allows to load legacy Inference Engine Extensions and will be removed in 2024.0 release

Parameters

extension – - pointer to already loaded legacy extension

OPENVINO_SUPPRESS_DEPRECATED_END void set_core (const std::weak_ptr< ov::ICore > &core)

Sets pointer to ICore interface.

Parameters

core – Pointer to Core interface

std::shared_ptr<ov::ICore> get_core() const

Gets reference to ICore interface.

Returns

Reference to ICore interface

bool is_new_api() const

Provides an information about used API.

Returns

true if new API is used

const std::shared_ptr<ov::threading::ExecutorManager> &get_executor_manager() const

Gets reference to tasks execution manager.

Returns

Reference to ExecutorManager interface