2 // Copyright 2017-2018 Intel Corporation.
4 // This software and the related documents are Intel copyrighted materials,
5 // and your use of them is governed by the express license under which they
6 // were provided to you (End User License Agreement for the Intel(R) Software
7 // Development Products (Version May 2017)). Unless the License provides
8 // otherwise, you may not use, modify, copy, publish, distribute, disclose or
9 // transmit this software or the related documents without Intel's prior
10 // written permission.
12 // This software and the related documents are provided as is, with no
13 // express or implied warranties, other than those that are expressly
14 // stated in the License.
18 * @brief a header file for IInferRequest interface
19 * @file ie_iinfer_request.hpp
28 #include <unordered_set>
29 #include <ie_common.h>
30 #include <cpp_interfaces/impl/ie_infer_request_internal.hpp>
31 #include <cpp_interfaces/impl/ie_executable_network_internal.hpp>
32 #include <cpp/ie_infer_request.hpp>
33 #include <cpp/ie_executable_network.hpp>
35 namespace HeteroPlugin {
37 class HeteroInferRequest : public InferenceEngine::InferRequestInternal {
39 typedef std::shared_ptr<HeteroInferRequest> Ptr;
41 struct SubRequestDesc {
42 InferenceEngine::ExecutableNetwork::Ptr _network;
43 InferenceEngine::InferRequest::Ptr _request;
44 std::unordered_set<std::string> _iNames;
45 std::unordered_set<std::string> _oNames;
46 InferenceEngine::ProfilingTask _profilingTask;
48 using SubRequestsList = std::vector<SubRequestDesc>;
50 explicit HeteroInferRequest(InferenceEngine::InputsDataMap networkInputs,
51 InferenceEngine::OutputsDataMap networkOutputs,
52 const SubRequestsList &inferRequests);
54 void InferImpl() override;
57 GetPerformanceCounts(std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> &perfMap) const override;
59 void updateInOutIfNeeded();
61 void setCallbackSequence();
63 void startFirstAsyncRequest();
65 InferenceEngine::StatusCode waitAllRequests(int64_t millis_timeout);
67 void setCallbackForLastRequest(std::function<void(InferenceEngine::InferRequest, InferenceEngine::StatusCode)>& callback);
69 bool isAnyRequestBusy();
72 SubRequestsList _inferRequests;
73 std::map<std::string, InferenceEngine::Blob::Ptr> _blobs;
76 } // namespace HeteroPlugin