diff --git a/inference-engine/include/cpp/ie_executable_network.hpp b/inference-engine/include/cpp/ie_executable_network.hpp index eb1824f9da041e..81d5b10e7dd4be 100644 --- a/inference-engine/include/cpp/ie_executable_network.hpp +++ b/inference-engine/include/cpp/ie_executable_network.hpp @@ -32,9 +32,6 @@ class IExecutableNetworkInternal; class INFERENCE_ENGINE_API_CLASS(ExecutableNetwork) { details::SharedObjectLoader _so; std::shared_ptr _impl; - IE_SUPPRESS_DEPRECATED_START - std::shared_ptr actual; - IE_SUPPRESS_DEPRECATED_END /** * @brief Constructs ExecutableNetwork from the initialized std::shared_ptr @@ -51,18 +48,6 @@ class INFERENCE_ENGINE_API_CLASS(ExecutableNetwork) { */ ExecutableNetwork() = default; - IE_SUPPRESS_DEPRECATED_START - /** - * @deprecated This ctor will be removed in 2022.1 - * @brief Constructs ExecutableNetwork from the initialized std::shared_ptr - * @param exec Initialized shared pointer - * @param splg Plugin to use. This is required to ensure that ExecutableNetwork can work properly even if plugin object is destroyed. - */ - INFERENCE_ENGINE_DEPRECATED("This ctor will be removed in 2022.1") - explicit ExecutableNetwork(std::shared_ptr exec, - std::shared_ptr splg = {}); - IE_SUPPRESS_DEPRECATED_END - /** * @brief Gets the Executable network output Data node information. * diff --git a/inference-engine/include/cpp/ie_infer_request.hpp b/inference-engine/include/cpp/ie_infer_request.hpp index fd71bf18bc2cc1..c5d52ec6fc0905 100644 --- a/inference-engine/include/cpp/ie_infer_request.hpp +++ b/inference-engine/include/cpp/ie_infer_request.hpp @@ -35,10 +35,6 @@ class ICompletionCallbackWrapper; class INFERENCE_ENGINE_API_CLASS(InferRequest) { details::SharedObjectLoader _so; std::shared_ptr _impl; - IE_SUPPRESS_DEPRECATED_START - IInferRequest::Ptr actual; - std::shared_ptr callback; - IE_SUPPRESS_DEPRECATED_END /** * @brief Constructs InferRequest from the initialized std::shared_ptr @@ -71,18 +67,6 @@ class INFERENCE_ENGINE_API_CLASS(InferRequest) { */ InferRequest() = default; - IE_SUPPRESS_DEPRECATED_START - /** - * @deprecated This ctor will be removed in 2022.1 - * @brief Constructs InferRequest from the initialized std::shared_ptr - * @param request Initialized shared pointer - * @param splg Plugin to use. This is required to ensure that InferRequest can work properly even if plugin object is destroyed. - */ - INFERENCE_ENGINE_DEPRECATED("This ctor will be removed in 2022.1") - explicit InferRequest(IInferRequest::Ptr request, - std::shared_ptr splg = {}); - IE_SUPPRESS_DEPRECATED_END - /** * @brief Sets input/output data to infer * diff --git a/inference-engine/include/cpp/ie_memory_state.hpp b/inference-engine/include/cpp/ie_memory_state.hpp index 0c055cec40cc79..8d54f79f06ce6a 100644 --- a/inference-engine/include/cpp/ie_memory_state.hpp +++ b/inference-engine/include/cpp/ie_memory_state.hpp @@ -3,7 +3,7 @@ // /** - * @brief A header file that provides wrapper classes for IVariableState + * @brief A header file that provides VariableState * * @file ie_memory_state.hpp */ @@ -16,21 +16,17 @@ #include "ie_api.h" #include "ie_blob.h" #include "details/ie_so_loader.h" -#include "ie_imemory_state.hpp" namespace InferenceEngine { class IVariableStateInternal; /** - * @brief C++ exception based error reporting wrapper of API class IVariableState + * @brief VariableState class */ class INFERENCE_ENGINE_API_CLASS(VariableState) { details::SharedObjectLoader _so; std::shared_ptr _impl; - IE_SUPPRESS_DEPRECATED_START - std::shared_ptr actual; - IE_SUPPRESS_DEPRECATED_END /** * @brief Constructs VariableState from the initialized std::shared_ptr @@ -48,55 +44,27 @@ class INFERENCE_ENGINE_API_CLASS(VariableState) { */ VariableState() = default; - IE_SUPPRESS_DEPRECATED_START /** - * @deprecated This ctor will be removed in 2022.1 - * @brief constructs VariableState from the initialized std::shared_ptr - * @param pState Initialized shared pointer - * @param plg Optional: Plugin to use. This is required to ensure that VariableState can work properly even if plugin object is destroyed. - */ - INFERENCE_ENGINE_DEPRECATED("This ctor will be removed in 2022.1") - explicit VariableState(std::shared_ptr pState, - std::shared_ptr plg = {}); - IE_SUPPRESS_DEPRECATED_END - - /** - * @copybrief IVariableState::Reset - * - * Wraps IVariableState::Reset + * @brief Reset internal variable state for relevant infer request, + * to a value specified as default for according ReadValue node */ void Reset(); /** - * @copybrief IVariableState::GetName - * - * Wraps IVariableState::GetName + * @brief Gets name of current variable state, if length of array is not enough name is truncated by len, null + * terminator is inserted as well. As variable state name `variable_id` from according `ReadValue` used. * @return A string representing a state name */ std::string GetName() const; /** - * @copybrief IVariableState::GetState - * - * Wraps IVariableState::GetState + * @brief Returns the value of the variable state. * @return A blob representing a state */ Blob::CPtr GetState() const; /** - * @copybrief IVariableState::GetLastState - * @deprecated Use IVariableState::SetState instead - * - * Wraps IVariableState::GetLastState - * @return A blob representing a last state - */ - INFERENCE_ENGINE_DEPRECATED("Use VariableState::GetState function instead") - Blob::CPtr GetLastState() const; - - /** - * @copybrief IVariableState::SetState - * - * Wraps IVariableState::SetState + * @brief Sets the new state for the next inference. * @param state The current state to set */ void SetState(Blob::Ptr state); diff --git a/inference-engine/include/ie_iexecutable_network.hpp b/inference-engine/include/ie_iexecutable_network.hpp index caef9bb95b95bd..bb0a6f71c4ac3f 100644 --- a/inference-engine/include/ie_iexecutable_network.hpp +++ b/inference-engine/include/ie_iexecutable_network.hpp @@ -18,7 +18,6 @@ #include "ie_common.h" #include "ie_icnn_network.hpp" #include "ie_iinfer_request.hpp" -#include "ie_imemory_state.hpp" #include "ie_input_info.hpp" #include "ie_parameter.hpp" #include "ie_remote_context.hpp" @@ -113,22 +112,6 @@ class INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::ExecutableNetwork instea INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::ExecutableNetwork::GetExecGraphInfo instead") virtual StatusCode GetExecGraphInfo(ICNNNetwork::Ptr& graphPtr, ResponseDesc* resp) noexcept = 0; - /** - * @deprecated Use InferRequest::QueryState instead - * @brief Gets state control interface for given executable network. - * - * State control essential for recurrent networks - * - * @param pState reference to a pointer that receives internal states - * @param idx requested index for receiving memory state - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success, OUT_OF_BOUNDS (-6) no memory state for - * given index - */ - INFERENCE_ENGINE_DEPRECATED("Use InferRequest::QueryState instead") - virtual StatusCode QueryState(IVariableState::Ptr& pState, size_t idx, ResponseDesc* resp) noexcept = 0; - IE_SUPPRESS_DEPRECATED_END - /** * @brief Sets configuration for current executable network * diff --git a/inference-engine/include/ie_iinfer_request.hpp b/inference-engine/include/ie_iinfer_request.hpp index 7d762d96a11305..4fd200c0252062 100644 --- a/inference-engine/include/ie_iinfer_request.hpp +++ b/inference-engine/include/ie_iinfer_request.hpp @@ -17,7 +17,6 @@ #include "ie_blob.h" #include "ie_common.h" #include "ie_preprocess.hpp" -#include "ie_imemory_state.hpp" namespace InferenceEngine { @@ -195,21 +194,6 @@ class INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::InferRequest C++ wrapper */ virtual InferenceEngine::StatusCode SetBatch(int batch_size, ResponseDesc* resp) noexcept = 0; - IE_SUPPRESS_DEPRECATED_START - /** - * @brief Gets state control interface for given infer request. - * - * State control essential for recurrent networks - * - * @param pState reference to a pointer that receives internal states - * @param idx requested index for receiving memory state - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success, OUT_OF_BOUNDS (-6) no memory state for - * given index - */ - virtual StatusCode QueryState(IVariableState::Ptr& pState, size_t idx, ResponseDesc* resp) noexcept = 0; - IE_SUPPRESS_DEPRECATED_END - protected: ~IInferRequest() = default; }; diff --git a/inference-engine/include/ie_imemory_state.hpp b/inference-engine/include/ie_imemory_state.hpp deleted file mode 100644 index 7f3ef99cbd11d3..00000000000000 --- a/inference-engine/include/ie_imemory_state.hpp +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (C) 2018-2021 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief a header file for IVariableState interface - * - * @file ie_imemory_state.hpp - */ - -#pragma once - -#include - -#include "ie_blob.h" -#include "ie_common.h" - -namespace InferenceEngine { - -/** - * @deprecated Use InferenceEngine::VariableState C++ wrapper instead - * @interface IVariableState - * @brief Manages data for reset operations - */ -class INFERENCE_ENGINE_DEPRECATED("InferenceEngine::") IVariableState { -public: - IE_SUPPRESS_DEPRECATED_START - /** - * @brief A shared pointer to the IVariableState interface - */ - using Ptr = std::shared_ptr; - IE_SUPPRESS_DEPRECATED_END - - /** - * @brief Gets name of current variable state, if length of array is not enough name is truncated by len, null - * terminator is inserted as well. As variable state name `variable_id` from according `ReadValue` used. - * - * @param name preallocated buffer for receiving name - * @param len Length of the buffer - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - virtual StatusCode GetName(char* name, size_t len, ResponseDesc* resp) const noexcept = 0; - - /** - * @brief Reset internal variable state for relevant infer request, to a value specified as default for according ReadValue node - * - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success* - */ - virtual StatusCode Reset(ResponseDesc* resp) noexcept = 0; - - /** - * @brief Sets the new state for the next inference. - * - * This method can fail if Blob size does not match the internal state size or precision - * - * @param newState The data to use as new state - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - virtual StatusCode SetState(Blob::Ptr newState, ResponseDesc* resp) noexcept = 0; - - /** - * @brief Returns the value of the variable state. - * - * @param state A reference to a blob containing a variable state - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - INFERENCE_ENGINE_DEPRECATED("Use GetState function instead") - virtual StatusCode GetLastState(Blob::CPtr& state, ResponseDesc* resp) const noexcept { - return GetState(state, resp); - } - - /** - * @brief Returns the value of the variable state. - * - * @param state A reference to a blob containing a variable state - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - virtual StatusCode GetState(Blob::CPtr& state, ResponseDesc* resp) const noexcept = 0; -}; - -IE_SUPPRESS_DEPRECATED_START - -/** - * @brief For compatibility reasons. - */ -using IMemoryState = IVariableState; - -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine \ No newline at end of file diff --git a/inference-engine/include/ie_parameter.hpp b/inference-engine/include/ie_parameter.hpp index 683f02fd6a552f..4aa6760d474874 100644 --- a/inference-engine/include/ie_parameter.hpp +++ b/inference-engine/include/ie_parameter.hpp @@ -49,26 +49,6 @@ class INFERENCE_ENGINE_API_CLASS(Parameter) { std::swap(ptr, parameter.ptr); } - /** - * @deprecated Use ngraph::Variant directly - * @brief Creates parameter from variant. - * This method creates empty parameter if variant doesn't contain Parameter - * - * @param var ngraph variant - */ - INFERENCE_ENGINE_DEPRECATED("Use ngraph::Variant directly") - Parameter(const std::shared_ptr& var); - - /** - * @deprecated Use ngraph::Variant directly - * @brief Creates parameter from variant. - * This method creates empty parameter if variant doesn't contain Parameter - * - * @param var ngraph variant - */ - INFERENCE_ENGINE_DEPRECATED("Use ngraph::Variant directly") - Parameter(std::shared_ptr& var); - /** * @brief Copy constructor * @@ -204,28 +184,6 @@ class INFERENCE_ENGINE_API_CLASS(Parameter) { return dyn_cast::type>(ptr); } - /** - * @deprecated Use ngraph::Variant directly - * @brief Converts parameter to shared pointer on ngraph::Variant - * - * @return shared pointer on ngraph::Variant - */ - INFERENCE_ENGINE_DEPRECATED("Use ngraph::Variant directly") - std::shared_ptr asVariant() const; - - /** - * @deprecated Use ngraph::Variant directly - * @brief Casts to shared pointer on ngraph::Variant - * - * @return shared pointer on ngraph::Variant - */ - INFERENCE_ENGINE_DEPRECATED("Use ngraph::Variant directly") - operator std::shared_ptr() const { - IE_SUPPRESS_DEPRECATED_START - return asVariant(); - IE_SUPPRESS_DEPRECATED_END - } - /** * Dynamic cast to specified type * @tparam T type diff --git a/inference-engine/include/ie_unicode.hpp b/inference-engine/include/ie_unicode.hpp deleted file mode 100644 index dc943d6f558be5..00000000000000 --- a/inference-engine/include/ie_unicode.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (C) 2018-2021 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief This is a header file with common inference engine definitions - * - * @file ie_unicode.hpp - */ -#pragma once - -#include -#include -#include -#include -#include -#include - -#ifdef UNICODE -typedef wchar_t tchar; -typedef std::wstring file_name_t; -#else -typedef char tchar; -typedef std::string file_name_t; -#endif - -namespace InferenceEngine { - -/** - * @deprecated Use OS-native conversion utilities - * @brief Conversion from possibly-wide character string to a single-byte chain. - * @param str A possibly-wide character string - * @return A single-byte character string - */ -INFERENCE_ENGINE_DEPRECATED("Use OS-native conversion utilities") -inline std::string fileNameToString(const file_name_t& str) { -#ifdef UNICODE - size_t maxlen = (str.length() + 1) * sizeof(wchar_t) / sizeof(char); - std::vector mbstr(maxlen); - mbstr[0] = 0; - std::wcstombs(&mbstr[0], str.c_str(), maxlen); - std::string res = std::string(&mbstr[0]); - return res; -#else - return str; -#endif -} - -/** - * @deprecated Use OS-native conversion utilities - * @brief Conversion from single-byte character string to a possibly-wide one - * @param str A single-byte character string - * @return A possibly-wide character string - */ -INFERENCE_ENGINE_DEPRECATED("Use OS-native conversion utilities") -inline file_name_t stringToFileName(const std::string& str) { -#ifdef UNICODE - size_t maxlen = str.length() + 1; - std::vector wcstr(maxlen); - wcstr[0] = 0; - std::mbstowcs(&wcstr[0], str.c_str(), maxlen); - file_name_t res = file_name_t(&wcstr[0]); - return res; -#else - return str; -#endif -} - -} // namespace InferenceEngine diff --git a/inference-engine/src/inference_engine/cpp/ie_executable_network.cpp b/inference-engine/src/inference_engine/cpp/ie_executable_network.cpp index 6de781d11e62ec..a4afee5a28ba2b 100644 --- a/inference-engine/src/inference_engine/cpp/ie_executable_network.cpp +++ b/inference-engine/src/inference_engine/cpp/ie_executable_network.cpp @@ -25,47 +25,15 @@ ExecutableNetwork::ExecutableNetwork(const details::SharedObjectLoader& so, IE_SUPPRESS_DEPRECATED_START -ExecutableNetwork::ExecutableNetwork(IExecutableNetwork::Ptr exec, - std::shared_ptr splg) - : _so(), _impl(), actual(exec) { - if (splg) { - _so = *splg; - } - - // plg can be null, but not the actual - if (actual == nullptr) - IE_THROW(NotAllocated) << "ExecutableNetwork was not initialized."; -} - ConstOutputsDataMap ExecutableNetwork::GetOutputsInfo() const { - if (actual) { - ConstOutputsDataMap data; - CALL_STATUS_FNC(GetOutputsInfo, data); - return data; - } - EXEC_NET_CALL_STATEMENT(return _impl->GetOutputsInfo()); } ConstInputsDataMap ExecutableNetwork::GetInputsInfo() const { - if (actual) { - ConstInputsDataMap info; - CALL_STATUS_FNC(GetInputsInfo, info); - return info; - } - EXEC_NET_CALL_STATEMENT(return _impl->GetInputsInfo()); } void ExecutableNetwork::reset(IExecutableNetwork::Ptr newActual) { - if (actual) { - if (newActual == nullptr) { - THROW_IE_EXCEPTION << "ExecutableNetwork wrapper used for reset was not initialized."; - } - this->actual.swap(newActual); - return; - } - if (_impl == nullptr) IE_THROW() << "ExecutableNetwork was not initialized."; if (newActual == nullptr) IE_THROW() << "ExecutableNetwork wrapper used for reset was not initialized."; auto newBase = std::dynamic_pointer_cast(newActual); @@ -76,36 +44,10 @@ void ExecutableNetwork::reset(IExecutableNetwork::Ptr newActual) { } ExecutableNetwork::operator IExecutableNetwork::Ptr() { - if (actual) { - return actual; - } - return std::make_shared(_impl); } std::vector ExecutableNetwork::QueryState() { - if (actual) { - if (actual == nullptr) THROW_IE_EXCEPTION << "ExecutableNetwork was not initialized."; - IVariableState::Ptr pState = nullptr; - auto res = OK; - std::vector controller; - for (size_t idx = 0; res == OK; ++idx) { - ResponseDesc resp; - IE_SUPPRESS_DEPRECATED_START - res = actual->QueryState(pState, idx, &resp); - IE_SUPPRESS_DEPRECATED_END - if (res != OK && res != OUT_OF_BOUNDS) { - THROW_IE_EXCEPTION << resp.msg; - } - if (res != OUT_OF_BOUNDS) { - controller.push_back(VariableState(pState, - std::make_shared(_so))); - } - } - - return controller; - } - std::vector controller; EXEC_NET_CALL_STATEMENT( for (auto&& state : _impl->QueryState()) { @@ -115,13 +57,6 @@ std::vector ExecutableNetwork::QueryState() { } InferRequest ExecutableNetwork::CreateInferRequest() { - if (actual) { - IInferRequest::Ptr req; - CALL_STATUS_FNC(CreateInferRequest, req); - if (req.get() == nullptr) THROW_IE_EXCEPTION << "Internal error: pointer to infer request is null"; - return InferRequest(req, std::make_shared(_so)); - } - EXEC_NET_CALL_STATEMENT(return {_so, _impl->CreateInferRequest()}); } @@ -130,72 +65,38 @@ InferRequest::Ptr ExecutableNetwork::CreateInferRequestPtr() { } void ExecutableNetwork::Export(const std::string& modelFileName) { - if (actual) { - CALL_STATUS_FNC(Export, modelFileName); - return; - } EXEC_NET_CALL_STATEMENT(_impl->Export(modelFileName)); } void ExecutableNetwork::Export(std::ostream& networkModel) { - if (actual) { - CALL_STATUS_FNC(Export, networkModel); - return; - } EXEC_NET_CALL_STATEMENT(_impl->Export(networkModel)); } CNNNetwork ExecutableNetwork::GetExecGraphInfo() { - if (actual) { - IE_SUPPRESS_DEPRECATED_START - ICNNNetwork::Ptr ptr = nullptr; - CALL_STATUS_FNC(GetExecGraphInfo, ptr); - return CNNNetwork(ptr); - IE_SUPPRESS_DEPRECATED_END - } EXEC_NET_CALL_STATEMENT(return _impl->GetExecGraphInfo()); } void ExecutableNetwork::SetConfig(const std::map& config) { - if (actual) { - CALL_STATUS_FNC(SetConfig, config); - return; - } EXEC_NET_CALL_STATEMENT(_impl->SetConfig(config)); } Parameter ExecutableNetwork::GetConfig(const std::string& name) const { - if (actual) { - Parameter configValue; - CALL_STATUS_FNC(GetConfig, name, configValue); - return configValue; - } EXEC_NET_CALL_STATEMENT(return _impl->GetConfig(name)); } Parameter ExecutableNetwork::GetMetric(const std::string& name) const { - if (actual) { - Parameter metricValue; - CALL_STATUS_FNC(GetMetric, name, metricValue); - return metricValue; - } EXEC_NET_CALL_STATEMENT(return _impl->GetMetric(name)); } RemoteContext::Ptr ExecutableNetwork::GetContext() const { - if (actual) { - RemoteContext::Ptr pContext; - CALL_STATUS_FNC(GetContext, pContext); - return pContext; - } EXEC_NET_CALL_STATEMENT(return _impl->GetContext()); } bool ExecutableNetwork::operator!() const noexcept { - return !_impl || !actual; + return !_impl; } ExecutableNetwork::operator bool() const noexcept { - return !!_impl || !!actual; + return !!_impl; } } // namespace InferenceEngine diff --git a/inference-engine/src/inference_engine/cpp/ie_executable_network_base.hpp b/inference-engine/src/inference_engine/cpp/ie_executable_network_base.hpp index 2f813c0b783560..c87b1fc7098a2c 100644 --- a/inference-engine/src/inference_engine/cpp/ie_executable_network_base.hpp +++ b/inference-engine/src/inference_engine/cpp/ie_executable_network_base.hpp @@ -18,7 +18,6 @@ #include #include #include "cpp/exception2status.hpp" -#include "ie_variable_state_base.hpp" #include "ie_infer_async_request_base.hpp" namespace InferenceEngine { @@ -64,29 +63,10 @@ class ExecutableNetworkBase : public IExecutableNetwork { TO_STATUS(_impl->Export(networkModel)); } - IE_SUPPRESS_DEPRECATED_START StatusCode GetExecGraphInfo(ICNNNetwork::Ptr& graphPtr, ResponseDesc* resp) noexcept override { - // should be refactored together with ExecutableNetwork interface TO_STATUS(graphPtr = _impl->GetExecGraphInfo()); } - INFERENCE_ENGINE_DEPRECATED("Use InferRequest::QueryState instead") - StatusCode QueryState(IVariableState::Ptr& pState, size_t idx, ResponseDesc* resp) noexcept override { - try { - auto v = _impl->QueryState(); - if (idx >= v.size()) { - return OUT_OF_BOUNDS; - } - pState = std::make_shared(v[idx]); - return OK; - } catch (const std::exception& ex) { - return InferenceEngine::DescriptionBuffer(GENERAL_ERROR, resp) << ex.what(); - } catch (...) { - return InferenceEngine::DescriptionBuffer(UNEXPECTED); - } - } - IE_SUPPRESS_DEPRECATED_END - StatusCode SetConfig(const std::map& config, ResponseDesc* resp) noexcept override { TO_STATUS(_impl->SetConfig(config)); } diff --git a/inference-engine/src/inference_engine/cpp/ie_infer_async_request_base.hpp b/inference-engine/src/inference_engine/cpp/ie_infer_async_request_base.hpp index 1253947eeafd15..6ede78f720e3a2 100644 --- a/inference-engine/src/inference_engine/cpp/ie_infer_async_request_base.hpp +++ b/inference-engine/src/inference_engine/cpp/ie_infer_async_request_base.hpp @@ -10,10 +10,10 @@ #include "cpp/exception2status.hpp" #include "cpp_interfaces/plugin_itt.hpp" -#include "ie_variable_state_base.hpp" #include #include "ie_iinfer_request.hpp" #include "ie_preprocess.hpp" + namespace InferenceEngine { #define CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(StatusCode, ExceptionType) catch (const ExceptionType& ex) { \ @@ -169,23 +169,6 @@ class InferRequestBase : public IInferRequest { StatusCode SetBatch(int batch_size, ResponseDesc* resp) noexcept override { TO_STATUS(_impl->SetBatch(batch_size)); } - - IE_SUPPRESS_DEPRECATED_START - StatusCode QueryState(IVariableState::Ptr& pState, size_t idx, ResponseDesc* resp) noexcept override { - try { - auto v = _impl->QueryState(); - if (idx >= v.size()) { - return OUT_OF_BOUNDS; - } - pState = std::make_shared(v[idx]); - return OK; - } catch (const std::exception& ex) { - return InferenceEngine::DescriptionBuffer(GENERAL_ERROR, resp) << ex.what(); - } catch (...) { - return InferenceEngine::DescriptionBuffer(UNEXPECTED); - } - } - IE_SUPPRESS_DEPRECATED_END }; IE_SUPPRESS_DEPRECATED_END diff --git a/inference-engine/src/inference_engine/cpp/ie_infer_request.cpp b/inference-engine/src/inference_engine/cpp/ie_infer_request.cpp index 97fba9af7f924f..9e68666b7a36f6 100644 --- a/inference-engine/src/inference_engine/cpp/ie_infer_request.cpp +++ b/inference-engine/src/inference_engine/cpp/ie_infer_request.cpp @@ -23,44 +23,17 @@ namespace InferenceEngine { InferRequest::InferRequest(const details::SharedObjectLoader& so, const IInferRequestInternal::Ptr& impl) - : _so(so), _impl(impl), actual() { + : _so(so), _impl(impl) { IE_ASSERT(_impl != nullptr); } IE_SUPPRESS_DEPRECATED_START -InferRequest::InferRequest(IInferRequest::Ptr request, - std::shared_ptr splg) - : _so(), _impl(), actual(request) { - if (splg) { - _so = *splg; - } - - // plg can be null, but not the actual - if (actual == nullptr) - IE_THROW(NotAllocated) << "InferRequest was not initialized."; -} - void InferRequest::SetBlob(const std::string& name, const Blob::Ptr& data) { - if (actual) { - CALL_STATUS_FNC(SetBlob, name.c_str(), data); - return; - } INFER_REQ_CALL_STATEMENT(_impl->SetBlob(name, data);) } Blob::Ptr InferRequest::GetBlob(const std::string& name) { - if (actual) { - Blob::Ptr data; - CALL_STATUS_FNC(GetBlob, name.c_str(), data); - std::string error = "Internal error: blob with name `" + name + "` is not allocated!"; - auto blobPtr = data.get(); - const bool remoteBlobPassed = blobPtr->is(); - if (blobPtr == nullptr) IE_THROW() << error; - if (!remoteBlobPassed && blobPtr->buffer() == nullptr) IE_THROW() << error; - return data; - } - Blob::Ptr blobPtr; INFER_REQ_CALL_STATEMENT(blobPtr = _impl->GetBlob(name);) std::string error = "Internal error: blob with name `" + name + "` is not allocated!"; @@ -71,60 +44,26 @@ Blob::Ptr InferRequest::GetBlob(const std::string& name) { } void InferRequest::SetBlob(const std::string &name, const Blob::Ptr &data, const PreProcessInfo& info) { - if (actual) { - CALL_STATUS_FNC(SetBlob, name.c_str(), data, info); - return; - } - INFER_REQ_CALL_STATEMENT(_impl->SetBlob(name, data, info);) } const PreProcessInfo& InferRequest::GetPreProcess(const std::string& name) const { - if (actual) { - const PreProcessInfo* info = nullptr; - CALL_STATUS_FNC(GetPreProcess, name.c_str(), &info); - return *info; - } - INFER_REQ_CALL_STATEMENT(return _impl->GetPreProcess(name);) } void InferRequest::Infer() { - if (actual) { - CALL_STATUS_FNC_NO_ARGS(Infer); - return; - } - INFER_REQ_CALL_STATEMENT(_impl->Infer();) } void InferRequest::Cancel() { - if (actual) { - CALL_STATUS_FNC_NO_ARGS(Cancel); - return; - } - INFER_REQ_CALL_STATEMENT(_impl->Cancel();) } std::map InferRequest::GetPerformanceCounts() const { - if (actual) { - std::map perfMap; - CALL_STATUS_FNC(GetPerformanceCounts, perfMap); - return perfMap; - } - INFER_REQ_CALL_STATEMENT(return _impl->GetPerformanceCounts();) } void InferRequest::SetInput(const BlobMap& inputs) { - if (actual) { - for (auto&& input : inputs) { - CALL_STATUS_FNC(SetBlob, input.first.c_str(), input.second); - } - return; - } - INFER_REQ_CALL_STATEMENT( for (auto&& input : inputs) { _impl->SetBlob(input.first, input.second); @@ -133,13 +72,6 @@ void InferRequest::SetInput(const BlobMap& inputs) { } void InferRequest::SetOutput(const BlobMap& results) { - if (actual) { - for (auto&& result : results) { - CALL_STATUS_FNC(SetBlob, result.first.c_str(), result.second); - } - return; - } - INFER_REQ_CALL_STATEMENT( for (auto&& result : results) { _impl->SetBlob(result.first, result.second); @@ -148,106 +80,19 @@ void InferRequest::SetOutput(const BlobMap& results) { } void InferRequest::SetBatch(const int batch) { - if (actual) { - CALL_STATUS_FNC(SetBatch, batch); - return; - } - INFER_REQ_CALL_STATEMENT(_impl->SetBatch(batch);) } void InferRequest::StartAsync() { - if (actual) { - CALL_STATUS_FNC_NO_ARGS(StartAsync); - return; - } - INFER_REQ_CALL_STATEMENT(_impl->StartAsync();) } StatusCode InferRequest::Wait(int64_t millis_timeout) { - if (actual) { - ResponseDesc resp; - if (actual == nullptr) IE_THROW() << "InferRequest was not initialized."; - auto res = actual->Wait(millis_timeout, &resp); - if (res != OK && res != RESULT_NOT_READY && - res != INFER_NOT_STARTED && res != INFER_CANCELLED) { - IE_EXCEPTION_SWITCH(res, ExceptionType, - InferenceEngine::details::ThrowNow{} - <<= std::stringstream{} << IE_LOCATION << resp.msg) - } - return res; - } - INFER_REQ_CALL_STATEMENT(return _impl->Wait(millis_timeout);) } -namespace details { - -class ICompletionCallbackWrapper { -public: - virtual ~ICompletionCallbackWrapper() = default; - - virtual void call(InferenceEngine::IInferRequest::Ptr request, InferenceEngine::StatusCode code) const noexcept = 0; -}; - -template -class CompletionCallbackWrapper : public ICompletionCallbackWrapper { - T lambda; - -public: - explicit CompletionCallbackWrapper(const T& lambda): lambda(lambda) {} - - void call(InferenceEngine::IInferRequest::Ptr /*request*/, InferenceEngine::StatusCode /*code*/) const - noexcept override { - lambda(); - } -}; - -template <> -class CompletionCallbackWrapper : public ICompletionCallbackWrapper { - IInferRequest::CompletionCallback callBack; - -public: - explicit CompletionCallbackWrapper(const IInferRequest::CompletionCallback& callBack): callBack(callBack) {} - - void call(InferenceEngine::IInferRequest::Ptr request, InferenceEngine::StatusCode code) const noexcept override { - callBack(request, code); - } -}; - -template <> -class CompletionCallbackWrapper> : public ICompletionCallbackWrapper { - std::function lambda; - -public: - explicit CompletionCallbackWrapper(const std::function& lambda) - : lambda(lambda) {} - - void call(InferenceEngine::IInferRequest::Ptr request, InferenceEngine::StatusCode code) const noexcept override { - lambda(InferRequest(request), code); - } -}; - -void callWrapper(InferenceEngine::IInferRequest::Ptr request, InferenceEngine::StatusCode code) { - details::ICompletionCallbackWrapper* pWrapper = nullptr; - ResponseDesc dsc; - request->GetUserData(reinterpret_cast(&pWrapper), &dsc); - pWrapper->call(request, code); -} - -} // namespace details - void InferRequest::SetCompletionCallbackImpl(std::function callbackToSet) { - if (actual) { - using T = std::function; - callback.reset(new details::CompletionCallbackWrapper(callbackToSet)); - CALL_STATUS_FNC(SetUserData, callback.get()); - actual->SetCompletionCallback(InferenceEngine::details::callWrapper); - return; - } - INFER_REQ_CALL_STATEMENT( _impl->SetCallback([callbackToSet] (std::exception_ptr) { callbackToSet(); @@ -274,14 +119,6 @@ void InferRequest::SetCompletionCallbackImpl(std::function callbackToSet void InferRequest::SetCompletionCallbackImpl(std::function callbackToSet) { - if (actual) { - using T = std::function; - callback.reset(new details::CompletionCallbackWrapper(callbackToSet)); - CALL_STATUS_FNC(SetUserData, callback.get()); - actual->SetCompletionCallback(InferenceEngine::details::callWrapper); - return; - } - INFER_REQ_CALL_STATEMENT( auto weakThis = InferRequest{_so, std::shared_ptr{_impl.get(), [](IInferRequestInternal*){}}}; _impl->SetCallback([callbackToSet, weakThis] (std::exception_ptr exceptionPtr) { @@ -303,14 +140,6 @@ void InferRequest::SetCompletionCallbackImpl(std::function(callbackToSet)); - CALL_STATUS_FNC(SetUserData, callback.get()); - actual->SetCompletionCallback(InferenceEngine::details::callWrapper); - return; - } - INFER_REQ_CALL_STATEMENT( IInferRequest::Ptr weakThis = InferRequest{_so, std::shared_ptr{_impl.get(), [](IInferRequestInternal*){}}}; _impl->SetCallback([callbackToSet, weakThis] (std::exception_ptr exceptionPtr) { @@ -332,38 +161,12 @@ void InferRequest::SetCompletionCallbackImpl(IInferRequest::CompletionCallback c } InferRequest::operator IInferRequest::Ptr () { - if (actual) { - return actual; - } - INFER_REQ_CALL_STATEMENT( return std::make_shared(_impl); ) } std::vector InferRequest::QueryState() { - if (actual) { - IE_SUPPRESS_DEPRECATED_START - if (actual == nullptr) IE_THROW() << "ExecutableNetwork was not initialized."; - IVariableState::Ptr pState = nullptr; - auto res = OK; - std::vector controller; - for (size_t idx = 0; res == OK; ++idx) { - ResponseDesc resp; - res = actual->QueryState(pState, idx, &resp); - if (res != OK && res != OUT_OF_BOUNDS) { - IE_THROW() << resp.msg; - } - if (res != OUT_OF_BOUNDS) { - controller.push_back(VariableState(pState, - std::make_shared(_so))); - } - } - IE_SUPPRESS_DEPRECATED_END - - return controller; - } - std::vector controller; INFER_REQ_CALL_STATEMENT( for (auto&& state : _impl->QueryState()) { @@ -374,11 +177,11 @@ std::vector InferRequest::QueryState() { } bool InferRequest::operator!() const noexcept { - return !_impl || !actual; + return !_impl; } InferRequest::operator bool() const noexcept { - return (!!_impl) || (!!actual); + return (!!_impl); } bool InferRequest::operator!=(const InferRequest& r) const noexcept { @@ -386,7 +189,7 @@ bool InferRequest::operator!=(const InferRequest& r) const noexcept { } bool InferRequest::operator==(const InferRequest& r) const noexcept { - return r._impl == _impl && r.actual == actual; + return r._impl == _impl; } } // namespace InferenceEngine diff --git a/inference-engine/src/inference_engine/cpp/ie_variable_state.cpp b/inference-engine/src/inference_engine/cpp/ie_variable_state.cpp index 46f99d3fc6c1d0..63f7305e8b2b38 100644 --- a/inference-engine/src/inference_engine/cpp/ie_variable_state.cpp +++ b/inference-engine/src/inference_engine/cpp/ie_variable_state.cpp @@ -4,7 +4,6 @@ #include "details/ie_so_loader.h" #include "cpp/ie_memory_state.hpp" -#include "ie_imemory_state.hpp" #include "cpp_interfaces/interface/ie_ivariable_state_internal.hpp" #include "exception2status.hpp" @@ -24,57 +23,19 @@ VariableState::VariableState(const details::SharedObjectLoader& so, IE_SUPPRESS_DEPRECATED_START -VariableState::VariableState(std::shared_ptr state, - std::shared_ptr splg) - : _so(), _impl(), actual(state) { - if (splg) { - _so = *splg; - } - - // plg can be null, but not the actual - if (actual == nullptr) - IE_THROW(NotAllocated) << "VariableState was not initialized."; -} - -Blob::CPtr VariableState::GetLastState() const { - return GetState(); -} - void VariableState::Reset() { - if (actual) { - CALL_STATUS_FNC_NO_ARGS(Reset); - return; - } - VARIABLE_CALL_STATEMENT(_impl->Reset()); } std::string VariableState::GetName() const { - if (actual) { - char name[256]; - CALL_STATUS_FNC(GetName, name, sizeof(name)); - return name; - } - VARIABLE_CALL_STATEMENT(return _impl->GetName()); } Blob::CPtr VariableState::GetState() const { - if (actual) { - Blob::CPtr stateBlob; - CALL_STATUS_FNC(GetState, stateBlob); - return stateBlob; - } - VARIABLE_CALL_STATEMENT(return _impl->GetState()); } void VariableState::SetState(Blob::Ptr state) { - if (actual) { - CALL_STATUS_FNC(SetState, state); - return; - } - VARIABLE_CALL_STATEMENT(_impl->SetState(state)); } diff --git a/inference-engine/src/inference_engine/cpp/ie_variable_state_base.hpp b/inference-engine/src/inference_engine/cpp/ie_variable_state_base.hpp deleted file mode 100644 index 2481ca67852ddb..00000000000000 --- a/inference-engine/src/inference_engine/cpp/ie_variable_state_base.hpp +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (C) 2018-2021 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include - -#include "cpp/exception2status.hpp" -#include "cpp_interfaces/interface/ie_ivariable_state_internal.hpp" -#include "ie_imemory_state.hpp" - -namespace InferenceEngine { - -IE_SUPPRESS_DEPRECATED_START - -/** - * @brief Default implementation for IVariableState - * @ingroup ie_dev_api_variable_state_api - */ -class VariableStateBase : public IVariableState { - std::shared_ptr impl; - -public: - /** - * @brief Constructor with actual underlying implementation. - * @param impl Underlying implementation of type IVariableStateInternal - */ - explicit VariableStateBase(std::shared_ptr impl): impl(impl) { - if (impl == nullptr) { - IE_THROW() << "VariableStateBase implementation is not defined"; - } - } - - StatusCode GetName(char* name, size_t len, ResponseDesc* resp) const noexcept override { - for (size_t i = 0; i != len; i++) { - name[i] = 0; - } - DescriptionBuffer buf(name, len); - TO_STATUS(buf << impl->GetName()); - return OK; - } - - StatusCode Reset(ResponseDesc* resp) noexcept override { - TO_STATUS(impl->Reset()); - } - - StatusCode SetState(Blob::Ptr newState, ResponseDesc* resp) noexcept override { - TO_STATUS(impl->SetState(newState)); - } - - StatusCode GetState(Blob::CPtr& state, ResponseDesc* resp) const noexcept override { - TO_STATUS(state = impl->GetState()); - } -}; - -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine diff --git a/inference-engine/src/inference_engine/cpp_interfaces/interface/ie_ivariable_state_internal.cpp b/inference-engine/src/inference_engine/cpp_interfaces/interface/ie_ivariable_state_internal.cpp index 0171292d36bbdc..a499e816ee0b2c 100644 --- a/inference-engine/src/inference_engine/cpp_interfaces/interface/ie_ivariable_state_internal.cpp +++ b/inference-engine/src/inference_engine/cpp_interfaces/interface/ie_ivariable_state_internal.cpp @@ -23,7 +23,4 @@ Blob::CPtr IVariableStateInternal::GetState() const { return state; } -Blob::CPtr IVariableStateInternal::GetLastState() const { - return GetState(); -} } // namespace InferenceEngine diff --git a/inference-engine/src/inference_engine/ie_parameter.cpp b/inference-engine/src/inference_engine/ie_parameter.cpp deleted file mode 100644 index 61fbf54c37dcc2..00000000000000 --- a/inference-engine/src/inference_engine/ie_parameter.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (C) 2018-2021 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include - -#include - -namespace ngraph { - -template class INFERENCE_ENGINE_API_CLASS(VariantImpl); - -template <> -class INFERENCE_ENGINE_API_CLASS(VariantWrapper) : public VariantImpl { -public: - static constexpr VariantTypeInfo type_info {"Variant::InferenceEngine::Parameter", 0}; - const VariantTypeInfo& get_type_info() const override { - return type_info; - } - VariantWrapper(const value_type& value): VariantImpl(value) {} // NOLINT -}; - -} // namespace ngraph - -constexpr ngraph::VariantTypeInfo ngraph::VariantWrapper::type_info; - -InferenceEngine::Parameter::Parameter(const std::shared_ptr& var) { - if (auto paramWrapper = std::dynamic_pointer_cast>(var)) { - auto param = paramWrapper->get(); - if (!param.empty()) ptr = param.ptr->copy(); - } -} - -InferenceEngine::Parameter::Parameter(std::shared_ptr& var) { - if (auto paramWrapper = std::dynamic_pointer_cast>(var)) { - auto param = paramWrapper->get(); - if (!param.empty()) ptr = param.ptr->copy(); - } -} - - -std::shared_ptr InferenceEngine::Parameter::asVariant() const { - return std::make_shared>(*this); -} 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 f92fd556f00f45..d34af53631a556 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 @@ -50,14 +50,6 @@ class INFERENCE_ENGINE_API_CLASS(IVariableStateInternal) : public std::enable_sh */ virtual Blob::CPtr GetState() const; - /** - * @deprecated Use IVariableStateInternal::GetState method instead - * @brief Returns the value of the variable state. - * @return The value of the variable state - */ - INFERENCE_ENGINE_DEPRECATED("Use IVariableStateInternal::GetState method instead") - virtual Blob::CPtr GetLastState() const; - protected: /** * @brief A default dtor diff --git a/inference-engine/tests/functional/inference_engine/async_infer_request_test.cpp b/inference-engine/tests/functional/inference_engine/async_infer_request_test.cpp index cc5cc1fe4eb826..6393aa69d16199 100644 --- a/inference-engine/tests/functional/inference_engine/async_infer_request_test.cpp +++ b/inference-engine/tests/functional/inference_engine/async_infer_request_test.cpp @@ -5,26 +5,12 @@ #include #include -#include "unit_test_utils/mocks/mock_iinfer_request.hpp" using namespace ::testing; using namespace std; using namespace InferenceEngine; using namespace InferenceEngine::details; -IE_SUPPRESS_DEPRECATED_START - -TEST(InferRequestCPPTests, throwsOnUninitialized) { - std::shared_ptr ptr; - ASSERT_THROW(InferRequest req(ptr), InferenceEngine::NotAllocated); -} - -TEST(InferRequestCPPTests, nothrowOnInitialized) { - std::shared_ptr ptr = std::make_shared(); - ASSERT_NO_THROW(InferRequest req(ptr)); -} - -IE_SUPPRESS_DEPRECATED_END TEST(InferRequestCPPTests, throwsOnUninitializedSetBlob) { InferRequest req; diff --git a/inference-engine/tests/functional/inference_engine/executable_network.cpp b/inference-engine/tests/functional/inference_engine/executable_network.cpp index 8db2bf40ed2402..89653bdc5ee7f1 100644 --- a/inference-engine/tests/functional/inference_engine/executable_network.cpp +++ b/inference-engine/tests/functional/inference_engine/executable_network.cpp @@ -4,75 +4,60 @@ #include #include -#include "unit_test_utils/mocks/mock_iexecutable_network.hpp" using namespace ::testing; using namespace std; using namespace InferenceEngine; using namespace InferenceEngine::details; -IE_SUPPRESS_DEPRECATED_START - -TEST(ExecutableNetworkTests, throwsOnUninitialized) { - std::shared_ptr ptr; - ASSERT_THROW(ExecutableNetwork req(ptr), InferenceEngine::NotAllocated); -} - -TEST(ExecutableNetworkTests, nothrowOnInitialized) { - std::shared_ptr ptr = std::make_shared(); - ASSERT_NO_THROW(ExecutableNetwork req(ptr)); -} - -IE_SUPPRESS_DEPRECATED_END - TEST(ExecutableNetworkTests, throwsOnUninitializedGetOutputsInfo) { ExecutableNetwork exec; - ASSERT_THROW(exec.GetOutputsInfo(), InferenceEngine::Exception); + ASSERT_THROW(exec.GetOutputsInfo(), InferenceEngine::NotAllocated); } TEST(ExecutableNetworkTests, throwsOnUninitializedGetInputsInfo) { ExecutableNetwork exec; - ASSERT_THROW(exec.GetInputsInfo(), InferenceEngine::Exception); + ASSERT_THROW(exec.GetInputsInfo(), InferenceEngine::NotAllocated); } TEST(ExecutableNetworkTests, throwsOnUninitializedExport) { ExecutableNetwork exec; - ASSERT_THROW(exec.Export(std::string()), InferenceEngine::Exception); + ASSERT_THROW(exec.Export(std::string()), InferenceEngine::NotAllocated); } TEST(ExecutableNetworkTests, throwsOnUninitializedExportStream) { ExecutableNetwork exec; - ASSERT_THROW(exec.Export(std::cout), InferenceEngine::Exception); + ASSERT_THROW(exec.Export(std::cout), InferenceEngine::NotAllocated); } TEST(ExecutableNetworkTests, throwsOnUninitializedGetExecGraphInfo) { ExecutableNetwork exec; - ASSERT_THROW(exec.GetExecGraphInfo(), InferenceEngine::Exception); + ASSERT_THROW(exec.GetExecGraphInfo(), InferenceEngine::NotAllocated); } TEST(ExecutableNetworkTests, throwsOnUninitializedQueryState) { IE_SUPPRESS_DEPRECATED_START ExecutableNetwork exec; - ASSERT_THROW(exec.QueryState(), InferenceEngine::Exception); + ASSERT_THROW(exec.QueryState(), InferenceEngine::NotAllocated); IE_SUPPRESS_DEPRECATED_END } TEST(ExecutableNetworkTests, throwsOnUninitializedSetConfig) { ExecutableNetwork exec; - ASSERT_THROW(exec.SetConfig({{}}), InferenceEngine::Exception); + ASSERT_THROW(exec.SetConfig({{}}), InferenceEngine::NotAllocated); } TEST(ExecutableNetworkTests, throwsOnUninitializedGetConfig) { ExecutableNetwork exec; - ASSERT_THROW(exec.GetConfig({}), InferenceEngine::Exception); + ASSERT_THROW(exec.GetConfig({}), InferenceEngine::NotAllocated); } TEST(ExecutableNetworkTests, throwsOnUninitializedGetMetric) { ExecutableNetwork exec; - ASSERT_THROW(exec.GetMetric({}), InferenceEngine::Exception); + ASSERT_THROW(exec.GetMetric({}), InferenceEngine::NotAllocated); } TEST(ExecutableNetworkTests, throwsOnUninitializedGetContext) { ExecutableNetwork exec; - ASSERT_THROW(exec.GetContext(), InferenceEngine::Exception); + ASSERT_THROW(exec.GetContext(), InferenceEngine::NotAllocated); } \ No newline at end of file diff --git a/inference-engine/tests/functional/inference_engine/variable_state.cpp b/inference-engine/tests/functional/inference_engine/variable_state.cpp index 5073a155fca2e9..f17bd599bb6026 100644 --- a/inference-engine/tests/functional/inference_engine/variable_state.cpp +++ b/inference-engine/tests/functional/inference_engine/variable_state.cpp @@ -5,32 +5,12 @@ #include #include -#include "unit_test_utils/mocks/mock_ie_ivariable_state.hpp" using namespace ::testing; using namespace std; using namespace InferenceEngine; using namespace InferenceEngine::details; -IE_SUPPRESS_DEPRECATED_START - -TEST(VariableStateCPPTests, throwsOnUninitialized) { - std::shared_ptr ptr; - ASSERT_THROW(VariableState var(ptr), InferenceEngine::NotAllocated); -} - -TEST(VariableStateCPPTests, nothrowOnInitialized) { - std::shared_ptr ptr = std::make_shared(); - ASSERT_NO_THROW(VariableState var(ptr)); -} - -TEST(VariableStateCPPTests, throwsOnUninitializedGetLastState) { - VariableState req; - ASSERT_THROW(req.GetLastState(), InferenceEngine::NotAllocated); -} - -IE_SUPPRESS_DEPRECATED_END - TEST(VariableStateCPPTests, throwsOnUninitializedReset) { VariableState req; ASSERT_THROW(req.Reset(), InferenceEngine::NotAllocated); diff --git a/inference-engine/tests/functional/shared_test_classes/src/subgraph/concat_quantization_during_memory_requantization.cpp b/inference-engine/tests/functional/shared_test_classes/src/subgraph/concat_quantization_during_memory_requantization.cpp index b02dc5b86b7f54..729dfdb4e508ef 100644 --- a/inference-engine/tests/functional/shared_test_classes/src/subgraph/concat_quantization_during_memory_requantization.cpp +++ b/inference-engine/tests/functional/shared_test_classes/src/subgraph/concat_quantization_during_memory_requantization.cpp @@ -104,11 +104,11 @@ namespace SubgraphTestsDefinitions { for (auto& state : states) { auto name = state.GetName(); if (name == "memory_1") { - auto blob = FuncTestUtils::createAndFillBlobWithFloatArray(state.GetLastState()->getTensorDesc(), + auto blob = FuncTestUtils::createAndFillBlobWithFloatArray(state.GetState()->getTensorDesc(), memory_1_init.data(), memory_1_init.size()); state.SetState(blob); } else if (name == "memory_2") { - auto blob = FuncTestUtils::createAndFillBlobWithFloatArray(state.GetLastState()->getTensorDesc(), + auto blob = FuncTestUtils::createAndFillBlobWithFloatArray(state.GetState()->getTensorDesc(), memory_2_init.data(), memory_2_init.size()); state.SetState(blob); } else { diff --git a/inference-engine/tests/functional/shared_test_classes/src/subgraph/memory_LSTMCell.cpp b/inference-engine/tests/functional/shared_test_classes/src/subgraph/memory_LSTMCell.cpp index bac0c293add651..291774616714a7 100644 --- a/inference-engine/tests/functional/shared_test_classes/src/subgraph/memory_LSTMCell.cpp +++ b/inference-engine/tests/functional/shared_test_classes/src/subgraph/memory_LSTMCell.cpp @@ -280,11 +280,11 @@ namespace SubgraphTestsDefinitions { for (auto& state : states) { auto name = state.GetName(); if (name.find("cell_state_1") != std::string::npos) { - auto blob = FuncTestUtils::createAndFillBlobWithFloatArray(state.GetLastState()->getTensorDesc(), + auto blob = FuncTestUtils::createAndFillBlobWithFloatArray(state.GetState()->getTensorDesc(), cell_memory_init.data(), cell_memory_init.size()); state.SetState(blob); } else if (name.find("hidden_state_1") != std::string::npos) { - auto blob = FuncTestUtils::createAndFillBlobWithFloatArray(state.GetLastState()->getTensorDesc(), + auto blob = FuncTestUtils::createAndFillBlobWithFloatArray(state.GetState()->getTensorDesc(), hidden_memory_init.data(), hidden_memory_init.size()); state.SetState(blob); } else { diff --git a/inference-engine/tests/functional/shared_test_classes/src/subgraph/negative_memory_layer_offset.cpp b/inference-engine/tests/functional/shared_test_classes/src/subgraph/negative_memory_layer_offset.cpp index c11eff780f7275..9375b7b6baf31f 100644 --- a/inference-engine/tests/functional/shared_test_classes/src/subgraph/negative_memory_layer_offset.cpp +++ b/inference-engine/tests/functional/shared_test_classes/src/subgraph/negative_memory_layer_offset.cpp @@ -77,7 +77,7 @@ namespace SubgraphTestsDefinitions { for (auto& state : states) { auto name = state.GetName(); if (name == "memory") { - auto blob = FuncTestUtils::createAndFillBlobWithFloatArray(state.GetLastState()->getTensorDesc(), + auto blob = FuncTestUtils::createAndFillBlobWithFloatArray(state.GetState()->getTensorDesc(), memory_init.data(), memory_init.size()); state.SetState(blob); } else { diff --git a/inference-engine/tests/ie_test_utils/unit_test_utils/mock.cpp b/inference-engine/tests/ie_test_utils/unit_test_utils/mock.cpp index 676bf59b340061..980044f8d0265d 100644 --- a/inference-engine/tests/ie_test_utils/unit_test_utils/mock.cpp +++ b/inference-engine/tests/ie_test_utils/unit_test_utils/mock.cpp @@ -4,7 +4,6 @@ #include "unit_test_utils/mocks/mock_allocator.hpp" #include "unit_test_utils/mocks/mock_icnn_network.hpp" -#include "unit_test_utils/mocks/mock_ie_ivariable_state.hpp" #include "unit_test_utils/mocks/mock_iexecutable_network.hpp" #include "unit_test_utils/mocks/mock_iinfer_request.hpp" #include "unit_test_utils/mocks/mock_not_empty_icnn_network.hpp" diff --git a/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_ie_ivariable_state.hpp b/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_ie_ivariable_state.hpp deleted file mode 100644 index eac6fcbfa3f246..00000000000000 --- a/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_ie_ivariable_state.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2018-2021 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include -#include - -#include "ie_imemory_state.hpp" - -using namespace InferenceEngine; - -IE_SUPPRESS_DEPRECATED_START - -class MockIVariableState : public InferenceEngine::IVariableState { -public: - MOCK_QUALIFIED_METHOD3(GetName, const noexcept, StatusCode(char * , size_t, ResponseDesc *)); - MOCK_QUALIFIED_METHOD1(Reset, noexcept, StatusCode(ResponseDesc *)); - MOCK_QUALIFIED_METHOD2(SetState, noexcept, StatusCode(Blob::Ptr, ResponseDesc *)); - MOCK_QUALIFIED_METHOD2(GetState, const noexcept, StatusCode(Blob::CPtr &, ResponseDesc *)); -}; - -IE_SUPPRESS_DEPRECATED_END diff --git a/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_iexecutable_network.hpp b/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_iexecutable_network.hpp index 147ee892a8f1e0..a5187953206ddd 100644 --- a/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_iexecutable_network.hpp +++ b/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_iexecutable_network.hpp @@ -32,7 +32,6 @@ class MockIExecutableNetwork : public IExecutableNetwork { MOCK_QUALIFIED_METHOD3(GetConfig, const noexcept, StatusCode(const std::string &name, Parameter &result, ResponseDesc *resp)); MOCK_QUALIFIED_METHOD3(GetMetric, const noexcept, StatusCode(const std::string &name, Parameter &result, ResponseDesc *resp)); MOCK_QUALIFIED_METHOD2(GetContext, const noexcept, StatusCode(RemoteContext::Ptr &pContext, ResponseDesc *resp)); - MOCK_QUALIFIED_METHOD3(QueryState, noexcept, StatusCode(IVariableState::Ptr &, size_t, ResponseDesc *)); }; IE_SUPPRESS_DEPRECATED_END diff --git a/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_iinfer_request.hpp b/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_iinfer_request.hpp index a56ad790a979ea..bac5fc7773e024 100644 --- a/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_iinfer_request.hpp +++ b/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_iinfer_request.hpp @@ -35,7 +35,6 @@ class MockIInferRequest : public IInferRequest { MOCK_QUALIFIED_METHOD3(SetBlob, noexcept, StatusCode(const char*, const Blob::Ptr&, ResponseDesc*)); MOCK_QUALIFIED_METHOD4(SetBlob, noexcept, StatusCode(const char*, const Blob::Ptr&, const PreProcessInfo&, ResponseDesc*)); MOCK_QUALIFIED_METHOD2(SetBatch, noexcept, StatusCode(int batch, ResponseDesc*)); - MOCK_QUALIFIED_METHOD3(QueryState, noexcept, StatusCode(IVariableState::Ptr &, size_t, ResponseDesc *)); MOCK_QUALIFIED_METHOD1(Cancel, noexcept, InferenceEngine::StatusCode(ResponseDesc*)); }; diff --git a/inference-engine/tests/unit/inference_engine/ie_executable_network_test.cpp b/inference-engine/tests/unit/inference_engine/ie_executable_network_test.cpp index 2c35e8652dfcc0..998620c026da7f 100644 --- a/inference-engine/tests/unit/inference_engine/ie_executable_network_test.cpp +++ b/inference-engine/tests/unit/inference_engine/ie_executable_network_test.cpp @@ -13,7 +13,6 @@ #include "unit_test_utils/mocks/mock_iexecutable_network.hpp" #include "unit_test_utils/mocks/mock_iinfer_request.hpp" -#include "unit_test_utils/mocks/mock_ie_ivariable_state.hpp" #include "unit_test_utils/mocks/cpp_interfaces/impl/mock_inference_plugin_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_ivariable_state_internal.hpp"