From 2b1637f28d111c6de11d7926b5f26af64ce6ff18 Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Wed, 1 Sep 2021 08:17:11 +0300 Subject: [PATCH] Deprecate nGraph API to don't include it to public API (#7171) * Deprecate stopwatch * Deprecate some utils * Deprecate versions * Moved slice_plan from the top level * Fixed build * Deprecate more old structures * Fixed linux build --- ngraph/core/include/ngraph/distributed.hpp | 2 + ngraph/core/include/ngraph/evaluator.hpp | 5 +- .../core/include/ngraph/factory_adapter.hpp | 5 +- ngraph/core/include/ngraph/ngraph.hpp | 9 ++- .../include/ngraph/op/util/slice_plan.hpp | 56 +++++++++++++++++++ ngraph/core/include/ngraph/slice_plan.hpp | 49 +--------------- ngraph/core/include/ngraph/util.hpp | 35 +++++++++--- .../reference/src/coordinate_transform.cpp | 2 + ngraph/core/src/distributed.cpp | 3 + ngraph/core/src/ngraph.cpp | 2 + ngraph/core/src/op/constant.cpp | 2 + ngraph/core/src/op/transpose.cpp | 2 + ngraph/core/src/{ => op/util}/slice_plan.cpp | 0 ngraph/core/src/pass/manager.cpp | 4 +- ngraph/core/src/runtime/aligned_buffer.cpp | 2 + ngraph/core/src/runtime/host_tensor.cpp | 4 ++ ngraph/core/src/type.cpp | 2 + ngraph/core/src/util.cpp | 1 + ngraph/core/src/validation_util.cpp | 1 + ngraph/test/bfloat16.cpp | 2 + .../runtime/interpreter/int_executable.hpp | 43 +++++++------- 21 files changed, 147 insertions(+), 84 deletions(-) create mode 100644 ngraph/core/include/ngraph/op/util/slice_plan.hpp rename ngraph/core/src/{ => op/util}/slice_plan.cpp (100%) diff --git a/ngraph/core/include/ngraph/distributed.hpp b/ngraph/core/include/ngraph/distributed.hpp index f36c318cf05..ed4a0e84c80 100644 --- a/ngraph/core/include/ngraph/distributed.hpp +++ b/ngraph/core/include/ngraph/distributed.hpp @@ -21,8 +21,10 @@ enum class Type { MAX, }; +NGRAPH_SUPPRESS_DEPRECATED_START NGRAPH_API std::ostream& operator<<(std::ostream& out, const Type& obj); +NGRAPH_SUPPRESS_DEPRECATED_END } // namespace reduction } // namespace ngraph diff --git a/ngraph/core/include/ngraph/evaluator.hpp b/ngraph/core/include/ngraph/evaluator.hpp index 63ba4826a26..d67110fffb5 100644 --- a/ngraph/core/include/ngraph/evaluator.hpp +++ b/ngraph/core/include/ngraph/evaluator.hpp @@ -8,6 +8,7 @@ #include #include +#include "ngraph/deprecated.hpp" #include "ngraph/node.hpp" #include "ngraph/shape.hpp" #include "ngraph/type/element_type_traits.hpp" @@ -17,7 +18,8 @@ namespace ngraph { /// /// template -class Evaluator { +class NGRAPH_DEPRECATED("This class is deprecated and will be removed soon.") Evaluator { + NGRAPH_SUPPRESS_DEPRECATED_START public: /// \brief values we compute for outputs using value_map = std::map; @@ -172,5 +174,6 @@ protected: op_handler_map m_handlers; op_handler m_default_handler; value_map& m_value_map; + NGRAPH_SUPPRESS_DEPRECATED_END }; } // namespace ngraph diff --git a/ngraph/core/include/ngraph/factory_adapter.hpp b/ngraph/core/include/ngraph/factory_adapter.hpp index a465857129f..6ae19e5a473 100644 --- a/ngraph/core/include/ngraph/factory_adapter.hpp +++ b/ngraph/core/include/ngraph/factory_adapter.hpp @@ -6,11 +6,14 @@ #include "ngraph/attribute_adapter.hpp" #include "ngraph/attribute_visitor.hpp" +#include "ngraph/deprecated.hpp" #include "ngraph/factory.hpp" namespace ngraph { template -class FactoryAttributeAdapter : public VisitorAdapter { + +class NGRAPH_DEPRECATED("This class is deprecated and will be removed soon.") FactoryAttributeAdapter + : public VisitorAdapter { public: FactoryAttributeAdapter(std::shared_ptr& ref) : m_ref(ref) {} diff --git a/ngraph/core/include/ngraph/ngraph.hpp b/ngraph/core/include/ngraph/ngraph.hpp index 38a8365f8a6..a759eae29b6 100644 --- a/ngraph/core/include/ngraph/ngraph.hpp +++ b/ngraph/core/include/ngraph/ngraph.hpp @@ -10,13 +10,19 @@ #include +#include "ngraph/deprecated.hpp" + #ifdef IN_NGRAPH_LIBRARY # error("ngraph.hpp is for external use only") #endif #include -extern "C" NGRAPH_API const char* get_ngraph_version_string(); +// clang-format off +extern "C" NGRAPH_API +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +const char* get_ngraph_version_string(); +// clang-format on namespace ngraph { /// \brief Function to query parsed version information of the version of ngraph which @@ -30,6 +36,7 @@ namespace ngraph { /// /// \note Throws a runtime_error if there is an error during parsing NGRAPH_API +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") void get_version(size_t& major, size_t& minor, size_t& patch, std::string& extra); } // namespace ngraph diff --git a/ngraph/core/include/ngraph/op/util/slice_plan.hpp b/ngraph/core/include/ngraph/op/util/slice_plan.hpp new file mode 100644 index 00000000000..cd636450d1e --- /dev/null +++ b/ngraph/core/include/ngraph/op/util/slice_plan.hpp @@ -0,0 +1,56 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include + +#include "ngraph/axis_set.hpp" +#include "ngraph/shape.hpp" + +namespace ngraph { +// +// In various places, like ConstantFolding, it is +// useful to transform DynSlice by converting it to a sequence of ops: +// +// Slice (to do the basic slicing) +// | +// v +// Reshape (non-transposing, to handle shrinks) +// | +// v +// Reverse (to emulate backwards stride) +// +// (The Reshape, Reverse, or both may be omitted if they would just be +// identities.) +// +// A SlicePlan is used to collect parameters for these ops. +// +struct NGRAPH_API SlicePlan { + // Parameters for the Slice + std::vector begins; + std::vector ends; + std::vector strides; + + // Shapes coming into, and going out of, the Reshape. + Shape reshape_in_shape; + Shape reshape_out_shape; + + // Parameters for the Reverse + AxisSet reverse_axes; + + bool operator==(const SlicePlan& other) const; + bool operator!=(const SlicePlan& other) const; +}; + +SlicePlan NGRAPH_API make_slice_plan(const Shape& input_shape, + const std::vector& begins, + const std::vector& ends, + const std::vector& strides, + const AxisSet& lower_bounds_mask, + const AxisSet& upper_bounds_mask, + const AxisSet& new_axis_mask, + const AxisSet& shrink_axis_mask, + const AxisSet& ellipsis_mask); +} // namespace ngraph diff --git a/ngraph/core/include/ngraph/slice_plan.hpp b/ngraph/core/include/ngraph/slice_plan.hpp index cd636450d1e..2f6eb7f0041 100644 --- a/ngraph/core/include/ngraph/slice_plan.hpp +++ b/ngraph/core/include/ngraph/slice_plan.hpp @@ -6,51 +6,4 @@ #include -#include "ngraph/axis_set.hpp" -#include "ngraph/shape.hpp" - -namespace ngraph { -// -// In various places, like ConstantFolding, it is -// useful to transform DynSlice by converting it to a sequence of ops: -// -// Slice (to do the basic slicing) -// | -// v -// Reshape (non-transposing, to handle shrinks) -// | -// v -// Reverse (to emulate backwards stride) -// -// (The Reshape, Reverse, or both may be omitted if they would just be -// identities.) -// -// A SlicePlan is used to collect parameters for these ops. -// -struct NGRAPH_API SlicePlan { - // Parameters for the Slice - std::vector begins; - std::vector ends; - std::vector strides; - - // Shapes coming into, and going out of, the Reshape. - Shape reshape_in_shape; - Shape reshape_out_shape; - - // Parameters for the Reverse - AxisSet reverse_axes; - - bool operator==(const SlicePlan& other) const; - bool operator!=(const SlicePlan& other) const; -}; - -SlicePlan NGRAPH_API make_slice_plan(const Shape& input_shape, - const std::vector& begins, - const std::vector& ends, - const std::vector& strides, - const AxisSet& lower_bounds_mask, - const AxisSet& upper_bounds_mask, - const AxisSet& new_axis_mask, - const AxisSet& shrink_axis_mask, - const AxisSet& ellipsis_mask); -} // namespace ngraph +#include "ngraph/op/util/slice_plan.hpp" diff --git a/ngraph/core/include/ngraph/util.hpp b/ngraph/core/include/ngraph/util.hpp index 2f4d2c376a4..d5a85793e5f 100644 --- a/ngraph/core/include/ngraph/util.hpp +++ b/ngraph/core/include/ngraph/util.hpp @@ -34,8 +34,6 @@ using ov::Node; class stopwatch; namespace runtime { -class Backend; -class Value; class Tensor; } // namespace runtime @@ -60,8 +58,10 @@ std::string vector_to_string(const T& v) { } NGRAPH_API +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") size_t hash_combine(const std::vector& list); NGRAPH_API +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") void dump(std::ostream& out, const void*, size_t); NGRAPH_API std::string to_lower(const std::string& s); @@ -73,6 +73,7 @@ NGRAPH_API std::vector split(const std::string& s, char delimiter, bool trim = false); template +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") std::string locale_string(T x) { std::stringstream ss; ss.imbue(std::locale("")); @@ -80,7 +81,7 @@ std::string locale_string(T x) { return ss.str(); } -class NGRAPH_API stopwatch { +class NGRAPH_API NGRAPH_DEPRECATED("It is obsolete structure and will be removed soon") stopwatch { public: void start() { if (m_active == false) { @@ -122,6 +123,7 @@ private: /// Parses a string containing a literal of the underlying type. template +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") T parse_string(const std::string& s) { T result; std::stringstream ss; @@ -140,26 +142,33 @@ T parse_string(const std::string& s) { /// template specializations for float and double to handle INFINITY, -INFINITY /// and NaN values. template <> +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") NGRAPH_API float parse_string(const std::string& s); template <> +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") NGRAPH_API double parse_string(const std::string& s); /// template specializations for int8_t and uint8_t to handle the fact that default /// implementation ends up treating values as characters so that the number "0" turns into /// the parsed value 48, which is it's ASCII value template <> +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") NGRAPH_API int8_t parse_string(const std::string& s); template <> +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") NGRAPH_API uint8_t parse_string(const std::string& s); /// Parses a list of strings containing literals of the underlying type. template +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") std::vector parse_string(const std::vector& ss) { + NGRAPH_SUPPRESS_DEPRECATED_START std::vector result(ss.size()); std::transform(ss.begin(), ss.end(), result.begin(), [](const std::string& s) { return parse_string(s); }); return result; + NGRAPH_SUPPRESS_DEPRECATED_END } template @@ -168,30 +177,41 @@ T ceil_div(const T& x, const T& y) { } template +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") T subtract_or_zero(T x, T y) { return y > x ? 0 : x - y; } NGRAPH_API +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") void* ngraph_malloc(size_t size); NGRAPH_API +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") void ngraph_free(void*); NGRAPH_API size_t round_up(size_t size, size_t alignment); + +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") bool is_valid_permutation(ngraph::AxisVector permutation, ngraph::Rank rank = Rank::dynamic()); template +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") T apply_permutation(T input, ngraph::AxisVector order); -extern template NGRAPH_API AxisVector apply_permutation(AxisVector input, AxisVector order); +extern template NGRAPH_API NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") + AxisVector apply_permutation(AxisVector input, AxisVector order); -extern template NGRAPH_API Coordinate apply_permutation(Coordinate input, AxisVector order); +extern template NGRAPH_API NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") + Coordinate apply_permutation(Coordinate input, AxisVector order); -extern template NGRAPH_API Strides apply_permutation(Strides input, AxisVector order); +extern template NGRAPH_API NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") Strides + apply_permutation(Strides input, AxisVector order); -extern template NGRAPH_API Shape apply_permutation(Shape input, AxisVector order); +extern template NGRAPH_API NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") Shape + apply_permutation(Shape input, AxisVector order); template <> +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") NGRAPH_API PartialShape apply_permutation(PartialShape input, AxisVector order); NGRAPH_API @@ -317,6 +337,7 @@ private: /// /// \note Throws a runtime_error if there is an error during parsing NGRAPH_API +NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") void parse_version_string(std::string version, size_t& major, size_t& minor, size_t& patch, std::string& extra); template diff --git a/ngraph/core/reference/src/coordinate_transform.cpp b/ngraph/core/reference/src/coordinate_transform.cpp index 84a9639d6c8..0acfedfb1e5 100644 --- a/ngraph/core/reference/src/coordinate_transform.cpp +++ b/ngraph/core/reference/src/coordinate_transform.cpp @@ -123,8 +123,10 @@ CoordinateTransform::CoordinateTransform(const Shape& source_shape, std::vector padded_upper_bounds; for (size_t i = 0; i < m_n_axes; i++) { + NGRAPH_SUPPRESS_DEPRECATED_START std::ptrdiff_t padded_upper_bound = subtract_or_zero(source_shape[i], size_t(1)) * target_dilation_strides[i] + 1 + target_padding_below[i] + target_padding_above[i]; + NGRAPH_SUPPRESS_DEPRECATED_END if (padded_upper_bound < 0) { std::stringstream ss; diff --git a/ngraph/core/src/distributed.cpp b/ngraph/core/src/distributed.cpp index 5849ef9d2b5..52058275052 100644 --- a/ngraph/core/src/distributed.cpp +++ b/ngraph/core/src/distributed.cpp @@ -7,6 +7,9 @@ #include "ngraph/log.hpp" #include "ngraph/type.hpp" +NGRAPH_SUPPRESS_DEPRECATED_START +using namespace ngraph; + namespace ov { template <> EnumNames& EnumNames::get() { diff --git a/ngraph/core/src/ngraph.cpp b/ngraph/core/src/ngraph.cpp index 7f6687cdd15..69e0d84d0da 100644 --- a/ngraph/core/src/ngraph.cpp +++ b/ngraph/core/src/ngraph.cpp @@ -15,7 +15,9 @@ extern "C" NGRAPH_API const char* get_ngraph_version_string() { namespace ngraph { NGRAPH_API void get_version(size_t& major, size_t& minor, size_t& patch, std::string& extra) { + NGRAPH_SUPPRESS_DEPRECATED_START string version = NGRAPH_VERSION_NUMBER; ngraph::parse_version_string(version, major, minor, patch, extra); + NGRAPH_SUPPRESS_DEPRECATED_END } } // namespace ngraph diff --git a/ngraph/core/src/op/constant.cpp b/ngraph/core/src/op/constant.cpp index becbd1c91d1..763f508d16d 100644 --- a/ngraph/core/src/op/constant.cpp +++ b/ngraph/core/src/op/constant.cpp @@ -56,6 +56,7 @@ op::Constant::Constant(const shared_ptr& tensor) { op::Constant::Constant(const element::Type& type, const Shape& shape, const std::vector& values) : Constant(type, shape) { + NGRAPH_SUPPRESS_DEPRECATED_START NODE_VALIDATION_CHECK(this, values.size() == shape_size(m_shape) || values.size() == 1, "Did not get the expected number of literals for a constant of shape ", @@ -182,6 +183,7 @@ op::Constant::Constant(const element::Type& type, const Shape& shape, const std: } m_all_elements_bitwise_identical = are_all_data_elements_bitwise_identical(); } + NGRAPH_SUPPRESS_DEPRECATED_END } op::Constant::Constant(const element::Type& type, const Shape& shape) : m_element_type(type), m_shape(shape) { diff --git a/ngraph/core/src/op/transpose.cpp b/ngraph/core/src/op/transpose.cpp index 8d7d3cfa84a..e0c9bd37a74 100644 --- a/ngraph/core/src/op/transpose.cpp +++ b/ngraph/core/src/op/transpose.cpp @@ -42,6 +42,7 @@ void op::v1::Transpose::validate_and_infer_types() { set_input_is_relevant_to_shape(1); + NGRAPH_SUPPRESS_DEPRECATED_START if (const auto& input_const = get_constant_from_source(input_value(1))) { auto permutation = input_const->get_axis_vector_val(); if (permutation.empty()) { @@ -58,6 +59,7 @@ void op::v1::Transpose::validate_and_infer_types() { } else { set_output_type(0, get_input_element_type(0), PartialShape::dynamic(arg_shape.rank())); } + NGRAPH_SUPPRESS_DEPRECATED_END } shared_ptr op::v1::Transpose::clone_with_new_inputs(const OutputVector& new_args) const { diff --git a/ngraph/core/src/slice_plan.cpp b/ngraph/core/src/op/util/slice_plan.cpp similarity index 100% rename from ngraph/core/src/slice_plan.cpp rename to ngraph/core/src/op/util/slice_plan.cpp diff --git a/ngraph/core/src/pass/manager.cpp b/ngraph/core/src/pass/manager.cpp index 5aeb9180670..613ec73bff3 100644 --- a/ngraph/core/src/pass/manager.cpp +++ b/ngraph/core/src/pass/manager.cpp @@ -46,6 +46,7 @@ pass::Manager::~Manager() {} pass::Manager::Manager(std::shared_ptr pass_config) : m_pass_config(std::move(pass_config)) {} void pass::Manager::run_passes(shared_ptr func) { + NGRAPH_SUPPRESS_DEPRECATED_START OV_ITT_SCOPED_TASK(ov::itt::domains::nGraph, "pass::Manager::run_passes"); static bool profile_enabled = getenv_bool("NGRAPH_PROFILE_PASS_ENABLE"); @@ -67,7 +68,6 @@ void pass::Manager::run_passes(shared_ptr func) { pass_timer.start(); - NGRAPH_SUPPRESS_DEPRECATED_START if (auto matcher_pass = dynamic_pointer_cast(pass)) { // This checks is to skip the graph transformation when the graph pass relies on // static shape but the function state is dynamic. @@ -106,7 +106,6 @@ void pass::Manager::run_passes(shared_ptr func) { function_changed |= node_pass->run_on_node(n); } } - NGRAPH_SUPPRESS_DEPRECATED_END if (m_visualize) { // visualizations and serializations will be named after the outermost function @@ -131,4 +130,5 @@ void pass::Manager::run_passes(shared_ptr func) { if (profile_enabled) { cout << "passes done in " << overall_timer.get_milliseconds() << "ms\n"; } + NGRAPH_SUPPRESS_DEPRECATED_END } diff --git a/ngraph/core/src/runtime/aligned_buffer.cpp b/ngraph/core/src/runtime/aligned_buffer.cpp index b901bc99204..5bac0a083b6 100644 --- a/ngraph/core/src/runtime/aligned_buffer.cpp +++ b/ngraph/core/src/runtime/aligned_buffer.cpp @@ -15,6 +15,7 @@ using namespace std; runtime::AlignedBuffer::AlignedBuffer() : m_allocated_buffer(nullptr), m_aligned_buffer(nullptr), m_byte_size(0) {} runtime::AlignedBuffer::AlignedBuffer(size_t byte_size, size_t alignment) : m_byte_size(byte_size) { + NGRAPH_SUPPRESS_DEPRECATED_START m_byte_size = std::max(1, byte_size); size_t allocation_size = m_byte_size + alignment; m_allocated_buffer = static_cast(ngraph_malloc(allocation_size)); @@ -24,6 +25,7 @@ runtime::AlignedBuffer::AlignedBuffer(size_t byte_size, size_t alignment) : m_by if (mod != 0) { m_aligned_buffer += (alignment - mod); } + NGRAPH_SUPPRESS_DEPRECATED_END } runtime::AlignedBuffer::AlignedBuffer(AlignedBuffer&& other) diff --git a/ngraph/core/src/runtime/host_tensor.cpp b/ngraph/core/src/runtime/host_tensor.cpp index afa347f95ab..7c146736ea6 100644 --- a/ngraph/core/src/runtime/host_tensor.cpp +++ b/ngraph/core/src/runtime/host_tensor.cpp @@ -42,6 +42,7 @@ runtime::HostTensor::HostTensor(const Output& value) NGRAPH_SUPPRESS_DEPRECATED_END void runtime::HostTensor::allocate_buffer() { + NGRAPH_SUPPRESS_DEPRECATED_START NGRAPH_CHECK(get_partial_shape().is_static(), "Attempt to allocate buffer for tensor with partial shape: ", get_partial_shape()); @@ -63,6 +64,7 @@ void runtime::HostTensor::allocate_buffer() { m_aligned_buffer_pool = (allocated_buffer_pool + alignment - mod); } } + NGRAPH_SUPPRESS_DEPRECATED_END } NGRAPH_SUPPRESS_DEPRECATED_START @@ -78,9 +80,11 @@ void runtime::HostTensor::initialize(const std::shared_ptr& co } runtime::HostTensor::~HostTensor() { + NGRAPH_SUPPRESS_DEPRECATED_START if (m_allocated_buffer_pool != nullptr) { ngraph_free(m_allocated_buffer_pool); } + NGRAPH_SUPPRESS_DEPRECATED_END } void* runtime::HostTensor::get_data_ptr() { diff --git a/ngraph/core/src/type.cpp b/ngraph/core/src/type.cpp index 5cf8c29b61a..5456fb8d1e4 100644 --- a/ngraph/core/src/type.cpp +++ b/ngraph/core/src/type.cpp @@ -8,9 +8,11 @@ namespace std { size_t std::hash::operator()(const ngraph::DiscreteTypeInfo& k) const { + NGRAPH_SUPPRESS_DEPRECATED_START size_t name_hash = hash()(string(k.name)); size_t version_hash = hash()(k.version); // don't use parent for hash calculation, it is not a part of type (yet) return ngraph::hash_combine(vector{name_hash, version_hash}); + NGRAPH_SUPPRESS_DEPRECATED_END } } // namespace std diff --git a/ngraph/core/src/util.cpp b/ngraph/core/src/util.cpp index 3a448189a13..4dcf3abb220 100644 --- a/ngraph/core/src/util.cpp +++ b/ngraph/core/src/util.cpp @@ -22,6 +22,7 @@ #include "ngraph/partial_shape.hpp" #include "ngraph/shape.hpp" +NGRAPH_SUPPRESS_DEPRECATED_START using namespace std; using namespace ngraph; diff --git a/ngraph/core/src/validation_util.cpp b/ngraph/core/src/validation_util.cpp index 3db696721a6..ff69f511059 100644 --- a/ngraph/core/src/validation_util.cpp +++ b/ngraph/core/src/validation_util.cpp @@ -23,6 +23,7 @@ #include "ngraph/type/element_type_traits.hpp" #include "ngraph/util.hpp" +NGRAPH_SUPPRESS_DEPRECATED_START using namespace std; using namespace ngraph; diff --git a/ngraph/test/bfloat16.cpp b/ngraph/test/bfloat16.cpp index 31040bebf1e..1546d147d9b 100644 --- a/ngraph/test/bfloat16.cpp +++ b/ngraph/test/bfloat16.cpp @@ -139,6 +139,7 @@ TEST(bfloat16, numeric_limits) { } TEST(benchmark, bfloat16) { + NGRAPH_SUPPRESS_DEPRECATED_START size_t buffer_size = 128 * 3 * 224 * 224; ngraph::runtime::AlignedBuffer data(buffer_size * sizeof(float), 4096); float* f = static_cast(data.get_ptr()); @@ -197,6 +198,7 @@ TEST(benchmark, bfloat16) { timer.stop(); NGRAPH_INFO << "float to bfloat16 round to nearest even " << timer.get_milliseconds() << "ms"; } + NGRAPH_SUPPRESS_DEPRECATED_END } TEST(bfloat16, assigns) { diff --git a/ngraph/test/runtime/interpreter/int_executable.hpp b/ngraph/test/runtime/interpreter/int_executable.hpp index 8c901cd93c5..d7df9c6a0d2 100644 --- a/ngraph/test/runtime/interpreter/int_executable.hpp +++ b/ngraph/test/runtime/interpreter/int_executable.hpp @@ -7,11 +7,11 @@ #include #include #include +#include #include #include #include -#include #include "backend.hpp" #include "int_backend_visibility.hpp" #include "ngraph/ops.hpp" @@ -22,25 +22,20 @@ #include "ngraph/runtime/reference/tensor_iterator.hpp" #include "ngraph/runtime/tensor.hpp" -namespace ngraph -{ - namespace runtime - { - namespace interpreter - { - class INTBackend; - class INTExecutable; - } // namespace interpreter - } // namespace runtime -} // namespace ngraph +namespace ngraph { +namespace runtime { +namespace interpreter { +class INTBackend; +class INTExecutable; +} // namespace interpreter +} // namespace runtime +} // namespace ngraph -class INTERPRETER_BACKEND_API ngraph::runtime::interpreter::INTExecutable : public Executable -{ +class INTERPRETER_BACKEND_API ngraph::runtime::interpreter::INTExecutable : public Executable { friend class INTBackend; public: - INTExecutable(const std::shared_ptr& function, - bool enable_performance_collection = false); + INTExecutable(const std::shared_ptr& function, bool enable_performance_collection = false); bool call(const std::vector>& outputs, const std::vector>& inputs) override; @@ -53,11 +48,11 @@ public: std::shared_ptr create_output_tensor(size_t output_index) override; - std::vector> - create_input_tensor(size_t input_index, size_t pipeline_depth) override; + std::vector> create_input_tensor(size_t input_index, + size_t pipeline_depth) override; - std::vector> - create_output_tensor(size_t output_index, size_t pipeline_depth) override; + std::vector> create_output_tensor(size_t output_index, + size_t pipeline_depth) override; protected: std::shared_ptr get_parameter(size_t index) const; @@ -69,13 +64,13 @@ protected: bool m_nan_check_enabled = false; bool m_performance_counters_enabled = false; std::shared_ptr m_function; + NGRAPH_SUPPRESS_DEPRECATED_START std::unordered_map, stopwatch> m_timer_map; + NGRAPH_SUPPRESS_DEPRECATED_END std::vector> m_nodes; - static void perform_nan_check(const std::vector>&, - const Node* op = nullptr); - struct InfoForNMS5 - { + static void perform_nan_check(const std::vector>&, const Node* op = nullptr); + struct InfoForNMS5 { int64_t max_output_boxes_per_class; float iou_threshold; float score_threshold;