1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
10 #include <cpp_interfaces/impl/ie_plugin_internal.hpp>
11 #include <cpp_interfaces/impl/ie_executable_network_internal.hpp>
12 #include "gna_executable_network.hpp"
14 namespace GNAPluginNS {
16 class GNAPluginInternal : public InferenceEngine::InferencePluginInternal {
18 InferenceEngine::ExecutableNetworkInternal::Ptr LoadExeNetworkImpl(
19 InferenceEngine::ICNNNetwork &network,
20 const std::map<std::string, std::string> &config) override {
21 return std::make_shared<GNAExecutableNetwork>(network, config);
23 void SetConfig(const std::map<std::string, std::string> &config) override {
24 auto plg = std::make_shared<GNAPlugin>();
25 plg->SetConfig(config);
27 InferenceEngine::IExecutableNetwork::Ptr ImportNetwork(
28 const std::string &modelFileName,
29 const std::map<std::string, std::string> &config) override {
30 return make_executable_network(std::make_shared<GNAExecutableNetwork>(modelFileName, config));
34 * @depricated Use the version with config parameter
36 void QueryNetwork(const InferenceEngine::ICNNNetwork& network,
37 InferenceEngine::QueryNetworkResult& res) const override {
38 auto plg = std::make_shared<GNAPlugin>();
39 plg->QueryNetwork(network, {}, res);
41 void QueryNetwork(const InferenceEngine::ICNNNetwork& network,
42 const std::map<std::string, std::string>& config,
43 InferenceEngine::QueryNetworkResult& res) const override {
44 auto plg = std::make_shared<GNAPlugin>();
46 plg->SetConfig(config);
47 } catch (InferenceEngine::details::InferenceEngineException& e) {}
48 plg->QueryNetwork(network, config, res);
52 } // namespace GNAPluginNS