Mark some legacy API as deprecated (#17469)

* Mark some legacy API as deprecated

* Try to fix some issues

* Fixed some warnings

* Disable deprecation warnings for GNA

* Fixed some warnings

* Disable deprecation errors for all plugins

* Suppress some warnings

* Suppress some warnings

* Suppress deprecated for tests

* Mark all contend as suppressed

* Try to fix extensions

* Suppress more warnings

* Suppress warnings for transformations

* Global suppress of deprecation warnings

* FIxed some warnings

* Fixed comments

* Create macro for deprecation API

* Fixed data tests
This commit is contained in:
Ilya Churaev
2023-05-17 11:31:01 +04:00
committed by GitHub
parent 92a0108f0d
commit 3cbc5581ab
15 changed files with 64 additions and 21 deletions

View File

@@ -199,6 +199,7 @@ public:
virtual ov::SupportedOpsMap query_model(const std::shared_ptr<const ov::Model>& model,
const ov::AnyMap& properties) const = 0;
OPENVINO_SUPPRESS_DEPRECATED_START
/**
* @deprecated This method allows to load legacy Inference Engine Extensions and will be removed in 2024.0 release
* @brief Registers legacy extension within plugin
@@ -207,6 +208,7 @@ public:
OPENVINO_DEPRECATED(
"This method allows to load legacy Inference Engine Extensions and will be removed in 2024.0 release")
virtual void add_extension(const std::shared_ptr<InferenceEngine::IExtension>& extension);
OPENVINO_SUPPRESS_DEPRECATED_END
/**
* @brief Sets pointer to ICore interface

View File

@@ -44,7 +44,6 @@ public:
*/
INFERENCE_ENGINE_DEPRECATED("Don't use this constructor. It will be removed soon")
explicit CNNNetwork(std::shared_ptr<ICNNNetwork> network);
IE_SUPPRESS_DEPRECATED_END
/**
* @brief A constructor from ngraph::Function object
@@ -55,6 +54,7 @@ public:
*/
explicit CNNNetwork(const std::shared_ptr<ngraph::Function>& network,
const std::vector<std::shared_ptr<IExtension>>& exts = {});
IE_SUPPRESS_DEPRECATED_END
/**
* @brief Gets the network output Data node information. The received info is stored in the given Data node.

View File

@@ -53,6 +53,11 @@
# define INFERENCE_ENGINE_ENUM_DEPRECATED(msg)
#endif
#define INFERENCE_ENGINE_1_0_DEPRECATED \
INFERENCE_ENGINE_DEPRECATED("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")
// Suppress warning "-Wdeprecated-declarations" / C4996
#if defined(__GNUC__)
# define IE_DO_PRAGMA(x) _Pragma(# x)

View File

@@ -22,11 +22,13 @@
namespace InferenceEngine {
/**
* @deprecated 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
* @brief This class represents the main Data representation node.
*
* The NN graphs are di-graphs consisting of data nodes and layer nodes.
*/
class INFERENCE_ENGINE_API_CLASS(Data) {
class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(Data) {
class Impl;
public:

View File

@@ -19,10 +19,13 @@
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
* transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
* @brief This class is a C++ helper to work with objects created using extensions.
*/
class INFERENCE_ENGINE_API_CLASS(Extension) final : public IExtension {
class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(Extension) final : public IExtension {
public:
/**
* @brief Loads extension from a shared library
@@ -99,30 +102,32 @@ protected:
};
/**
* @deprecated 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
* @brief Creates extension using deprecated API
* @tparam T extension type
* @param name extension library name
* @return shared pointer to extension
*/
template <typename T = IExtension>
INFERENCE_ENGINE_DEPRECATED("Use std::make_shared<Extension>")
inline std::shared_ptr<T> make_so_pointer(const std::string& name) {
INFERENCE_ENGINE_1_0_DEPRECATED inline std::shared_ptr<T> make_so_pointer(const std::string& name) {
return std::make_shared<Extension>(name);
}
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
/**
* @deprecated 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
* @brief Creates extension using deprecated API
* @param name extension library name
* @return shared pointer to extension
*/
template <typename T = IExtension>
INFERENCE_ENGINE_DEPRECATED("Use std::make_shared<Extension>")
inline std::shared_ptr<IExtension> make_so_pointer(const std::wstring& name) {
INFERENCE_ENGINE_1_0_DEPRECATED inline std::shared_ptr<IExtension> make_so_pointer(const std::wstring& name) {
return std::make_shared<Extension>(name);
}
#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
IE_SUPPRESS_DEPRECATED_END
} // namespace InferenceEngine

View File

@@ -40,12 +40,15 @@
#endif
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
* transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html
* @struct DataConfig
* @brief This structure describes data configuration
*/
struct DataConfig {
struct INFERENCE_ENGINE_1_0_DEPRECATED DataConfig {
/**
* @brief Format of memory descriptor
*/
@@ -62,10 +65,12 @@ struct DataConfig {
};
/**
* @deprecated 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
* @struct LayerConfig
* @brief This structure describes Layer configuration
*/
struct LayerConfig {
struct INFERENCE_ENGINE_1_0_DEPRECATED LayerConfig {
/**
* @brief Supported dynamic batch. If false, dynamic batch is not supported
*/
@@ -81,10 +86,12 @@ struct LayerConfig {
};
/**
* @deprecated 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
* @interface ILayerImpl
* @brief This class provides interface for extension implementations
*/
class INFERENCE_ENGINE_API_CLASS(ILayerImpl) {
class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(ILayerImpl) {
public:
/**
* @brief A shared pointer to the ILayerImpl interface
@@ -98,10 +105,12 @@ public:
};
/**
* @deprecated 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
* @interface ILayerExecImpl
* @brief This class provides interface for the implementation with the custom execution code
*/
class INFERENCE_ENGINE_API_CLASS(ILayerExecImpl) : public ILayerImpl {
class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(ILayerExecImpl) : public ILayerImpl {
public:
/**
* @brief A shared pointer to the ILayerExecImpl interface
@@ -145,9 +154,12 @@ public:
};
/**
* @deprecated 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
* @brief This class is the main extension interface
*/
class INFERENCE_ENGINE_API_CLASS(IExtension) : public std::enable_shared_from_this<IExtension> {
class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(IExtension)
: public std::enable_shared_from_this<IExtension> {
public:
/**
* @brief Returns operation sets
@@ -221,15 +233,17 @@ INFERENCE_EXTENSION_API(void) CreateExtensionShared(IExtensionPtr& ext);
* @return InferenceEngine::OK if extension is constructed and InferenceEngine::GENERAL_ERROR otherwise
*/
#ifdef _MSC_VER
INFERENCE_ENGINE_DEPRECATED("Use IE_DEFINE_EXTENSION_CREATE_FUNCTION macro")
INFERENCE_EXTENSION_API(StatusCode)
INFERENCE_ENGINE_1_0_DEPRECATED
CreateExtension(IExtension*& ext, ResponseDesc* resp) noexcept;
#else
INFERENCE_EXTENSION_API(StatusCode)
INFERENCE_ENGINE_1_0_DEPRECATED
CreateExtension(IExtension*& ext, ResponseDesc* resp) noexcept INFERENCE_ENGINE_DEPRECATED(
"Use IE_DEFINE_EXTENSION_CREATE_FUNCTION macro");
#endif
IE_SUPPRESS_DEPRECATED_END
} // namespace InferenceEngine
/**
@@ -241,12 +255,14 @@ CreateExtension(IExtension*& ext, ResponseDesc* resp) noexcept INFERENCE_ENGINE_
#endif
/**
* @deprecated 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
* @def IE_DEFINE_EXTENSION_CREATE_FUNCTION
* @brief Generates extension creation function
*/
#define IE_DEFINE_EXTENSION_CREATE_FUNCTION(ExtensionType) \
INFERENCE_EXTENSION_API(void) \
IE_CREATE_EXTENSION(std::shared_ptr<InferenceEngine::IExtension>& ext); \
void IE_CREATE_EXTENSION(std::shared_ptr<InferenceEngine::IExtension>& ext) { \
ext = std::make_shared<ExtensionType>(); \
#define IE_DEFINE_EXTENSION_CREATE_FUNCTION(ExtensionType) \
INFERENCE_EXTENSION_API(void) \
INFERENCE_ENGINE_1_0_DEPRECATED IE_CREATE_EXTENSION(std::shared_ptr<InferenceEngine::IExtension>& ext); \
void IE_CREATE_EXTENSION(std::shared_ptr<InferenceEngine::IExtension>& ext) { \
ext = std::make_shared<ExtensionType>(); \
}

View File

@@ -22,6 +22,7 @@
namespace InferenceEngine {
IE_SUPPRESS_DEPRECATED_START
/**
* @brief This class contains information about each input of the network
*/
@@ -188,5 +189,6 @@ using InputsDataMap = std::map<std::string, InputInfo::Ptr>;
* @brief A collection that contains string as key, and const InputInfo smart pointer as value
*/
using ConstInputsDataMap = std::map<std::string, InputInfo::CPtr>;
IE_SUPPRESS_DEPRECATED_END
} // namespace InferenceEngine

View File

@@ -359,6 +359,7 @@ public:
return compile_model(model, context, AnyMap{std::forward<Properties>(properties)...});
}
OPENVINO_SUPPRESS_DEPRECATED_START
/**
* @deprecated This method is deprecated. Please use other Core::add_extension methods.
* @brief Registers OpenVINO 1.0 extension to a Core object.
@@ -366,6 +367,7 @@ public:
*/
OPENVINO_DEPRECATED("Please use add_extension(ov::Extension) or add_extension(path_to_library) instead.")
void add_extension(const std::shared_ptr<InferenceEngine::IExtension>& extension);
OPENVINO_SUPPRESS_DEPRECATED_END
/**
* @brief Registers an extension to a Core object.

View File

@@ -8,6 +8,8 @@
using namespace InferenceEngine;
IE_SUPPRESS_DEPRECATED_START
namespace {
template <typename T>

View File

@@ -20,6 +20,7 @@
#include "openvino/core/except.hpp"
namespace InferenceEngine {
IE_SUPPRESS_DEPRECATED_START
//
// ie_iextension.h

View File

@@ -9,6 +9,7 @@
using namespace ::testing;
using namespace std;
using namespace InferenceEngine;
IE_SUPPRESS_DEPRECATED_START
class DataTests : public ::testing::Test {
protected:

View File

@@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0
#
ov_deprecated_no_errors()
set(skip_module "${CMAKE_CURRENT_SOURCE_DIR}/template")
file(GLOB local_modules "${CMAKE_CURRENT_SOURCE_DIR}/*")
foreach(module_path IN LISTS local_modules)

View File

@@ -417,12 +417,11 @@ using CNNLayerPtr = std::shared_ptr<CNNLayer>;
*/
using CNNLayerWeakPtr = std::weak_ptr<CNNLayer>;
IE_SUPPRESS_DEPRECATED_END
CNNLayerWeakPtr& getCreatorLayer(const DataPtr& data);
std::map<std::string, CNNLayerPtr>& getInputTo(const DataPtr& data);
std::map<std::string, CNNLayerPtr>& getInputTo(Data* data);
IE_SUPPRESS_DEPRECATED_END
_IE_SUPPRESS_DEPRECATED_START_MSVC

View File

@@ -24,6 +24,8 @@ else()
ie_add_compiler_flags(-Wno-all)
endif()
ov_deprecated_no_errors()
add_subdirectory(ngraph_helpers)
add_subdirectory(ie_test_utils)
add_subdirectory(util)

View File

@@ -97,6 +97,7 @@ 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());
@@ -140,6 +141,7 @@ inline void compare_inputs_info(const InferenceEngine::InputsDataMap & lhs, cons
ASSERT_DATA_EQ(*i->second->getInputData().get(), *j->second->getInputData().get());
}
}
IE_SUPPRESS_DEPRECATED_END
inline void compare_cpp_strings(const std::string & lhs, const std::string &rhs) {
ASSERT_STREQ(lhs.c_str(), rhs.c_str());