diff --git a/src/inference/dev_api/blob_transform.hpp b/src/inference/dev_api/blob_transform.hpp index 804c925bb82..24493928028 100644 --- a/src/inference/dev_api/blob_transform.hpp +++ b/src/inference/dev_api/blob_transform.hpp @@ -12,6 +12,7 @@ #include "ie_api.h" #include "ie_blob.h" +IE_SUPPRESS_DEPRECATED_START namespace InferenceEngine { /** @@ -24,3 +25,4 @@ namespace InferenceEngine { INFERENCE_ENGINE_API_CPP(void) blob_copy(Blob::Ptr src, Blob::Ptr dst); } // namespace InferenceEngine +IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/dev_api/cpp_interfaces/interface/ie_ivariable_state_internal.hpp b/src/inference/dev_api/cpp_interfaces/interface/ie_ivariable_state_internal.hpp index 134c7cf64fd..a2a0aabf997 100644 --- a/src/inference/dev_api/cpp_interfaces/interface/ie_ivariable_state_internal.hpp +++ b/src/inference/dev_api/cpp_interfaces/interface/ie_ivariable_state_internal.hpp @@ -77,6 +77,7 @@ using SoIVariableStateInternal = ov::SoPtr; * @brief For compatibility reasons. */ using MemoryStateInternal = IVariableStateInternal; + IE_SUPPRESS_DEPRECATED_END } // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_blob.h b/src/inference/include/ie/ie_blob.h index b2e50de49ff..18a83ecc68f 100644 --- a/src/inference/include/ie/ie_blob.h +++ b/src/inference/include/ie/ie_blob.h @@ -9,6 +9,16 @@ */ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) +# define IE_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -35,7 +45,7 @@ IE_SUPPRESS_DEPRECATED_START * * @note Each Blob implementation must be derived from this Blob class directly or indirectly */ -class INFERENCE_ENGINE_API_CLASS(Blob) { +class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(Blob) { public: /** * @brief A smart pointer containing Blob object @@ -287,7 +297,7 @@ protected: template ::value && !std::is_reference::value, int>::type = 0, typename std::enable_if::value, int>::type = 0> -std::shared_ptr as(const Blob::Ptr& blob) noexcept { +INFERENCE_ENGINE_1_0_DEPRECATED std::shared_ptr as(const Blob::Ptr& blob) noexcept { return std::dynamic_pointer_cast(blob); } @@ -300,7 +310,7 @@ std::shared_ptr as(const Blob::Ptr& blob) noexcept { template ::value && !std::is_reference::value, int>::type = 0, typename std::enable_if::value, int>::type = 0> -std::shared_ptr as(const Blob::CPtr& blob) noexcept { +INFERENCE_ENGINE_1_0_DEPRECATED std::shared_ptr as(const Blob::CPtr& blob) noexcept { return std::dynamic_pointer_cast(blob); } @@ -311,7 +321,7 @@ std::shared_ptr as(const Blob::CPtr& blob) noexcept { * @note Any Blob implementation that represents a concept of a tensor in memory (for example, * TBlob) must be a subclass of MemoryBlob instead of Blob */ -class INFERENCE_ENGINE_API_CLASS(MemoryBlob) : public Blob { +class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(MemoryBlob) : public Blob { public: /** * @brief A smart pointer to the MemoryBlob object @@ -510,7 +520,7 @@ using BlobMap = std::map; * @brief Represents real host memory allocated for a Tensor/Blob per C type. */ template ::value && std::is_trivial::value>> -class TBlob : public MemoryBlob { +class INFERENCE_ENGINE_1_0_DEPRECATED TBlob : public MemoryBlob { template friend class TBlob; @@ -835,7 +845,8 @@ extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); * @return A shared pointer to the newly created blob of the given type */ template -inline typename InferenceEngine::TBlob::Ptr make_shared_blob(const TensorDesc& tensorDesc) { +inline INFERENCE_ENGINE_1_0_DEPRECATED typename InferenceEngine::TBlob::Ptr make_shared_blob( + const TensorDesc& tensorDesc) { if (!tensorDesc.getPrecision().hasStorageType()) IE_THROW() << "Cannot make shared blob! " << "The blob type cannot be used to store objects of current precision"; @@ -852,9 +863,8 @@ inline typename InferenceEngine::TBlob::Ptr make_shared_blob(const TensorD * @return A shared pointer to the newly created blob of the given type */ template -inline typename InferenceEngine::TBlob::Ptr make_shared_blob(const TensorDesc& tensorDesc, - Type* ptr, - size_t size = 0) { +inline INFERENCE_ENGINE_1_0_DEPRECATED typename InferenceEngine::TBlob::Ptr +make_shared_blob(const TensorDesc& tensorDesc, Type* ptr, size_t size = 0) { if (!tensorDesc.getPrecision().hasStorageType()) IE_THROW() << "Cannot make shared blob! " << "The blob type cannot be used to store objects of current precision"; @@ -870,7 +880,7 @@ inline typename InferenceEngine::TBlob::Ptr make_shared_blob(const TensorD * @return A shared pointer to the newly created blob of the given type */ template -inline typename InferenceEngine::TBlob::Ptr make_shared_blob( +inline INFERENCE_ENGINE_1_0_DEPRECATED typename InferenceEngine::TBlob::Ptr make_shared_blob( const TensorDesc& tensorDesc, const std::shared_ptr& alloc) { if (!tensorDesc.getPrecision().hasStorageType()) @@ -887,7 +897,8 @@ inline typename InferenceEngine::TBlob::Ptr make_shared_blob( * @return A shared pointer to the newly created blob of the given type */ template -inline typename InferenceEngine::TBlob::Ptr make_shared_blob(const TBlob& arg) { +inline INFERENCE_ENGINE_1_0_DEPRECATED typename InferenceEngine::TBlob::Ptr make_shared_blob( + const TBlob& arg) { return std::make_shared>(arg); } @@ -898,7 +909,7 @@ inline typename InferenceEngine::TBlob::Ptr make_shared_blob(const TBlob * @return A shared pointer to the newly created Blob object */ template ::value, int>::type = 0> -std::shared_ptr make_shared_blob(Args&&... args) { +INFERENCE_ENGINE_1_0_DEPRECATED std::shared_ptr make_shared_blob(Args&&... args) { return std::make_shared(std::forward(args)...); } @@ -909,7 +920,8 @@ std::shared_ptr make_shared_blob(Args&&... args) { * @param roi A ROI object inside of the original blob. * @return A shared pointer to the newly created blob. */ -INFERENCE_ENGINE_API_CPP(Blob::Ptr) make_shared_blob(const Blob::Ptr& inputBlob, const ROI& roi); +INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CPP(Blob::Ptr) + make_shared_blob(const Blob::Ptr& inputBlob, const ROI& roi); /** * @brief Creates a blob describing given ROI object based on the given blob with pre-allocated memory. @@ -919,8 +931,8 @@ INFERENCE_ENGINE_API_CPP(Blob::Ptr) make_shared_blob(const Blob::Ptr& inputBlob, * @param end A ROI object end coordinate inside of the original blob. * @return A shared pointer to the newly created blob. */ -INFERENCE_ENGINE_API_CPP(Blob::Ptr) -make_shared_blob(const Blob::Ptr& inputBlob, const std::vector& begin, const std::vector& end); +INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CPP(Blob::Ptr) + make_shared_blob(const Blob::Ptr& inputBlob, const std::vector& begin, const std::vector& end); IE_SUPPRESS_DEPRECATED_END } // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_remote_blob.hpp b/src/inference/include/ie/ie_remote_blob.hpp index df4889bb407..ad241b256ea 100644 --- a/src/inference/include/ie/ie_remote_blob.hpp +++ b/src/inference/include/ie/ie_remote_blob.hpp @@ -9,6 +9,16 @@ */ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) +# define IE_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -24,7 +34,7 @@ class RemoteContext; * @brief This class represents an Inference Engine abstraction to the memory allocated * on the remote (non-CPU) accelerator device */ -class RemoteBlob : public MemoryBlob { +class INFERENCE_ENGINE_1_0_DEPRECATED RemoteBlob : public MemoryBlob { public: /** * @brief A smart pointer to the RemoteBlob object diff --git a/src/inference/include/ie/ie_remote_context.hpp b/src/inference/include/ie/ie_remote_context.hpp index bf025b8fb2f..5485b278d4a 100644 --- a/src/inference/include/ie/ie_remote_context.hpp +++ b/src/inference/include/ie/ie_remote_context.hpp @@ -9,6 +9,16 @@ */ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) +# define IE_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -25,7 +35,8 @@ IE_SUPPRESS_DEPRECATED_START * Such context represents a scope on the device within which executable * networks and remote memory blobs can exist, function and exchange data. */ -class INFERENCE_ENGINE_API_CLASS(RemoteContext) : public std::enable_shared_from_this { +class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(RemoteContext) + : public std::enable_shared_from_this { public: /** * @brief A smart pointer to the RemoteContext object @@ -139,7 +150,8 @@ public: * @param ctx Pointer to the plugin object derived from RemoteContext. * @return A pointer to plugin object that implements RemoteBlob interface. */ -inline RemoteBlob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx) { +inline INFERENCE_ENGINE_1_0_DEPRECATED RemoteBlob::Ptr make_shared_blob(const TensorDesc& desc, + RemoteContext::Ptr ctx) { return ctx->CreateBlob(desc); } diff --git a/src/inference/src/dev/make_tensor.hpp b/src/inference/src/dev/make_tensor.hpp index 4472a6a0dd3..88c338a096b 100644 --- a/src/inference/src/dev/make_tensor.hpp +++ b/src/inference/src/dev/make_tensor.hpp @@ -43,10 +43,12 @@ std::shared_ptr make_tensor(const std::shared_ptr& other, const Coordinate& begin, const Coordinate& end); +IE_SUPPRESS_DEPRECATED_START /** @cond INTERNAL */ std::shared_ptr make_tensor(const std::shared_ptr& tensor); std::shared_ptr tensor_to_blob(const std::shared_ptr& tensor); /** @endcond */ +IE_SUPPRESS_DEPRECATED_END } // namespace ov diff --git a/src/tests/ie_test_utils/common_test_utils/test_assertions.hpp b/src/tests/ie_test_utils/common_test_utils/test_assertions.hpp index 8c5e9e36e76..b83c1cec080 100644 --- a/src/tests/ie_test_utils/common_test_utils/test_assertions.hpp +++ b/src/tests/ie_test_utils/common_test_utils/test_assertions.hpp @@ -85,6 +85,7 @@ inline bool strDoesnotContain(const std::string & str, const std::string & subst FAIL() << "Unknown exception"; \ } +IE_SUPPRESS_DEPRECATED_START inline void compare_blob(InferenceEngine::Blob::Ptr lhs, InferenceEngine::Blob::Ptr rhs) { ASSERT_EQ(lhs.get(), rhs.get()); //TODO: add blob specific comparison for general case @@ -97,7 +98,6 @@ inline void compare_dims(const InferenceEngine::SizeVector & lhs, const Inferenc } } -IE_SUPPRESS_DEPRECATED_START inline void compare_data(const InferenceEngine::Data & lhs, const InferenceEngine::Data & rhs) { ASSERT_DIMS_EQ(lhs.getDims(), rhs.getDims()); ASSERT_STREQ(lhs.getName().c_str(), rhs.getName().c_str());