diff --git a/inference-engine/include/cpp/ie_executable_network.hpp b/inference-engine/include/cpp/ie_executable_network.hpp index 15c1ecbedd5e91..a1f5fb44cfaec8 100644 --- a/inference-engine/include/cpp/ie_executable_network.hpp +++ b/inference-engine/include/cpp/ie_executable_network.hpp @@ -35,6 +35,8 @@ class INFERENCE_ENGINE_API_CLASS(ExecutableNetwork) : protected details::SOPoint friend class Core; public: + ExecutableNetwork() = default; + /** * @brief Gets the Executable network output Data node information. * diff --git a/inference-engine/src/auto_plugin/auto_exec_network.cpp b/inference-engine/src/auto_plugin/auto_exec_network.cpp index 04b5253d7098d2..d6b42a1a8eca05 100644 --- a/inference-engine/src/auto_plugin/auto_exec_network.cpp +++ b/inference-engine/src/auto_plugin/auto_exec_network.cpp @@ -29,7 +29,7 @@ AutoExecutableNetwork::~AutoExecutableNetwork() = default; IInferRequestInternal::Ptr AutoExecutableNetwork::CreateInferRequestImpl(InputsDataMap networkInputs, OutputsDataMap networkOutputs) { - auto inferRequest = _network->CreateInferRequest(); + SoIInferRequestInternal inferRequest = { _network, _network->CreateInferRequest() }; return std::make_shared(networkInputs, networkOutputs, inferRequest); } diff --git a/inference-engine/src/auto_plugin/auto_infer_request.cpp b/inference-engine/src/auto_plugin/auto_infer_request.cpp index 33deef1892f9f5..bcaf9b2aa5c4c0 100644 --- a/inference-engine/src/auto_plugin/auto_infer_request.cpp +++ b/inference-engine/src/auto_plugin/auto_infer_request.cpp @@ -9,9 +9,9 @@ namespace AutoPlugin { using namespace InferenceEngine; -AutoInferRequest::AutoInferRequest(const InputsDataMap& networkInputs, - const OutputsDataMap& networkOutputs, - const IInferRequestInternal::Ptr& inferRequest) +AutoInferRequest::AutoInferRequest(const InputsDataMap& networkInputs, + const OutputsDataMap& networkOutputs, + const SoIInferRequestInternal& inferRequest) : IInferRequestInternal(networkInputs, networkOutputs) , _inferRequest(inferRequest) { } diff --git a/inference-engine/src/auto_plugin/auto_infer_request.hpp b/inference-engine/src/auto_plugin/auto_infer_request.hpp index 473f93fb45a1c3..c1b2a87b6e0be3 100644 --- a/inference-engine/src/auto_plugin/auto_infer_request.hpp +++ b/inference-engine/src/auto_plugin/auto_infer_request.hpp @@ -24,9 +24,9 @@ namespace AutoPlugin { class AutoInferRequest : public InferenceEngine::IInferRequestInternal { public: using Ptr = std::shared_ptr; - explicit AutoInferRequest(const InferenceEngine::InputsDataMap& networkInputs, - const InferenceEngine::OutputsDataMap& networkOutputs, - const InferenceEngine::IInferRequestInternal::Ptr& inferRequest); + explicit AutoInferRequest(const InferenceEngine::InputsDataMap& networkInputs, + const InferenceEngine::OutputsDataMap& networkOutputs, + const InferenceEngine::SoIInferRequestInternal& inferRequest); std::map GetPerformanceCounts() const override; void InferImpl() override; void SetBlob(const std::string& name, const InferenceEngine::Blob::Ptr& data) override; @@ -34,7 +34,7 @@ class AutoInferRequest : public InferenceEngine::IInferRequestInternal { void Cancel() override; private: - InferenceEngine::IInferRequestInternal::Ptr _inferRequest; + InferenceEngine::SoIInferRequestInternal _inferRequest; }; } // namespace AutoPlugin diff --git a/inference-engine/src/hetero_plugin/hetero_infer_request.cpp b/inference-engine/src/hetero_plugin/hetero_infer_request.cpp index 1c8a72e0a22ae8..b84039a7c17b12 100644 --- a/inference-engine/src/hetero_plugin/hetero_infer_request.cpp +++ b/inference-engine/src/hetero_plugin/hetero_infer_request.cpp @@ -49,7 +49,7 @@ HeteroInferRequest::HeteroInferRequest(InferenceEngine::InputsDataMap networkInp // go over all subnet and create requests for (auto&& desc : _inferRequests) { - desc._request = desc._network->CreateInferRequest(); + desc._request = { desc._network, desc._network->CreateInferRequest() }; // go over all inputs and get blobs from subnet infer requests for (auto&& outputInfo : desc._network->GetOutputsInfo()) { requestBlob(outputInfo.first, desc._request); diff --git a/inference-engine/src/hetero_plugin/hetero_infer_request.hpp b/inference-engine/src/hetero_plugin/hetero_infer_request.hpp index b6cb02c6dd04e7..db16c3e2bf5fa5 100644 --- a/inference-engine/src/hetero_plugin/hetero_infer_request.hpp +++ b/inference-engine/src/hetero_plugin/hetero_infer_request.hpp @@ -24,7 +24,7 @@ class HeteroInferRequest : public InferenceEngine::IInferRequestInternal { struct SubRequestDesc { InferenceEngine::SoExecutableNetworkInternal _network; - InferenceEngine::IInferRequestInternal::Ptr _request; + InferenceEngine::SoIInferRequestInternal _request; openvino::itt::handle_t _profilingTask; }; using SubRequestsList = std::vector; diff --git a/inference-engine/src/multi_device/multi_device_exec_network.cpp b/inference-engine/src/multi_device/multi_device_exec_network.cpp index 5265e233cfd0a0..56def8e98fe48e 100644 --- a/inference-engine/src/multi_device/multi_device_exec_network.cpp +++ b/inference-engine/src/multi_device/multi_device_exec_network.cpp @@ -82,7 +82,7 @@ MultiDeviceExecutableNetwork::MultiDeviceExecutableNetwork(const DeviceMapCreateInferRequest(); + workerRequest._inferRequest = { network, network->CreateInferRequest() }; auto* workerRequestPtr = &workerRequest; IE_ASSERT(idleWorkerRequests.try_push(workerRequestPtr) == true); workerRequest._inferRequest->SetCallback( @@ -177,7 +177,7 @@ InferenceEngine::IInferRequestInternal::Ptr MultiDeviceExecutableNetwork::Create InferenceEngine::OutputsDataMap networkOutputs) { auto num = _numRequestsCreated++; size_t sum = 0; - InferenceEngine::IInferRequestInternal::Ptr request_to_share_blobs_with; + InferenceEngine::SoIInferRequestInternal request_to_share_blobs_with; // borrowing device-specific blobs from the underlying requests for the device-agnostic, user-facing requests // this allows to potentially save on the data-copy later (if the requests are scheduled in the same order) for (const auto& device : _devicePrioritiesInitial) { diff --git a/inference-engine/src/multi_device/multi_device_exec_network.hpp b/inference-engine/src/multi_device/multi_device_exec_network.hpp index 39dd6e999c1f47..3a9516d6c3b039 100644 --- a/inference-engine/src/multi_device/multi_device_exec_network.hpp +++ b/inference-engine/src/multi_device/multi_device_exec_network.hpp @@ -99,9 +99,9 @@ class MultiDeviceExecutableNetwork : public InferenceEngine::ExecutableNetworkTh public: using Ptr = std::shared_ptr; struct WorkerInferRequest { - InferenceEngine::IInferRequestInternal::Ptr _inferRequest; - InferenceEngine::Task _task; - std::exception_ptr _exceptionPtr = nullptr; + InferenceEngine::SoIInferRequestInternal _inferRequest; + InferenceEngine::Task _task; + std::exception_ptr _exceptionPtr = nullptr; }; using NotBusyWorkerRequests = ThreadSafeBoundedQueue; diff --git a/inference-engine/src/multi_device/multi_device_infer_request.cpp b/inference-engine/src/multi_device/multi_device_infer_request.cpp index 5913a0b39d728f..de6540b88f0fc8 100644 --- a/inference-engine/src/multi_device/multi_device_infer_request.cpp +++ b/inference-engine/src/multi_device/multi_device_infer_request.cpp @@ -16,7 +16,7 @@ using namespace InferenceEngine; // ------------------------------MultiDeviceInferRequest---------------------------- MultiDeviceInferRequest::MultiDeviceInferRequest(const InputsDataMap& networkInputs, const OutputsDataMap& networkOutputs, - const IInferRequestInternal::Ptr & request_to_share_blobs_with) + const SoIInferRequestInternal & request_to_share_blobs_with) : IInferRequestInternal(networkInputs, networkOutputs) { if (request_to_share_blobs_with) { // borrow device-friendly blobs from the request @@ -48,7 +48,7 @@ MultiDeviceInferRequest::MultiDeviceInferRequest(const InputsDataMap& networkI } } -void MultiDeviceInferRequest::SetBlobsToAnotherRequest(const IInferRequestInternal::Ptr& req) { +void MultiDeviceInferRequest::SetBlobsToAnotherRequest(const SoIInferRequestInternal& req) { for (const auto &it : _networkInputs) { auto &name = it.first; // this request is already in BUSY state, so using the internal functions safely diff --git a/inference-engine/src/multi_device/multi_device_infer_request.hpp b/inference-engine/src/multi_device/multi_device_infer_request.hpp index 80f81c37e9c210..88dc0a07ae188e 100644 --- a/inference-engine/src/multi_device/multi_device_infer_request.hpp +++ b/inference-engine/src/multi_device/multi_device_infer_request.hpp @@ -25,11 +25,11 @@ class MultiDeviceInferRequest : public InferenceEngine::IInferRequestInternal { using Ptr = std::shared_ptr; explicit MultiDeviceInferRequest(const InferenceEngine::InputsDataMap& networkInputs, const InferenceEngine::OutputsDataMap& networkOutputs, - const InferenceEngine::IInferRequestInternal::Ptr & request_to_share_blobs_with); + const InferenceEngine::SoIInferRequestInternal & request_to_share_blobs_with); std::map GetPerformanceCounts() const override; void InferImpl() override; // Multi-Device impl specific: sets the data (blobs from the device-less requests to the specific device request) - void SetBlobsToAnotherRequest(const InferenceEngine::IInferRequestInternal::Ptr& req); + void SetBlobsToAnotherRequest(const InferenceEngine::SoIInferRequestInternal& req); }; } // namespace MultiDevicePlugin diff --git a/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_iexecutable_network_internal.hpp b/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_iexecutable_network_internal.hpp index fb1b961109d110..da55b2896c24e8 100644 --- a/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_iexecutable_network_internal.hpp +++ b/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_iexecutable_network_internal.hpp @@ -13,9 +13,12 @@ #include #include #include +#include
namespace InferenceEngine { + class IInferRequestInternal; + /** * @interface IExecutableNetworkInternal * @brief An internal API of executable network to be implemented by plugin, @@ -109,4 +112,9 @@ class IExecutableNetworkInternal : public std::enable_shared_from_this; + } // namespace InferenceEngine diff --git a/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp b/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp index bd43eab73d0a3f..864cd4dc6936e7 100644 --- a/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp +++ b/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp @@ -15,8 +15,10 @@ #include namespace InferenceEngine { + class IExecutableNetworkInternal; class IVariableStateInternal; + /** * @interface IInferRequestInternal * @brief An internal API of synchronous inference request to be implemented by plugin, @@ -212,7 +214,7 @@ class INFERENCE_ENGINE_API_CLASS(IInferRequestInternal) : public std::enable_sha int m_curBatch = -1; //!< Current batch value used in dynamic batching /** - * @brief A shared pointer to ExecutableNetworkInternal interface + * @brief A shared pointer to IInferRequestInternal * @note Needed to correctly handle ownership between objects. */ std::shared_ptr _exeNetwork; @@ -224,4 +226,9 @@ class INFERENCE_ENGINE_API_CLASS(IInferRequestInternal) : public std::enable_sha ~IInferRequestInternal(); }; +/** + * @brief SOPointer to IInferRequestInternal. + */ +using SoIInferRequestInternal = details::SOPointer; + } // namespace InferenceEngine diff --git a/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_ivariable_state_internal.hpp b/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_ivariable_state_internal.hpp index 4f31b57958275f..279ae854f73828 100644 --- a/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_ivariable_state_internal.hpp +++ b/inference-engine/src/plugin_api/cpp_interfaces/interface/ie_ivariable_state_internal.hpp @@ -5,6 +5,7 @@ #pragma once #include +#include
#include #include @@ -68,4 +69,9 @@ class IVariableStateInternal { */ using IMemoryStateInternal = IVariableStateInternal; +/** + * @brief SOPointer to IVariableStateInternal. + */ +using SoIVariableStateInternal = details::SOPointer; + } // namespace InferenceEngine diff --git a/inference-engine/src/plugin_api/ie_icore.hpp b/inference-engine/src/plugin_api/ie_icore.hpp index 7f3ed86ee384b5..1662b966de86e5 100644 --- a/inference-engine/src/plugin_api/ie_icore.hpp +++ b/inference-engine/src/plugin_api/ie_icore.hpp @@ -15,15 +15,12 @@ #include #include -#include -#include
+#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" #include "threading/ie_itask_executor.hpp" namespace InferenceEngine { -using SoExecutableNetworkInternal = details::SOPointer; - /** * @interface ICore * @brief Minimal ICore interface to allow plugin to get information from Core Inference Engine class.