1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
6 * @brief a header file for IExecutableNetwork interface
7 * @file ie_iexecutable_network.hpp
11 #include "ie_common.h"
12 #include "ie_primitive_info.hpp"
13 #include "ie_iinfer_request.hpp"
14 #include "ie_icnn_network.hpp"
15 #include "ie_imemory_state.hpp"
16 #include "ie_input_info.hpp"
22 namespace InferenceEngine {
25 * @brief A collection that contains string as key, and const Data smart pointer as value
27 using ConstOutputsDataMap = std::map<std::string, CDataPtr>;
30 * @brief This is an interface of an executable network
32 class IExecutableNetwork : public details::IRelease {
35 * @brief A smart pointer to the current IExecutableNetwork object
37 using Ptr = std::shared_ptr<IExecutableNetwork>;
40 * @brief Gets the Executable network output Data node information. The received info is stored in the given ConstOutputsDataMap node.
41 * This method need to be called to find output names for using them later during filling of a map
42 * of blobs passed to InferenceEngine::IInferencePlugin::Infer()
43 * @param out Reference to the ConstOutputsDataMap object
44 * @param resp Optional: pointer to an already allocated object to contain information in case of failure
45 * @return Status code of the operation: OK (0) for success
47 virtual StatusCode GetOutputsInfo(ConstOutputsDataMap &out, ResponseDesc *resp) const noexcept = 0;
50 * @brief Gets the Executable network input Data node information. The received info is stored in the given ConstInputsDataMap object.
51 * This method need to be called to find out input names for using them later during filling of a map
52 * of blobs passed to InferenceEngine::IInferencePlugin::Infer()
53 * @param inputs Reference to ConstInputsDataMap object.
54 * @param resp Optional: pointer to an already allocated object to contain information in case of failure
55 * @return Status code of the operation: OK (0) for success
57 virtual StatusCode GetInputsInfo(ConstInputsDataMap &inputs, ResponseDesc *resp) const noexcept = 0;
60 * @brief Creates an inference request object used to infer the network.
61 * The created request has allocated input and output blobs (that can be changed later).
62 * @param req Shared pointer to the created request object
63 * @param resp Optional: pointer to an already allocated object to contain information in case of failure
64 * @return Status code of the operation: OK (0) for success
66 virtual StatusCode CreateInferRequest(IInferRequest::Ptr& req, ResponseDesc *resp) noexcept = 0;
69 * @brief Exports the current executable network so it can be used later in the Import() main API
70 * @param modelFileName Full path to the location of the exported file
71 * @param resp Optional: pointer to an already allocated object to contain information in case of failure
72 * @return Status code of the operation: OK (0) for success
74 virtual StatusCode Export(const std::string& modelFileName, ResponseDesc *resp) noexcept = 0;
77 * @brief Get the mapping of IR layer names to implemented kernels
78 * @param deployedTopology Map of PrimitiveInfo objects that represent the deployed topology
79 * @param resp Optional: pointer to an already allocated object to contain information in case of failure
80 * @return Status code of the operation: OK (0) for success
82 virtual StatusCode GetMappedTopology(std::map<std::string, std::vector<PrimitiveInfo::Ptr>> &deployedTopology, ResponseDesc *resp) noexcept = 0;
85 * @brief Get executable graph information from a device
86 * @param graphPtr network ptr to store executable graph information
87 * @param resp Optional: pointer to an already allocated object to contain information in case of failure
88 * @return Status code of the operation: OK (0) for success
90 virtual StatusCode GetExecGraphInfo(ICNNNetwork::Ptr &graphPtr, ResponseDesc *resp) noexcept = 0;
93 * @brief Gets state control interface for given executable network, State control essential for recurrent networks
94 * @param pState reference to a pointer that receives internal states
95 * @param idx requested index for receiving memory state
96 * @param resp Optional: pointer to an already allocated object to contain information in case of failure
97 * @return Status code of the operation: OK (0) for success, OUT_OF_BOUNDS (-6) no memory state for given index
99 virtual StatusCode QueryState(IMemoryState::Ptr & pState, size_t idx, ResponseDesc *resp) noexcept = 0;
102 } // namespace InferenceEngine