Deprecate legacy precisions and layouts (#17803)
* Deprecate legacy precisions and layouts * Suppress some warnings * Fixed some warnings
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <algorithm>
|
||||
|
||||
#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<size_t>& begin,
|
||||
const std::vector<size_t>& end,
|
||||
bool useOrigMemDesc);
|
||||
INFERENCE_ENGINE_1_0_DEPRECATED make_roi_desc(const TensorDesc& origDesc,
|
||||
const std::vector<size_t>& begin,
|
||||
const std::vector<size_t>& end,
|
||||
bool useOrigMemDesc);
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
} // namespace InferenceEngine
|
||||
|
||||
@@ -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 <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
@@ -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 <Precision::ePrecision p>
|
||||
struct PrecisionTrait {};
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait {};
|
||||
|
||||
/** @cond INTERNAL */
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::FP32> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::FP32> {
|
||||
using value_type = float;
|
||||
enum { is_float = true };
|
||||
};
|
||||
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::FP64> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::FP64> {
|
||||
using value_type = double;
|
||||
enum { is_float = true };
|
||||
};
|
||||
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::FP16> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::FP16> {
|
||||
using value_type = int16_t;
|
||||
enum { is_float = true };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::BF16> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::BF16> {
|
||||
using value_type = int16_t;
|
||||
enum { is_float = true };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::Q78> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::Q78> {
|
||||
using value_type = uint16_t;
|
||||
enum { is_float = false };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::I16> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::I16> {
|
||||
using value_type = int16_t;
|
||||
enum { is_float = false };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::U16> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::U16> {
|
||||
using value_type = uint16_t;
|
||||
enum { is_float = false };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::U4> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::U4> {
|
||||
using value_type = uint8_t;
|
||||
enum { is_float = false };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::U8> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::U8> {
|
||||
using value_type = uint8_t;
|
||||
enum { is_float = false };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::I4> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::I4> {
|
||||
using value_type = int8_t;
|
||||
enum { is_float = false };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::I8> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::I8> {
|
||||
using value_type = int8_t;
|
||||
enum { is_float = false };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::BOOL> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::BOOL> {
|
||||
using value_type = uint8_t;
|
||||
enum { is_float = false };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::I32> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::I32> {
|
||||
using value_type = int32_t;
|
||||
enum { is_float = false };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::U32> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::U32> {
|
||||
using value_type = uint32_t;
|
||||
enum { is_float = false };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::I64> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::I64> {
|
||||
using value_type = int64_t;
|
||||
enum { is_float = false };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::U64> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::U64> {
|
||||
using value_type = uint64_t;
|
||||
enum { is_float = false };
|
||||
};
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::BIN> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::BIN> {
|
||||
using value_type = int8_t;
|
||||
enum { is_float = false };
|
||||
};
|
||||
|
||||
template <class T>
|
||||
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<Precision::UNSPECIFIED> {
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::UNSPECIFIED> {
|
||||
using value_type = void;
|
||||
enum { is_float = false };
|
||||
};
|
||||
|
||||
template <>
|
||||
struct PrecisionTrait<Precision::MIXED> : PrecisionTrait<Precision::UNSPECIFIED> {};
|
||||
struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait<Precision::MIXED> : PrecisionTrait<Precision::UNSPECIFIED> {};
|
||||
|
||||
template <>
|
||||
inline uint8_t type_size_or_zero<void>() {
|
||||
INFERENCE_ENGINE_1_0_DEPRECATED inline uint8_t type_size_or_zero<void>() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <Precision::ePrecision precision>
|
||||
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<Precision>&
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<RemoteContext> getContext() const noexcept = 0;
|
||||
};
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
} // namespace InferenceEngine
|
||||
|
||||
@@ -13,10 +13,12 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#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
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <map>
|
||||
|
||||
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
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace InferenceEngine {
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
MemoryBlob::Ptr RemoteContext::CreateHostBlob(const TensorDesc& tensorDesc) {
|
||||
auto blob = std::dynamic_pointer_cast<MemoryBlob>(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
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include <ie_precision.hpp>
|
||||
#include <string>
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
|
||||
using Precision = InferenceEngine::Precision;
|
||||
|
||||
using PrecisionTests = ::testing::Test;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
using PreProcessTests = ::testing::Test;
|
||||
|
||||
TEST_F(PreProcessTests, throwsOnSettingNullMeanImage) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user