From dd0060a582daca8532666a878665e708537b492a Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Fri, 26 May 2023 07:06:03 +0400 Subject: [PATCH] Deprecate legacy Core and Allocator (#17646) * Deprecate legacy Core and Allocator * Suppress blob warnings * Suppress some warnings * Suppress more warnings * Suppress blob allocator * Suppress more warnings * Suppress more warnings * Fixed compilation issues for Template plugin * Fixed some warnings * Fixed tests * Add WA for benchmark_app * Suppress #warning for developer package * Rename define * Disable warnings for compile_tool and benchmark_app * Suppress Windows warnings * Suppress more warnings for Windows * Fixed compile_tool install * Added message for VS * Fixed snippets and throw only first error --- .../compile_flags/os_flags.cmake | 2 + docs/snippets/AUTO1.cpp | 30 ---- docs/snippets/AUTO2.cpp | 12 -- docs/snippets/CPU_Kernel.cpp | 14 -- docs/snippets/MULTI1.cpp | 27 --- docs/snippets/cpu/Bfloat16Inference1.cpp | 1 - docs/snippets/cpu/Bfloat16Inference2.cpp | 1 - docs/snippets/dldt_optimization_guide8.cpp | 2 - docs/snippets/dldt_optimization_guide9.cpp | 2 - docs/snippets/example_async_infer_request.cpp | 10 ++ docs/snippets/example_itask_executor.cpp | 9 + docs/snippets/example_ngraph_utils.cpp | 155 ------------------ docs/snippets/ie_common.cpp | 10 ++ docs/snippets/lpt_intel_cpu_plugin.cpp | 2 - docs/snippets/ov_common.cpp | 10 ++ docs/snippets/ov_preprocessing_migration.cpp | 10 ++ docs/snippets/ov_properties_migration.cpp | 10 ++ src/CMakeLists.txt | 1 + src/core/src/runtime/blob_allocator.hpp | 2 + src/inference/dev_api/blob_factory.hpp | 2 + .../interface/ie_iinfer_request_internal.hpp | 3 + src/inference/include/ie/cpp/ie_cnn_network.h | 12 +- .../include/ie/details/ie_blob_iterator.hpp | 15 +- .../include/ie/details/ie_exception.hpp | 10 ++ .../include/ie/details/ie_pre_allocator.hpp | 16 +- .../include/ie/details/ie_so_loader.h | 13 +- .../include/ie/details/ie_so_pointer.hpp | 14 +- .../include/ie/gpu/gpu_context_api_ocl.hpp | 11 ++ src/inference/include/ie/ie_allocator.hpp | 19 ++- src/inference/include/ie/ie_blob.h | 2 + src/inference/include/ie/ie_compound_blob.h | 2 + src/inference/include/ie/ie_core.hpp | 14 +- src/inference/include/ie/ie_data.h | 10 ++ src/inference/include/ie/ie_extension.h | 10 ++ src/inference/include/ie/ie_icnn_network.hpp | 21 ++- src/inference/include/ie/ie_iextension.h | 10 ++ src/inference/include/ie/ie_input_info.hpp | 19 ++- src/inference/include/ie/ie_locked_memory.hpp | 22 ++- src/inference/include/ie/ie_parameter.hpp | 10 ++ src/inference/src/blob_factory.cpp | 2 + src/inference/src/blob_transform.cpp | 2 + src/inference/src/ie_blob_common.cpp | 1 + src/inference/src/system_allocator.cpp | 1 + src/inference/src/system_allocator.hpp | 2 + .../tests/functional/blob_copy_test.cpp | 2 + .../tests/functional/pre_allocator_test.cpp | 2 + src/inference/tests/unit/ie_blob_test.cpp | 2 + .../tests/unit/ie_compound_blob_test.cpp | 2 + .../tests/unit/ie_locked_memory_test.cpp | 2 + src/plugins/template/src/compiled_model.cpp | 1 - src/plugins/template/src/plugin.cpp | 1 - .../unit_test_utils/mocks/mock_allocator.hpp | 4 +- tools/compile_tool/CMakeLists.txt | 1 + tools/legacy/benchmark_app/CMakeLists.txt | 1 + 54 files changed, 294 insertions(+), 277 deletions(-) delete mode 100644 docs/snippets/AUTO1.cpp delete mode 100644 docs/snippets/AUTO2.cpp delete mode 100644 docs/snippets/CPU_Kernel.cpp delete mode 100644 docs/snippets/MULTI1.cpp delete mode 100644 docs/snippets/example_ngraph_utils.cpp diff --git a/cmake/developer_package/compile_flags/os_flags.cmake b/cmake/developer_package/compile_flags/os_flags.cmake index 7292e79a1f7..8c489f738b0 100644 --- a/cmake/developer_package/compile_flags/os_flags.cmake +++ b/cmake/developer_package/compile_flags/os_flags.cmake @@ -54,6 +54,8 @@ macro(ov_deprecated_no_errors) endif() elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX) set(ie_c_cxx_deprecated_no_errors "-Wno-error=deprecated-declarations") + # Suppress #warning messages + set(ie_c_cxx_deprecated_no_errors "${ie_c_cxx_deprecated_no_errors} -Wno-cpp") else() message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}") endif() diff --git a/docs/snippets/AUTO1.cpp b/docs/snippets/AUTO1.cpp deleted file mode 100644 index 13451e92916..00000000000 --- a/docs/snippets/AUTO1.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include - -int main() { -{ -//! [part1] -// Inference Engine API -InferenceEngine::Core ie; - -// Read a network in IR, PaddlePaddle, or ONNX format: -InferenceEngine::CNNNetwork network = ie.ReadNetwork("sample.xml"); - -// Load a network to AUTO using the default list of device candidates. -// The following lines are equivalent: -InferenceEngine::ExecutableNetwork exec0 = ie.LoadNetwork(network); -InferenceEngine::ExecutableNetwork exec1 = ie.LoadNetwork(network, "AUTO"); -InferenceEngine::ExecutableNetwork exec2 = ie.LoadNetwork(network, "AUTO", {}); - -// Optional -// You can also specify the devices to be used by AUTO in its selection process. -// The following lines are equivalent: -InferenceEngine::ExecutableNetwork exec3 = ie.LoadNetwork(network, "AUTO:GPU,CPU"); -InferenceEngine::ExecutableNetwork exec4 = ie.LoadNetwork(network, "AUTO", {{"MULTI_DEVICE_PRIORITIES", "GPU,CPU"}}); - -// Optional -// the AUTO plugin is pre-configured (globally) with the explicit option: -ie.SetConfig({{"MULTI_DEVICE_PRIORITIES", "GPU,CPU"}}, "AUTO"); -//! [part1] -} - return 0; -} diff --git a/docs/snippets/AUTO2.cpp b/docs/snippets/AUTO2.cpp deleted file mode 100644 index 2e7bd799e73..00000000000 --- a/docs/snippets/AUTO2.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include - -int main() { -{ -//! [part2] -InferenceEngine::Core ie; -InferenceEngine::CNNNetwork network = ie.ReadNetwork("sample.xml"); -InferenceEngine::ExecutableNetwork exeNetwork = ie.LoadNetwork(network, "AUTO"); -//! [part2] -} - return 0; -} diff --git a/docs/snippets/CPU_Kernel.cpp b/docs/snippets/CPU_Kernel.cpp deleted file mode 100644 index 6b71beecd91..00000000000 --- a/docs/snippets/CPU_Kernel.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include - -int main() { -using namespace InferenceEngine; -//! [part0] -InferenceEngine::Core core; -// Load CPU extension as a shared library -auto extension_ptr = std::make_shared(std::string{""}); -// Add extension to the CPU device -core.AddExtension(extension_ptr, "CPU"); -//! [part0] - -return 0; -} diff --git a/docs/snippets/MULTI1.cpp b/docs/snippets/MULTI1.cpp deleted file mode 100644 index 8d8caa411fd..00000000000 --- a/docs/snippets/MULTI1.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include - -int main() { -//! [part1] -ov::Core core; -std::shared_ptr model = core.read_model("sample.xml"); -ov::CompiledModel compileModel = core.compile_model(model, "MULTI:CPU,GPU"); - -// Once the priority list is set, you can alter it on the fly: -// reverse the order of priorities -compileModel.set_property(ov::device::priorities("GPU,CPU")); - -// exclude some devices (in this case, CPU) -compileModel.set_property(ov::device::priorities("GPU")); - -// bring back the excluded devices -compileModel.set_property(ov::device::priorities("GPU,CPU")); - -// You cannot add new devices on the fly! -// Attempting to do so will trigger the following exception: -// [ ERROR ] [NOT_FOUND] You can only change device -// priorities but not add new devices with the model's -// ov::device::priorities. CPU device was not in the original device list! - -//! [part1] -return 0; -} diff --git a/docs/snippets/cpu/Bfloat16Inference1.cpp b/docs/snippets/cpu/Bfloat16Inference1.cpp index 51850c6018d..a81a36d4da8 100644 --- a/docs/snippets/cpu/Bfloat16Inference1.cpp +++ b/docs/snippets/cpu/Bfloat16Inference1.cpp @@ -1,7 +1,6 @@ #include int main() { -using namespace InferenceEngine; //! [part1] ov::Core core; auto network = core.read_model("sample.xml"); diff --git a/docs/snippets/cpu/Bfloat16Inference2.cpp b/docs/snippets/cpu/Bfloat16Inference2.cpp index c06a6491b89..effc8f9cf5d 100644 --- a/docs/snippets/cpu/Bfloat16Inference2.cpp +++ b/docs/snippets/cpu/Bfloat16Inference2.cpp @@ -1,7 +1,6 @@ #include int main() { -using namespace InferenceEngine; //! [part2] ov::Core core; core.set_property("CPU", ov::hint::inference_precision(ov::element::f32)); diff --git a/docs/snippets/dldt_optimization_guide8.cpp b/docs/snippets/dldt_optimization_guide8.cpp index a1f467b662a..2a1acaa1015 100644 --- a/docs/snippets/dldt_optimization_guide8.cpp +++ b/docs/snippets/dldt_optimization_guide8.cpp @@ -1,5 +1,3 @@ -#include - int main() { //! [part8] while(true) { diff --git a/docs/snippets/dldt_optimization_guide9.cpp b/docs/snippets/dldt_optimization_guide9.cpp index 2efbde1d69b..cf3f7450164 100644 --- a/docs/snippets/dldt_optimization_guide9.cpp +++ b/docs/snippets/dldt_optimization_guide9.cpp @@ -1,5 +1,3 @@ -#include - int main() { //! [part9] while(true) { diff --git a/docs/snippets/example_async_infer_request.cpp b/docs/snippets/example_async_infer_request.cpp index ed3f880e4a8..41a6c0ac6f1 100644 --- a/docs/snippets/example_async_infer_request.cpp +++ b/docs/snippets/example_async_infer_request.cpp @@ -2,10 +2,20 @@ // SPDX-License-Identifier: Apache-2.0 // +#ifndef IN_OV_COMPONENT +# define IN_OV_COMPONENT +# define WAS_OV_LIBRARY_DEFINED +#endif + #include #include #include +#ifdef WAS_OV_LIBRARY_DEFINED +# undef IN_OV_COMPONENT +# undef WAS_OV_LIBRARY_DEFINED +#endif + using namespace InferenceEngine; class AcceleratorSyncRequest : public IInferRequestInternal { diff --git a/docs/snippets/example_itask_executor.cpp b/docs/snippets/example_itask_executor.cpp index a08c4c7575c..08adef43871 100644 --- a/docs/snippets/example_itask_executor.cpp +++ b/docs/snippets/example_itask_executor.cpp @@ -2,8 +2,17 @@ // SPDX-License-Identifier: Apache-2.0 // +#ifndef IN_OV_COMPONENT +# define IN_OV_COMPONENT +# define WAS_OV_LIBRARY_DEFINED +#endif #include +#ifdef WAS_OV_LIBRARY_DEFINED +# undef IN_OV_COMPONENT +# undef WAS_OV_LIBRARY_DEFINED +#endif + #include #include #include diff --git a/docs/snippets/example_ngraph_utils.cpp b/docs/snippets/example_ngraph_utils.cpp deleted file mode 100644 index 5e6a06b988f..00000000000 --- a/docs/snippets/example_ngraph_utils.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (C) 2020 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// ! [ov:include] -#include -#include -// ! [ov:include] - -bool ngraph_api_examples(std::shared_ptr node) { -{ -// ! [ngraph:ports_example] -// Let's suppose that node is opset8::Convolution operation -// as we know opset8::Convolution has two input ports (data, weights) and one output port -ov::Input data = node->input(0); -ov::Input weights = node->input(1); -ov::Output output = node->output(0); - -// Getting shape and type -auto pshape = data.get_partial_shape(); -auto el_type = data.get_element_type(); - -// Getting parent for input port -ov::Output parent_output; -parent_output = data.get_source_output(); - -// Another short way to get partent for output port -parent_output = node->input_value(0); - -// Getting all consumers for output port -auto consumers = output.get_target_inputs(); -// ! [ngraph:ports_example] -(void)el_type; -(void)pshape; -} - -{ -// ! [ngraph:shape_check] -auto partial_shape = node->input(0).get_partial_shape(); // get zero input partial shape - -// Check that input shape rank is static -if (!partial_shape.rank().is_static()) { - return false; -} -auto rank_size = partial_shape.rank().get_length(); - -// Check that second dimension is not dynamic -if (rank_size < 2 || partial_shape[1].is_dynamic()) { - return false; -} -auto dim = partial_shape[1].get_length(); -// ! [ngraph:shape_check] -} - -return true; -} - -// ! [ov:serialize] -void serialize_example(std::shared_ptr f) { - ov::pass::Manager manager; - - // Serialize ov::Function to before.svg file before transformation - manager.register_pass("/path/to/file/before.svg"); - - // Run your transformation - // manager.register_pass(); - - // Serialize ov::Function to after.svg file after transformation - manager.register_pass("/path/to/file/after.svg"); - - manager.run_passes(f); -} -// ! [ov:serialize] - -// ! [ov:visualize] -void visualization_example(std::shared_ptr f) { - ov::pass::Manager manager; - - // Serialize ov::Function to IR - manager.register_pass("/path/to/file/model.xml", "/path/to/file/model.bin"); - - manager.run_passes(f); -} -// ! [ov:visualize] - -void pass_manager_example1(std::shared_ptr f) { -// ! [ngraph:disable_gelu] -ov::pass::Manager manager; -manager.register_pass(); - -auto pass_config = manager.get_pass_config(); -pass_config->disable(); - -manager.run_passes(f); -// ! [ngraph:disable_gelu] -} - -void pass_manager_example2(std::shared_ptr f) { - ov::pass::Manager manager; - std::function)> transformation_callback; -// ! [ngraph:disable_callback] -// Set callback to particular transformation with specific condition -auto pass_config = manager.get_pass_config(); -pass_config->set_callback( - [](const std::shared_ptr &node) -> bool { - return node->input_value(0).get_shape().size() <= 5lu && - node->input_value(0).get_shape().size() == node->get_output_shape(0).size(); - }); - -// Update transformation to call callback -ov::matcher_pass_callback callback = [=](ov::pass::pattern::Matcher &m) { - auto node = m.get_match_root(); - if (transformation_callback(node)) { - return false; - } - // transformation code - return false; -}; -// ! [ngraph:disable_callback] -} - -void pass_manager_example3(std::shared_ptr f) { - std::function)> transformation_callback; -// ! [ngraph:disabled_by_default] -// Example of disabled by default transformation -{ - ov::pass::Manager manager; - manager.register_pass(); - manager.run_passes(f); -} - -// Enable disabled by default transformation inside plugin -{ - ov::pass::Manager manager; - manager.register_pass(); - auto pass_config = manager.get_pass_config(); - pass_config->enable(); - manager.run_passes(f); -} -// ! [ngraph:disabled_by_default] -} diff --git a/docs/snippets/ie_common.cpp b/docs/snippets/ie_common.cpp index b08fe275377..e45e956fe25 100644 --- a/docs/snippets/ie_common.cpp +++ b/docs/snippets/ie_common.cpp @@ -2,8 +2,18 @@ // SPDX-License-Identifier: Apache-2.0 // +#ifndef IN_OV_COMPONENT +# define IN_OV_COMPONENT +# define WAS_OV_LIBRARY_DEFINED +#endif + #include +#ifdef WAS_OV_LIBRARY_DEFINED +# undef IN_OV_COMPONENT +# undef WAS_OV_LIBRARY_DEFINED +#endif + int main() { //! [ie:create_core] InferenceEngine::Core core; diff --git a/docs/snippets/lpt_intel_cpu_plugin.cpp b/docs/snippets/lpt_intel_cpu_plugin.cpp index 14dcfad486f..906e6aeb39f 100644 --- a/docs/snippets/lpt_intel_cpu_plugin.cpp +++ b/docs/snippets/lpt_intel_cpu_plugin.cpp @@ -1,5 +1,3 @@ -#include - #include #include diff --git a/docs/snippets/ov_common.cpp b/docs/snippets/ov_common.cpp index 279303405ee..b21ec30aef3 100644 --- a/docs/snippets/ov_common.cpp +++ b/docs/snippets/ov_common.cpp @@ -1,8 +1,18 @@ // Copyright (C) 2018-2021 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#ifndef IN_OV_COMPONENT +# define IN_OV_COMPONENT +# define WAS_OV_LIBRARY_DEFINED +#endif + #include +#ifdef WAS_OV_LIBRARY_DEFINED +# undef IN_OV_COMPONENT +# undef WAS_OV_LIBRARY_DEFINED +#endif + #include #include diff --git a/docs/snippets/ov_preprocessing_migration.cpp b/docs/snippets/ov_preprocessing_migration.cpp index d5d824f284d..0d26fa70d5a 100644 --- a/docs/snippets/ov_preprocessing_migration.cpp +++ b/docs/snippets/ov_preprocessing_migration.cpp @@ -5,8 +5,18 @@ #include #include +#ifndef IN_OV_COMPONENT +# define IN_OV_COMPONENT +# define WAS_OV_LIBRARY_DEFINED +#endif + #include "inference_engine.hpp" +#ifdef WAS_OV_LIBRARY_DEFINED +# undef IN_OV_COMPONENT +# undef WAS_OV_LIBRARY_DEFINED +#endif + int main_new() { std::string model_path; std::string tensor_name; diff --git a/docs/snippets/ov_properties_migration.cpp b/docs/snippets/ov_properties_migration.cpp index 7be66b4a1d1..47bb0c5ec99 100644 --- a/docs/snippets/ov_properties_migration.cpp +++ b/docs/snippets/ov_properties_migration.cpp @@ -1,6 +1,16 @@ #include +#ifndef IN_OV_COMPONENT +# define IN_OV_COMPONENT +# define WAS_OV_LIBRARY_DEFINED +#endif + #include +#ifdef WAS_OV_LIBRARY_DEFINED +# undef IN_OV_COMPONENT +# undef WAS_OV_LIBRARY_DEFINED +#endif + int main_new() { ov::Core core; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 658addde5bf..405b95c0d72 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # +add_definitions(-DIN_OV_COMPONENT) add_definitions(-DPROJECT_ROOT_DIR="${OpenVINO_SOURCE_DIR}") include(cmake/install_tbb.cmake) diff --git a/src/core/src/runtime/blob_allocator.hpp b/src/core/src/runtime/blob_allocator.hpp index dada7eefd08..12c4f8cc1ec 100644 --- a/src/core/src/runtime/blob_allocator.hpp +++ b/src/core/src/runtime/blob_allocator.hpp @@ -10,6 +10,7 @@ #include "openvino/runtime/common.hpp" #include "system_allocator.hpp" // IE private header +IE_SUPPRESS_DEPRECATED_START namespace InferenceEngine { struct BlobAllocator : public IAllocator { BlobAllocator(const ov::Allocator& impl) : _impl{impl} {} @@ -79,3 +80,4 @@ struct BlobAllocator { std::shared_ptr _impl; }; } // namespace ov +IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/dev_api/blob_factory.hpp b/src/inference/dev_api/blob_factory.hpp index 24c6946bd40..02401bbc5b2 100644 --- a/src/inference/dev_api/blob_factory.hpp +++ b/src/inference/dev_api/blob_factory.hpp @@ -18,6 +18,7 @@ #include "ie_memcpy.h" #include "ie_preprocess.hpp" +IE_SUPPRESS_DEPRECATED_START /** * @private */ @@ -147,3 +148,4 @@ void CopyVectorToBlob(const InferenceEngine::Blob::Ptr outputBlob, const std::ve IE_THROW() << "Element size mismatch between blob and vector"; ie_memcpy(outputBlob->buffer().as(), outputBlob->byteSize(), &inputVector[0], inputVector.size() * sizeof(T)); } +IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/dev_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp b/src/inference/dev_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp index 3be236d7f76..2aeccc8d0a1 100644 --- a/src/inference/dev_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp +++ b/src/inference/dev_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp @@ -18,6 +18,7 @@ namespace InferenceEngine { +IE_SUPPRESS_DEPRECATED_START class IExecutableNetworkInternal; class IVariableStateInternal; @@ -368,4 +369,6 @@ private: */ using SoIInferRequestInternal = ov::SoPtr; +IE_SUPPRESS_DEPRECATED_END + } // namespace InferenceEngine diff --git a/src/inference/include/ie/cpp/ie_cnn_network.h b/src/inference/include/ie/cpp/ie_cnn_network.h index b16c05402fd..bacb4263137 100644 --- a/src/inference/include/ie/cpp/ie_cnn_network.h +++ b/src/inference/include/ie/cpp/ie_cnn_network.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 @@ -28,7 +38,7 @@ class IExtension; /** * @brief This class contains all the information about the Neural Network and the related binary information */ -class INFERENCE_ENGINE_API_CLASS(CNNNetwork) { +class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(CNNNetwork) { public: /** * @brief A default constructor diff --git a/src/inference/include/ie/details/ie_blob_iterator.hpp b/src/inference/include/ie/details/ie_blob_iterator.hpp index fa3265f5a7b..e6f92e46798 100644 --- a/src/inference/include/ie/details/ie_blob_iterator.hpp +++ b/src/inference/include/ie/details/ie_blob_iterator.hpp @@ -10,17 +10,29 @@ #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" #include "ie_locked_memory.hpp" +IE_SUPPRESS_DEPRECATED_START namespace InferenceEngine { namespace details { /** * @brief This class provides range loops support for TBlob objects */ template -class BlobIterator { +class INFERENCE_ENGINE_1_0_DEPRECATED BlobIterator { LockedMemory _mem; size_t _offset; @@ -85,3 +97,4 @@ public: }; } // namespace details } // namespace InferenceEngine +IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/include/ie/details/ie_exception.hpp b/src/inference/include/ie/details/ie_exception.hpp index 26c447679c7..fafa65173b0 100644 --- a/src/inference/include/ie/details/ie_exception.hpp +++ b/src/inference/include/ie/details/ie_exception.hpp @@ -4,4 +4,14 @@ #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 "ie_common.h" diff --git a/src/inference/include/ie/details/ie_pre_allocator.hpp b/src/inference/include/ie/details/ie_pre_allocator.hpp index 604e0421abe..b9e55d4bb98 100644 --- a/src/inference/include/ie/details/ie_pre_allocator.hpp +++ b/src/inference/include/ie/details/ie_pre_allocator.hpp @@ -9,16 +9,27 @@ */ #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_allocator.hpp" +IE_SUPPRESS_DEPRECATED_START namespace InferenceEngine { namespace details { /* * @brief This is a helper class to wrap external memory */ -class PreAllocator final : public IAllocator { +class INFERENCE_ENGINE_1_0_DEPRECATED PreAllocator final : public IAllocator { void* _actualData; size_t _sizeInBytes; @@ -67,9 +78,10 @@ public: * @return A new allocator */ template -std::shared_ptr make_pre_allocator(T* ptr, size_t size) { +std::shared_ptr INFERENCE_ENGINE_1_0_DEPRECATED make_pre_allocator(T* ptr, size_t size) { return std::make_shared(ptr, size * sizeof(T)); } } // namespace details } // namespace InferenceEngine +IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/include/ie/details/ie_so_loader.h b/src/inference/include/ie/details/ie_so_loader.h index 59c71f23ba4..d6209ccbd6b 100644 --- a/src/inference/include/ie/details/ie_so_loader.h +++ b/src/inference/include/ie/details/ie_so_loader.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" @@ -20,8 +30,7 @@ namespace details { * @deprecated This is internal stuff. Use Inference Engine Plugin API * @brief This class provides an OS shared module abstraction */ -class INFERENCE_ENGINE_DEPRECATED("This is internal stuff. Use Inference Engine Plugin API") - INFERENCE_ENGINE_API_CLASS(SharedObjectLoader) { +class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(SharedObjectLoader) { std::shared_ptr _so; public: diff --git a/src/inference/include/ie/details/ie_so_pointer.hpp b/src/inference/include/ie/details/ie_so_pointer.hpp index 04078136e13..6f99575264b 100644 --- a/src/inference/include/ie/details/ie_so_pointer.hpp +++ b/src/inference/include/ie/details/ie_so_pointer.hpp @@ -8,6 +8,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 @@ namespace details { * parameter */ template -class SOCreatorTrait {}; +class INFERENCE_ENGINE_1_0_DEPRECATED SOCreatorTrait {}; /** * @brief Enables only `char` or `wchar_t` template specializations @@ -40,7 +50,7 @@ using enableIfSupportedChar = * @tparam T An type of object SOPointer can hold */ template -class INFERENCE_ENGINE_DEPRECATED("This is internal stuff. Use Inference Engine Plugin API") SOPointer { +class INFERENCE_ENGINE_1_0_DEPRECATED SOPointer { template friend class SOPointer; diff --git a/src/inference/include/ie/gpu/gpu_context_api_ocl.hpp b/src/inference/include/ie/gpu/gpu_context_api_ocl.hpp index 76b0c789481..c034c0bbc3d 100644 --- a/src/inference/include/ie/gpu/gpu_context_api_ocl.hpp +++ b/src/inference/include/ie/gpu/gpu_context_api_ocl.hpp @@ -10,6 +10,12 @@ */ #pragma once +// TODO: Remove after migration to new API in the benchmark app +#ifndef IN_OV_COMPONENT +# define IN_OV_COMPONENT +# define WAS_OV_LIBRARY_DEFINED +#endif + #include #include #include @@ -362,3 +368,8 @@ static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext:: } // namespace gpu } // namespace InferenceEngine + +#ifdef WAS_OV_LIBRARY_DEFINED +# undef IN_OV_COMPONENT +# undef WAS_OV_LIBRARY_DEFINED +#endif diff --git a/src/inference/include/ie/ie_allocator.hpp b/src/inference/include/ie/ie_allocator.hpp index 1a0c2ff0c10..bd01531526a 100644 --- a/src/inference/include/ie/ie_allocator.hpp +++ b/src/inference/include/ie/ie_allocator.hpp @@ -9,16 +9,27 @@ */ #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" +IE_SUPPRESS_DEPRECATED_START namespace InferenceEngine { /** * @brief Allocator handle mapping type */ -enum LockOp { +enum INFERENCE_ENGINE_1_0_DEPRECATED LockOp { LOCK_FOR_READ = 0, //!< A flag to lock data for read LOCK_FOR_WRITE //!< A flag to lock data for write }; @@ -27,7 +38,7 @@ enum LockOp { * @interface IAllocator * @brief Allocator concept to be used for memory management and is used as part of the Blob. */ -class IAllocator : public std::enable_shared_from_this { +class INFERENCE_ENGINE_1_0_DEPRECATED IAllocator : public std::enable_shared_from_this { public: /** * @brief Maps handle to heap memory accessible by any memory manipulation routines. @@ -69,6 +80,8 @@ protected: * * @return The Inference Engine IAllocator* instance */ -INFERENCE_ENGINE_API_CPP(std::shared_ptr) CreateDefaultAllocator() noexcept; +INFERENCE_ENGINE_API_CPP(std::shared_ptr) +INFERENCE_ENGINE_1_0_DEPRECATED CreateDefaultAllocator() noexcept; } // namespace InferenceEngine +IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/include/ie/ie_blob.h b/src/inference/include/ie/ie_blob.h index 7dcb814ef71..b2e50de49ff 100644 --- a/src/inference/include/ie/ie_blob.h +++ b/src/inference/include/ie/ie_blob.h @@ -28,6 +28,7 @@ #include "ie_precision.hpp" namespace InferenceEngine { +IE_SUPPRESS_DEPRECATED_START /** * @brief This class represents a universal container in the Inference Engine @@ -921,4 +922,5 @@ INFERENCE_ENGINE_API_CPP(Blob::Ptr) make_shared_blob(const Blob::Ptr& inputBlob, 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_compound_blob.h b/src/inference/include/ie/ie_compound_blob.h index 74a216bfb1a..28858ae27bc 100644 --- a/src/inference/include/ie/ie_compound_blob.h +++ b/src/inference/include/ie/ie_compound_blob.h @@ -15,6 +15,7 @@ #include "ie_blob.h" +IE_SUPPRESS_DEPRECATED_START namespace InferenceEngine { /** * @brief This class represents a blob that contains other blobs @@ -315,3 +316,4 @@ public: explicit BatchedBlob(std::vector&& blobs); }; } // namespace InferenceEngine +IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/include/ie/ie_core.hpp b/src/inference/include/ie/ie_core.hpp index dbf59a66784..b0bda40e528 100644 --- a/src/inference/include/ie/ie_core.hpp +++ b/src/inference/include/ie/ie_core.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 @@ -29,7 +39,7 @@ namespace InferenceEngine { * * It can throw exceptions safely for the application, where it is properly handled. */ -class INFERENCE_ENGINE_API_CLASS(Core) { +class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(Core) { class Impl; std::shared_ptr _impl; @@ -365,5 +375,5 @@ public: * You might want to use this function if you are developing a dynamically-loaded library which should clean up all * resources after itself when the library is unloaded. */ -INFERENCE_ENGINE_API_CPP(void) shutdown(); +INFERENCE_ENGINE_API_CPP(void) INFERENCE_ENGINE_1_0_DEPRECATED shutdown(); } // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_data.h b/src/inference/include/ie/ie_data.h index b5537eba591..7e22ff48392 100644 --- a/src/inference/include/ie/ie_data.h +++ b/src/inference/include/ie/ie_data.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 diff --git a/src/inference/include/ie/ie_extension.h b/src/inference/include/ie/ie_extension.h index f745ce7f63e..634e7d839a8 100644 --- a/src/inference/include/ie/ie_extension.h +++ b/src/inference/include/ie/ie_extension.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 diff --git a/src/inference/include/ie/ie_icnn_network.hpp b/src/inference/include/ie/ie_icnn_network.hpp index d8cbeab74f8..c183ade7f5b 100644 --- a/src/inference/include/ie/ie_icnn_network.hpp +++ b/src/inference/include/ie/ie_icnn_network.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 @@ -21,22 +31,21 @@ namespace InferenceEngine { -_IE_SUPPRESS_DEPRECATED_START_GCC +IE_SUPPRESS_DEPRECATED_START /** * @deprecated Use InferenceEngine::CNNNetwork wrapper instead * @interface ICNNNetwork * @brief This is the main interface to describe the NN topology */ -class INFERENCE_ENGINE_API_CLASS(ICNNNetwork) : public std::enable_shared_from_this { +class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(ICNNNetwork) + : public std::enable_shared_from_this { public: - IE_SUPPRESS_DEPRECATED_START /** * @deprecated Use InferenceEngine::CNNNetwork wrapper instead * @brief A shared pointer to a ICNNNetwork interface */ using Ptr = std::shared_ptr; - IE_SUPPRESS_DEPRECATED_END /** * @deprecated Use InferenceEngine::CNNNetwork wrapper instead @@ -257,14 +266,12 @@ public: } protected: - IE_SUPPRESS_DEPRECATED_START /** * @brief Default destructor. */ ~ICNNNetwork() = default; - IE_SUPPRESS_DEPRECATED_END }; -_IE_SUPPRESS_DEPRECATED_END_GCC +IE_SUPPRESS_DEPRECATED_END } // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_iextension.h b/src/inference/include/ie/ie_iextension.h index 9d23f4d9878..2ae0656509d 100644 --- a/src/inference/include/ie/ie_iextension.h +++ b/src/inference/include/ie/ie_iextension.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 diff --git a/src/inference/include/ie/ie_input_info.hpp b/src/inference/include/ie/ie_input_info.hpp index d1a2566668f..841e3d95316 100644 --- a/src/inference/include/ie/ie_input_info.hpp +++ b/src/inference/include/ie/ie_input_info.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 @@ -26,7 +36,7 @@ IE_SUPPRESS_DEPRECATED_START /** * @brief This class contains information about each input of the network */ -class InputInfo { +class INFERENCE_ENGINE_1_0_DEPRECATED InputInfo { public: /** @brief A smart pointer to the InputInfo instance */ using Ptr = std::shared_ptr; @@ -130,11 +140,12 @@ public: } /** - * @brief Initializes the pointer to the input data that stores the main input parameters like dims, etc + * @brief Initializes the pointer to the input data that stores the main input parameters like dims, + * etc * * This method initializes the precision with the information from the inputPtr if it was not set - * explicitly through InputInfo::setPrecision. If InputInfo::setPrecision is called, this method does not overwrite - * the precision. + * explicitly through InputInfo::setPrecision. If InputInfo::setPrecision is called, this method does + * not overwrite the precision. * @param inputPtr Pointer to the input data to set */ void setInputData(DataPtr inputPtr) { diff --git a/src/inference/include/ie/ie_locked_memory.hpp b/src/inference/include/ie/ie_locked_memory.hpp index aa784f290a5..d334745be42 100644 --- a/src/inference/include/ie/ie_locked_memory.hpp +++ b/src/inference/include/ie/ie_locked_memory.hpp @@ -9,17 +9,28 @@ */ #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_allocator.hpp" namespace InferenceEngine { +IE_SUPPRESS_DEPRECATED_START namespace details { /** * @brief This class is a LockedMemory concept for hardware memory */ template -class LockedMemoryBase { +class INFERENCE_ENGINE_1_0_DEPRECATED LockedMemoryBase { IAllocator* _allocator = nullptr; void* _handle = nullptr; mutable T* _locked = nullptr; @@ -114,7 +125,7 @@ protected: * @brief This class represents locked memory for read/write memory */ template -class LockedMemory : public details::LockedMemoryBase { +class INFERENCE_ENGINE_1_0_DEPRECATED LockedMemory : public details::LockedMemoryBase { using base = details::LockedMemoryBase; public: @@ -222,7 +233,7 @@ public: * @brief This class is for data and allows casting to any pointers */ template <> -class LockedMemory : public details::LockedMemoryBase { +class INFERENCE_ENGINE_1_0_DEPRECATED LockedMemory : public details::LockedMemoryBase { using base = details::LockedMemoryBase; public: @@ -291,6 +302,7 @@ public: return base::isEqualTo(lm.as()); } + IE_SUPPRESS_DEPRECATED_START /** * @brief Compares the object with the one stored in the memory * @param pointer A pointer to compare with @@ -300,6 +312,7 @@ public: friend bool operator==(const void* pointer, const LockedMemory& lm) { return lm.operator==(pointer); } + IE_SUPPRESS_DEPRECATED_END /** * @brief Casts stored object to any given type @@ -332,7 +345,7 @@ public: * @brief This class is for read-only segments */ template -class LockedMemory : public details::LockedMemoryBase { +class INFERENCE_ENGINE_1_0_DEPRECATED LockedMemory : public details::LockedMemoryBase { using base = details::LockedMemoryBase; public: @@ -411,4 +424,5 @@ public: return reinterpret_cast(base::dereference()); } }; +IE_SUPPRESS_DEPRECATED_END } // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_parameter.hpp b/src/inference/include/ie/ie_parameter.hpp index 8be0cc3b547..5141f5ab931 100644 --- a/src/inference/include/ie/ie_parameter.hpp +++ b/src/inference/include/ie/ie_parameter.hpp @@ -8,6 +8,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 diff --git a/src/inference/src/blob_factory.cpp b/src/inference/src/blob_factory.cpp index b434f4326ce..84081589702 100644 --- a/src/inference/src/blob_factory.cpp +++ b/src/inference/src/blob_factory.cpp @@ -6,6 +6,8 @@ #include +IE_SUPPRESS_DEPRECATED_START + InferenceEngine::Blob::Ptr make_blob_with_precision(const InferenceEngine::TensorDesc& desc) { return make_blob_with_precision(desc.getPrecision(), desc); } diff --git a/src/inference/src/blob_transform.cpp b/src/inference/src/blob_transform.cpp index f0f63babd07..75fafaf077f 100644 --- a/src/inference/src/blob_transform.cpp +++ b/src/inference/src/blob_transform.cpp @@ -14,6 +14,8 @@ //---------------------------------------------------------------------- +IE_SUPPRESS_DEPRECATED_START + namespace InferenceEngine { template diff --git a/src/inference/src/ie_blob_common.cpp b/src/inference/src/ie_blob_common.cpp index 8ce8fbbf1f7..9055445a573 100644 --- a/src/inference/src/ie_blob_common.cpp +++ b/src/inference/src/ie_blob_common.cpp @@ -10,6 +10,7 @@ #include "system_allocator.hpp" namespace InferenceEngine { +IE_SUPPRESS_DEPRECATED_START void Blob::setShape(const SizeVector& dims) { // we don't want to allow setShape for: diff --git a/src/inference/src/system_allocator.cpp b/src/inference/src/system_allocator.cpp index 39cecb7222e..a820893e4f0 100644 --- a/src/inference/src/system_allocator.cpp +++ b/src/inference/src/system_allocator.cpp @@ -5,6 +5,7 @@ #include "system_allocator.hpp" namespace InferenceEngine { +IE_SUPPRESS_DEPRECATED_START INFERENCE_ENGINE_API_CPP(std::shared_ptr) CreateDefaultAllocator() noexcept { try { diff --git a/src/inference/src/system_allocator.hpp b/src/inference/src/system_allocator.hpp index 941ffb94318..606cccf68e8 100644 --- a/src/inference/src/system_allocator.hpp +++ b/src/inference/src/system_allocator.hpp @@ -6,6 +6,7 @@ #include "ie_allocator.hpp" +IE_SUPPRESS_DEPRECATED_START namespace InferenceEngine { class SystemMemoryAllocator : public InferenceEngine::IAllocator { public: @@ -32,5 +33,6 @@ public: return true; } }; +IE_SUPPRESS_DEPRECATED_END } // namespace InferenceEngine diff --git a/src/inference/tests/functional/blob_copy_test.cpp b/src/inference/tests/functional/blob_copy_test.cpp index 619de75ad79..0807d5c24d9 100644 --- a/src/inference/tests/functional/blob_copy_test.cpp +++ b/src/inference/tests/functional/blob_copy_test.cpp @@ -12,6 +12,8 @@ using namespace ::testing; using namespace InferenceEngine; +IE_SUPPRESS_DEPRECATED_START + using ChannelNum = size_t; using BatchNum = size_t; using PrecisionType = InferenceEngine::Precision::ePrecision; diff --git a/src/inference/tests/functional/pre_allocator_test.cpp b/src/inference/tests/functional/pre_allocator_test.cpp index 0ca716566fd..eb009988405 100644 --- a/src/inference/tests/functional/pre_allocator_test.cpp +++ b/src/inference/tests/functional/pre_allocator_test.cpp @@ -13,6 +13,8 @@ using namespace ::testing; using namespace std; using namespace InferenceEngine; +IE_SUPPRESS_DEPRECATED_START + class PreallocatorTests : public ::testing::Test { protected: std::vector mybuf; diff --git a/src/inference/tests/unit/ie_blob_test.cpp b/src/inference/tests/unit/ie_blob_test.cpp index ddda510d146..44841054cdb 100644 --- a/src/inference/tests/unit/ie_blob_test.cpp +++ b/src/inference/tests/unit/ie_blob_test.cpp @@ -8,6 +8,8 @@ #include "unit_test_utils/mocks/mock_allocator.hpp" +IE_SUPPRESS_DEPRECATED_START + class BlobTests : public ::testing::Test { protected: std::shared_ptr createMockAllocator() { diff --git a/src/inference/tests/unit/ie_compound_blob_test.cpp b/src/inference/tests/unit/ie_compound_blob_test.cpp index 17a4c91af52..adf5ac58155 100644 --- a/src/inference/tests/unit/ie_compound_blob_test.cpp +++ b/src/inference/tests/unit/ie_compound_blob_test.cpp @@ -12,6 +12,8 @@ using namespace ::testing; using namespace std; using namespace InferenceEngine; +IE_SUPPRESS_DEPRECATED_START + class CompoundBlobTests : public ::testing::Test { protected: Blob::Ptr _test_blob; diff --git a/src/inference/tests/unit/ie_locked_memory_test.cpp b/src/inference/tests/unit/ie_locked_memory_test.cpp index fecc8f08fa1..d27466f7ad1 100644 --- a/src/inference/tests/unit/ie_locked_memory_test.cpp +++ b/src/inference/tests/unit/ie_locked_memory_test.cpp @@ -9,6 +9,8 @@ using namespace InferenceEngine; using namespace ::testing; +IE_SUPPRESS_DEPRECATED_START + TEST(LockedMemoryTest, canUnlockMemoryAfterUsage) { std::unique_ptr allocator(new MockAllocator()); char array[] = {1, 2, 3}; diff --git a/src/plugins/template/src/compiled_model.cpp b/src/plugins/template/src/compiled_model.cpp index ae1f77408ed..a929d4fbc36 100644 --- a/src/plugins/template/src/compiled_model.cpp +++ b/src/plugins/template/src/compiled_model.cpp @@ -7,7 +7,6 @@ #include #include "async_infer_request.hpp" -#include "ie_ngraph_utils.hpp" #include "ie_plugin_config.hpp" #include "itt.hpp" #include "openvino/op/util/op_types.hpp" diff --git a/src/plugins/template/src/plugin.cpp b/src/plugins/template/src/plugin.cpp index 9f4edbadf39..e23dad74d6f 100644 --- a/src/plugins/template/src/plugin.cpp +++ b/src/plugins/template/src/plugin.cpp @@ -6,7 +6,6 @@ #include -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" #include "ie_plugin_config.hpp" #include "itt.hpp" #include "openvino/pass/manager.hpp" diff --git a/src/tests/ie_test_utils/unit_test_utils/mocks/mock_allocator.hpp b/src/tests/ie_test_utils/unit_test_utils/mocks/mock_allocator.hpp index 47db1fab8a4..383efaa4873 100644 --- a/src/tests/ie_test_utils/unit_test_utils/mocks/mock_allocator.hpp +++ b/src/tests/ie_test_utils/unit_test_utils/mocks/mock_allocator.hpp @@ -12,10 +12,12 @@ #include "ie_allocator.hpp" +IE_SUPPRESS_DEPRECATED_START class MockAllocator : public InferenceEngine::IAllocator { public: MOCK_METHOD(void*, lock, (void*, InferenceEngine::LockOp), (noexcept)); - MOCK_METHOD(void, unlock, (void *), (noexcept)); + MOCK_METHOD(void, unlock, (void*), (noexcept)); MOCK_METHOD(void*, alloc, (size_t), (noexcept)); MOCK_METHOD(bool, free, (void*), (noexcept)); // NOLINT(readability/casting) }; +IE_SUPPRESS_DEPRECATED_END diff --git a/tools/compile_tool/CMakeLists.txt b/tools/compile_tool/CMakeLists.txt index 8ef771f4ba5..b867c8a4022 100644 --- a/tools/compile_tool/CMakeLists.txt +++ b/tools/compile_tool/CMakeLists.txt @@ -3,6 +3,7 @@ # set(TARGET_NAME compile_tool) +add_definitions(-DIN_OV_COMPONENT) file(GLOB SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp diff --git a/tools/legacy/benchmark_app/CMakeLists.txt b/tools/legacy/benchmark_app/CMakeLists.txt index 58bedb0f759..cd6bb4aa8bd 100644 --- a/tools/legacy/benchmark_app/CMakeLists.txt +++ b/tools/legacy/benchmark_app/CMakeLists.txt @@ -3,6 +3,7 @@ # set(TARGET_NAME benchmark_app_legacy) +add_definitions(-DIN_OV_COMPONENT) file (GLOB SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) file (GLOB HDR ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)