1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
6 * \brief inference engine plugin API wrapper, to be used by particular implementors
7 * \file ie_plugin_base.hpp
15 #include <ie_icnn_network.hpp>
16 #include <ie_iexecutable_network.hpp>
17 #include <ie_iextension.h>
18 #include <ie_icore.hpp>
20 namespace InferenceEngine {
23 * @brief minimum API to be implemented by plugin, which is used in PluginBase forwarding mechanism
25 class IInferencePluginInternal {
27 virtual ~IInferencePluginInternal() = default;
29 virtual std::string GetName() const noexcept = 0;
30 virtual void SetName(const std::string & name) noexcept = 0;
33 * @brief Creates an executable network from an pares network object, users can create as many networks as they need and use
34 * them simultaneously (up to the limitation of the HW resources)
35 * @param executableNetwork - a reference to a shared ptr of the returned network interface
36 * @param network - a network object acquired from CNNNetReader
37 * @param config string-string map of config parameters relevant only for this load operation
39 virtual void LoadNetwork(IExecutableNetwork::Ptr &executableNetwork,
41 const std::map<std::string, std::string> &config) = 0;
44 * @brief Registers extension within plugin
45 * @param extension - pointer to already loaded extension
47 virtual void AddExtension(InferenceEngine::IExtensionPtr extension) = 0;
50 * @brief Sets configuration for plugin, acceptable keys can be found in ie_plugin_config.hpp
51 * @param config string-string map of config parameters
53 virtual void SetConfig(const std::map<std::string, std::string> &config) = 0;
56 * @brief Gets configuration dedicated to plugin behaviour
57 * @param name - value of config corresponding to config key
58 * @param options - configuration details for config
59 * @return Value of config corresponding to config key
61 virtual Parameter GetConfig(const std::string& name, const std::map<std::string, Parameter> & options) const = 0;
64 * @brief Gets general runtime metric for dedicated hardware
65 * @param name - metric name to request
66 * @param options - configuration details for metric
67 * @return Metric value corresponding to metric key
69 virtual Parameter GetMetric(const std::string& name, const std::map<std::string, Parameter> & options) const = 0;
72 * @brief Creates an executable network from an previously exported network
73 * @param ret - a reference to a shared ptr of the returned network interface
74 * @param modelFileName - path to the location of the exported file
76 virtual IExecutableNetwork::Ptr ImportNetwork(const std::string &modelFileName, const std::map<std::string, std::string> &config) = 0;
79 * @brief Sets logging callback
80 * Logging is used to track what is going on inside
81 * @param listener - logging sink
83 virtual void SetLogCallback(IErrorListener &listener) = 0;
86 * @brief Sets pointer to ICore interface
87 * @param core Pointer to Core interface
89 virtual void SetCore(ICore *core) noexcept = 0;
92 * @brief Gets refernce to ICore interface
93 * @return Reference to core interface
95 virtual const ICore* GetCore() const noexcept = 0;
97 virtual void QueryNetwork(const ICNNNetwork &network, const std::map<std::string, std::string>& config, QueryNetworkResult &res) const = 0;
100 } // namespace InferenceEngine