CMAKE: moved GNA var setting to proper place; removed find_package when build python...
[platform/upstream/dldt.git] / inference-engine / src / hetero_plugin / hetero_executable_network.hpp
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 /**
6  * @brief a header file for ExecutableNetwork
7  * @file dlia_executable_network.hpp
8  */
9 #pragma once
10
11 #include <memory>
12 #include <string>
13 #include <vector>
14 #include <map>
15 #include <unordered_map>
16 #include <unordered_set>
17
18 #include <ie_common.h>
19 #include <cpp/ie_plugin_cpp.hpp>
20 #include <cpp_interfaces/impl/ie_executable_network_thread_safe_default.hpp>
21
22 #include "hetero_infer_request.hpp"
23 #include "ie_icore.hpp"
24 #include "cnn_network_impl.hpp"
25 #include "hetero_async_infer_request.hpp"
26
27 namespace HeteroPlugin {
28
29 class Engine;
30
31 /**
32  * @class ExecutableNetwork
33  * @brief Interface of executable network
34  */
35 class HeteroExecutableNetwork : public InferenceEngine::ExecutableNetworkThreadSafeDefault {
36 public:
37     typedef std::shared_ptr<HeteroExecutableNetwork> Ptr;
38
39     /**
40     * @brief constructor
41     */
42     HeteroExecutableNetwork(InferenceEngine::ICNNNetwork&               network,
43                             const std::map<std::string, std::string>&   config,
44                             Engine*                                     plugin);
45
46     virtual ~HeteroExecutableNetwork() = default;
47
48     InferenceEngine::InferRequestInternal::Ptr CreateInferRequestImpl(InferenceEngine::InputsDataMap networkInputs,
49                                                                       InferenceEngine::OutputsDataMap networkOutputs) override;
50
51     void CreateInferRequest(InferenceEngine::IInferRequest::Ptr &asyncRequest) override;
52
53     void GetConfig(const std::string &name, InferenceEngine::Parameter &result, InferenceEngine::ResponseDesc *resp) const override;
54
55     void GetMetric(const std::string &name, InferenceEngine::Parameter &result, InferenceEngine::ResponseDesc *resp) const override;
56
57 private:
58     struct NetworkDesc {
59         std::string _device;
60         InferenceEngine::details::CNNNetworkImplPtr _clonedNetwork;
61         InferenceEngine::ExecutableNetwork network;
62         std::unordered_set<std::string> _oNames;
63         std::unordered_set<std::string> _iNames;
64     };
65     std::vector<NetworkDesc> networks;
66
67     Engine*                             _plugin;
68     std::string                         _name;
69     std::vector<std::string>            _affinities;
70     std::map<std::string, std::string>  _config;
71 };
72
73 }  // namespace HeteroPlugin