diff --git a/docs/snippets/gpu/custom_kernels_api.cpp b/docs/snippets/gpu/custom_kernels_api.cpp index 19d7ea22ad9..ccadfaa6abf 100644 --- a/docs/snippets/gpu/custom_kernels_api.cpp +++ b/docs/snippets/gpu/custom_kernels_api.cpp @@ -1,6 +1,17 @@ #include "openvino/runtime/core.hpp" + +#ifndef IN_OV_COMPONENT +# define IN_OV_COMPONENT +# define WAS_OV_LIBRARY_DEFINED +#endif + #include "ie_plugin_config.hpp" +#ifdef WAS_OV_LIBRARY_DEFINED +# undef IN_OV_COMPONENT +# undef WAS_OV_LIBRARY_DEFINED +#endif + int main() { //! [part0] ov::Core core; diff --git a/samples/cpp/benchmark_app/main.cpp b/samples/cpp/benchmark_app/main.cpp index ba78cb13738..7e00e221fa7 100644 --- a/samples/cpp/benchmark_app/main.cpp +++ b/samples/cpp/benchmark_app/main.cpp @@ -14,9 +14,19 @@ #include "openvino/openvino.hpp" #include "openvino/pass/serialize.hpp" +#ifndef IN_OV_COMPONENT +# define IN_OV_COMPONENT +# define WAS_OV_LIBRARY_DEFINED +#endif + #include "gna/gna_config.hpp" #include "gpu/gpu_config.hpp" +#ifdef WAS_OV_LIBRARY_DEFINED +# undef IN_OV_COMPONENT +# undef WAS_OV_LIBRARY_DEFINED +#endif + #include "samples/args_helper.hpp" #include "samples/common.hpp" #include "samples/slog.hpp" diff --git a/src/common/preprocessing/src/ie_preprocess_gapi.hpp b/src/common/preprocessing/src/ie_preprocess_gapi.hpp index bcba584c65a..fd943e1532a 100644 --- a/src/common/preprocessing/src/ie_preprocess_gapi.hpp +++ b/src/common/preprocessing/src/ie_preprocess_gapi.hpp @@ -20,6 +20,7 @@ namespace InferenceEngine { +IE_SUPPRESS_DEPRECATED_START class PreprocEngine { using BlobDesc = std::tuple; using CallDesc = std::tuple; @@ -55,5 +56,6 @@ public: void preprocessWithGAPI(const Blob::Ptr &inBlob, Blob::Ptr &outBlob, const ResizeAlgorithm &algorithm, ColorFormat in_fmt, bool omp_serial, int batch_size = -1); }; +IE_SUPPRESS_DEPRECATED_END } // namespace InferenceEngine diff --git a/src/common/preprocessing/tests/CMakeLists.txt b/src/common/preprocessing/tests/CMakeLists.txt index d7a6790e465..0a2b69b3b59 100644 --- a/src/common/preprocessing/tests/CMakeLists.txt +++ b/src/common/preprocessing/tests/CMakeLists.txt @@ -4,6 +4,8 @@ set(TARGET fluid_preproc_tests) +ov_deprecated_no_errors() + find_package(OpenCV QUIET COMPONENTS gapi core imgproc) if(NOT OpenCV_FOUND) message(WARNING "No suitable OpenCV version detected, ${TARGET} skipped") diff --git a/src/inference/dev_api/xml_parse_utils.h b/src/inference/dev_api/xml_parse_utils.h index b7386737276..9e8ddd414f4 100644 --- a/src/inference/dev_api/xml_parse_utils.h +++ b/src/inference/dev_api/xml_parse_utils.h @@ -22,6 +22,7 @@ #include "ie_common.h" #include "ie_precision.hpp" +IE_SUPPRESS_DEPRECATED_START /** * @ingroup ie_dev_api_xml * @brief Defines convinient for-each based cycle to iterate over node children @@ -296,3 +297,5 @@ inline parse_result ParseXml(const char* file_path) { return {std::move(nullptr), std::string("Error loading XML file: ") + e.what()}; } } + +IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/include/ie/ie_data.h b/src/inference/include/ie/ie_data.h index 7e22ff48392..66bd61d4639 100644 --- a/src/inference/include/ie/ie_data.h +++ b/src/inference/include/ie/ie_data.h @@ -30,6 +30,7 @@ #include "ie_precision.hpp" namespace InferenceEngine { +IE_SUPPRESS_DEPRECATED_START /** * @deprecated The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on @@ -187,4 +188,5 @@ private: */ mutable TensorDesc tensorDesc; }; +IE_SUPPRESS_DEPRECATED_END } // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_layouts.h b/src/inference/include/ie/ie_layouts.h index 0fa0465d5b7..a14b8dbd803 100644 --- a/src/inference/include/ie/ie_layouts.h +++ b/src/inference/include/ie/ie_layouts.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 "ie_api.h" @@ -17,10 +27,12 @@ namespace InferenceEngine { +IE_SUPPRESS_DEPRECATED_START + /** * @brief This class describes blocking layouts */ -class INFERENCE_ENGINE_API_CLASS(BlockingDesc) { +class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(BlockingDesc) { public: /** * @brief The default constructor which creates empty blocking descriptor @@ -158,7 +170,7 @@ private: /** * @brief This class defines Tensor description */ -class INFERENCE_ENGINE_API_CLASS(TensorDesc) { +class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(TensorDesc) { public: /** * @brief The constructor creates the tensor descriptor using blocking descriptor @@ -337,7 +349,7 @@ private: /** * @brief This structure describes ROI data for image-like tensors. */ -struct ROI { +struct INFERENCE_ENGINE_1_0_DEPRECATED ROI { size_t id = 0; //!< ID of a ROI (offset over batch dimension) size_t posX = 0; //!< W upper left coordinate of ROI size_t posY = 0; //!< H upper left coordinate of ROI @@ -372,7 +384,8 @@ struct ROI { * * @return A newly created TensorDesc object representing ROI. */ -INFERENCE_ENGINE_API_CPP(TensorDesc) make_roi_desc(const TensorDesc& origDesc, const ROI& roi, bool useOrigMemDesc); +INFERENCE_ENGINE_API_CPP(TensorDesc) +INFERENCE_ENGINE_1_0_DEPRECATED make_roi_desc(const TensorDesc& origDesc, const ROI& roi, bool useOrigMemDesc); /** * @brief Creates a TensorDesc object for ROI. @@ -386,9 +399,10 @@ INFERENCE_ENGINE_API_CPP(TensorDesc) make_roi_desc(const TensorDesc& origDesc, c * @return A newly created TensorDesc object representing ROI. */ INFERENCE_ENGINE_API_CPP(TensorDesc) -make_roi_desc(const TensorDesc& origDesc, - const std::vector& begin, - const std::vector& end, - bool useOrigMemDesc); +INFERENCE_ENGINE_1_0_DEPRECATED make_roi_desc(const TensorDesc& origDesc, + const std::vector& begin, + const std::vector& end, + bool useOrigMemDesc); +IE_SUPPRESS_DEPRECATED_END } // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_precision.hpp b/src/inference/include/ie/ie_precision.hpp index 48bdd945b13..fab905d4fed 100644 --- a/src/inference/include/ie/ie_precision.hpp +++ b/src/inference/include/ie/ie_precision.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 @@ -16,11 +26,12 @@ #include "ie_common.h" namespace InferenceEngine { +IE_SUPPRESS_DEPRECATED_START /** * @brief This class holds precision value and provides precision related operations */ -class Precision { +class INFERENCE_ENGINE_1_0_DEPRECATED Precision { public: /** Enum to specify of different */ enum ePrecision : uint8_t { @@ -364,118 +375,118 @@ protected: * @brief Particular precision traits */ template -struct PrecisionTrait {}; +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait {}; /** @cond INTERNAL */ template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = float; enum { is_float = true }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = double; enum { is_float = true }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = int16_t; enum { is_float = true }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = int16_t; enum { is_float = true }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = uint16_t; enum { is_float = false }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = int16_t; enum { is_float = false }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = uint16_t; enum { is_float = false }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = uint8_t; enum { is_float = false }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = uint8_t; enum { is_float = false }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = int8_t; enum { is_float = false }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = int8_t; enum { is_float = false }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = uint8_t; enum { is_float = false }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = int32_t; enum { is_float = false }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = uint32_t; enum { is_float = false }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = int64_t; enum { is_float = false }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = uint64_t; enum { is_float = false }; }; template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = int8_t; enum { is_float = false }; }; template -inline uint8_t type_size_or_zero() { +INFERENCE_ENGINE_1_0_DEPRECATED inline uint8_t type_size_or_zero() { return sizeof(T); } template <> -struct PrecisionTrait { +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { using value_type = void; enum { is_float = false }; }; template <> -struct PrecisionTrait : PrecisionTrait {}; +struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait : PrecisionTrait {}; template <> -inline uint8_t type_size_or_zero() { +INFERENCE_ENGINE_1_0_DEPRECATED inline uint8_t type_size_or_zero() { return 0; } template -inline Precision::PrecisionInfo Precision::makePrecisionInfo(const char* name) { +INFERENCE_ENGINE_1_0_DEPRECATED inline Precision::PrecisionInfo Precision::makePrecisionInfo(const char* name) { Precision::PrecisionInfo info; info.name = name; @@ -506,7 +517,7 @@ inline std::ostream& operator<<(std::ostream& os, const std::vector& return os; } -inline constexpr uint32_t getPrecisionMask( +INFERENCE_ENGINE_1_0_DEPRECATED inline constexpr uint32_t getPrecisionMask( InferenceEngine::Precision::ePrecision precision1, InferenceEngine::Precision::ePrecision precision2, InferenceEngine::Precision::ePrecision precision3 = InferenceEngine::Precision::MIXED, @@ -516,4 +527,5 @@ inline constexpr uint32_t getPrecisionMask( /** @endcond */ +IE_SUPPRESS_DEPRECATED_END } // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_preprocess.hpp b/src/inference/include/ie/ie_preprocess.hpp index 623d3e1fa8e..7caa5520d42 100644 --- a/src/inference/include/ie/ie_preprocess.hpp +++ b/src/inference/include/ie/ie_preprocess.hpp @@ -16,6 +16,7 @@ #include "ie_blob.h" namespace InferenceEngine { +IE_SUPPRESS_DEPRECATED_START /** * @brief This structure stores info about pre-processing of network inputs (scale, mean image, ...) @@ -221,4 +222,5 @@ public: return _colorFormat; } }; +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 7f920db1ba4..df4889bb407 100644 --- a/src/inference/include/ie/ie_remote_blob.hpp +++ b/src/inference/include/ie/ie_remote_blob.hpp @@ -17,6 +17,7 @@ #include "ie_parameter.hpp" namespace InferenceEngine { +IE_SUPPRESS_DEPRECATED_START class RemoteContext; /** @@ -72,4 +73,5 @@ public: */ virtual std::shared_ptr getContext() const noexcept = 0; }; +IE_SUPPRESS_DEPRECATED_END } // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_remote_context.hpp b/src/inference/include/ie/ie_remote_context.hpp index a630bc905cb..bf025b8fb2f 100644 --- a/src/inference/include/ie/ie_remote_context.hpp +++ b/src/inference/include/ie/ie_remote_context.hpp @@ -13,10 +13,12 @@ #include #include +#include "ie_api.h" #include "ie_parameter.hpp" #include "ie_remote_blob.hpp" namespace InferenceEngine { +IE_SUPPRESS_DEPRECATED_START /** * @brief This class represents an Inference Engine abstraction * for remote (non-CPU) accelerator device-specific execution context. @@ -141,4 +143,5 @@ inline RemoteBlob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::P return ctx->CreateBlob(desc); } +IE_SUPPRESS_DEPRECATED_END } // namespace InferenceEngine diff --git a/src/inference/src/ie_layouts.cpp b/src/inference/src/ie_layouts.cpp index c69d8c90e9a..689a0d2af9c 100644 --- a/src/inference/src/ie_layouts.cpp +++ b/src/inference/src/ie_layouts.cpp @@ -8,6 +8,7 @@ #include using namespace InferenceEngine; +IE_SUPPRESS_DEPRECATED_START TensorDesc::TensorDesc(const Precision& precision, const SizeVector& dims, Layout layout) : precision(precision), @@ -533,3 +534,4 @@ TensorDesc InferenceEngine::make_roi_desc(const TensorDesc& origDesc, } return make_roi_desc(origDesc, slice, useOrigMemDesc); } +IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/src/ie_remote_context.cpp b/src/inference/src/ie_remote_context.cpp index 17fd0685548..9aef0f76afc 100644 --- a/src/inference/src/ie_remote_context.cpp +++ b/src/inference/src/ie_remote_context.cpp @@ -11,6 +11,7 @@ namespace InferenceEngine { +IE_SUPPRESS_DEPRECATED_START MemoryBlob::Ptr RemoteContext::CreateHostBlob(const TensorDesc& tensorDesc) { auto blob = std::dynamic_pointer_cast(make_blob_with_precision(tensorDesc)); if (!blob) @@ -18,5 +19,6 @@ MemoryBlob::Ptr RemoteContext::CreateHostBlob(const TensorDesc& tensorDesc) { return blob; } +IE_SUPPRESS_DEPRECATED_END } // namespace InferenceEngine diff --git a/src/inference/src/xml_parse_utils.cpp b/src/inference/src/xml_parse_utils.cpp index 3b753105951..d88bb838ce9 100644 --- a/src/inference/src/xml_parse_utils.cpp +++ b/src/inference/src/xml_parse_utils.cpp @@ -12,6 +12,8 @@ #include "ie_precision.hpp" +IE_SUPPRESS_DEPRECATED_START + int pugixml::utils::GetIntAttr(const pugi::xml_node& node, const char* str) { auto attr = node.attribute(str); if (attr.empty()) diff --git a/src/inference/tests/functional/ie_precision_test.cpp b/src/inference/tests/functional/ie_precision_test.cpp index cfc1e82ab80..65bb27f0e47 100644 --- a/src/inference/tests/functional/ie_precision_test.cpp +++ b/src/inference/tests/functional/ie_precision_test.cpp @@ -8,6 +8,8 @@ #include #include +IE_SUPPRESS_DEPRECATED_START + using Precision = InferenceEngine::Precision; using PrecisionTests = ::testing::Test; diff --git a/src/inference/tests/functional/preprocess_test.cpp b/src/inference/tests/functional/preprocess_test.cpp index 7840d6dd572..8b5045a5b7b 100644 --- a/src/inference/tests/functional/preprocess_test.cpp +++ b/src/inference/tests/functional/preprocess_test.cpp @@ -8,6 +8,7 @@ using namespace std; +IE_SUPPRESS_DEPRECATED_START using PreProcessTests = ::testing::Test; TEST_F(PreProcessTests, throwsOnSettingNullMeanImage) { diff --git a/src/inference/tests/functional/tensor_desc_test.cpp b/src/inference/tests/functional/tensor_desc_test.cpp index 2e4446f6911..64dc1372e92 100644 --- a/src/inference/tests/functional/tensor_desc_test.cpp +++ b/src/inference/tests/functional/tensor_desc_test.cpp @@ -13,6 +13,8 @@ using namespace ::testing; using namespace std; using namespace InferenceEngine; +IE_SUPPRESS_DEPRECATED_START + using TensorDescTests = ::testing::Test; TEST_F(TensorDescTests, CreateBlobWithIncorrectLayout) {