From 28aa5d98929a15ff997bfa27f46116c217408887 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 23 Jan 2025 12:04:18 +0100 Subject: [PATCH] Fixed more C++ RTTI on macOS --- .github/workflows/mac.yml | 38 +++++++++---------- .github/workflows/mac_arm64.yml | 38 +++++++++---------- .../frontend/tensorflow/graph_iterator.cpp | 2 +- .../frontend/tensorflow/graph_iterator.hpp | 2 +- .../python/src/pyopenvino/utils/utils.cpp | 6 +-- .../openvino/frontend/complex_type_mark.hpp | 5 ++- .../openvino/frontend/graph_iterator.hpp | 2 - .../common/src/complex_type_mark.cpp | 9 +++++ src/frontends/common/src/graph_iterator.cpp | 2 +- .../include/openvino/frontend/jax/decoder.hpp | 5 ++- .../frontend/jax/extension/conversion.hpp | 2 +- .../openvino/frontend/jax/frontend.hpp | 2 +- .../openvino/frontend/jax/visibility.hpp | 12 +++--- src/frontends/jax/src/decoder.cpp | 7 ++++ src/frontends/jax/src/jax.cpp | 4 +- .../frontend/paddle/extension/conversion.hpp | 2 +- .../openvino/frontend/paddle/frontend.hpp | 2 +- .../openvino/frontend/paddle/visibility.hpp | 12 +++--- src/frontends/paddle/src/frontend.cpp | 4 +- .../openvino/frontend/pytorch/decoder.hpp | 5 ++- .../frontend/pytorch/extension/conversion.hpp | 2 +- .../openvino/frontend/pytorch/frontend.hpp | 2 +- .../openvino/frontend/pytorch/visibility.hpp | 12 +++--- src/frontends/pytorch/src/decoder.cpp | 7 ++++ src/frontends/pytorch/src/frontend.cpp | 3 +- src/frontends/pytorch/src/pytorch.cpp | 4 +- .../transforms/aten_index_put_replacer.hpp | 3 +- .../src/transforms/aten_index_replacer.hpp | 3 +- .../tensorflow/extension/conversion.hpp | 2 +- .../openvino/frontend/tensorflow/frontend.hpp | 2 +- .../frontend/tensorflow/graph_iterator.hpp | 17 +++++++++ .../frontend/tensorflow/node_context.hpp | 2 +- .../frontend/tensorflow/special_types.hpp | 2 +- .../frontend/tensorflow/visibility.hpp | 12 +++--- src/frontends/tensorflow/src/tensorflow.cpp | 4 +- .../frontend/tensorflow_lite/decoder.hpp | 15 ++++++-- .../tensorflow_lite/extension/conversion.hpp | 2 +- .../frontend/tensorflow_lite/frontend.hpp | 2 +- .../tensorflow_lite/graph_iterator.hpp | 2 +- .../frontend/tensorflow_lite/node_context.hpp | 2 +- .../tensorflow_lite/quantization_info.hpp | 6 +-- .../tensorflow_lite/sparsity_info.hpp | 16 ++++---- .../frontend/tensorflow_lite/visibility.hpp | 12 +++--- src/frontends/tensorflow_lite/src/decoder.cpp | 13 +++++++ .../tensorflow_lite/src/tensorflow_lite.cpp | 4 +- 45 files changed, 188 insertions(+), 124 deletions(-) create mode 100644 src/frontends/common/src/complex_type_mark.cpp create mode 100644 src/frontends/jax/src/decoder.cpp create mode 100644 src/frontends/pytorch/src/decoder.cpp create mode 100644 src/frontends/tensorflow/include/openvino/frontend/tensorflow/graph_iterator.hpp create mode 100644 src/frontends/tensorflow_lite/src/decoder.cpp diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 0fbc20cf19594b..4babc27e6e9fba 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -4,25 +4,25 @@ on: schedule: # at 00:00 on workdays - cron: '0 0 * * 1,2,3,4,5' - #pull_request: - # paths-ignore: - # - '**/docs/**' - # - 'docs/**' - # - '**/**.md' - # - '**.md' - # - '**/layer_tests_summary/**' - # - '**/conformance/**' - #push: - # paths-ignore: - # - '**/docs/**' - # - 'docs/**' - # - '**/**.md' - # - '**.md' - # - '**/layer_tests_summary/**' - # - '**/conformance/**' - # branches: - # - master - # - 'releases/**' + pull_request: + paths-ignore: + - '**/docs/**' + - 'docs/**' + - '**/**.md' + - '**.md' + - '**/layer_tests_summary/**' + - '**/conformance/**' + push: + paths-ignore: + - '**/docs/**' + - 'docs/**' + - '**/**.md' + - '**.md' + - '**/layer_tests_summary/**' + - '**/conformance/**' + branches: + - master + - 'releases/**' concurrency: # github.ref is not unique in post-commit diff --git a/.github/workflows/mac_arm64.yml b/.github/workflows/mac_arm64.yml index b60daefa442c83..098f3da6c4e6c2 100644 --- a/.github/workflows/mac_arm64.yml +++ b/.github/workflows/mac_arm64.yml @@ -4,25 +4,25 @@ on: schedule: # at 00:00 on workdays - cron: '0 0 * * 1,2,3,4,5' - #pull_request: - # paths-ignore: - # - '**/docs/**' - # - 'docs/**' - # - '**/**.md' - # - '**.md' - # - '**/layer_tests_summary/**' - # - '**/conformance/**' - #push: - # paths-ignore: - # - '**/docs/**' - # - 'docs/**' - # - '**/**.md' - # - '**.md' - # - '**/layer_tests_summary/**' - # - '**/conformance/**' - # branches: - # - master - # - 'releases/**' + pull_request: + paths-ignore: + - '**/docs/**' + - 'docs/**' + - '**/**.md' + - '**.md' + - '**/layer_tests_summary/**' + - '**/conformance/**' + push: + paths-ignore: + - '**/docs/**' + - 'docs/**' + - '**/**.md' + - '**.md' + - '**/layer_tests_summary/**' + - '**/conformance/**' + branches: + - master + - 'releases/**' concurrency: # github.ref is not unique in post-commit diff --git a/src/bindings/python/src/pyopenvino/frontend/tensorflow/graph_iterator.cpp b/src/bindings/python/src/pyopenvino/frontend/tensorflow/graph_iterator.cpp index 1a5edab7de767a..8c97d0d49162c2 100644 --- a/src/bindings/python/src/pyopenvino/frontend/tensorflow/graph_iterator.cpp +++ b/src/bindings/python/src/pyopenvino/frontend/tensorflow/graph_iterator.cpp @@ -8,7 +8,7 @@ #include "graph_iterator.hpp" -#include "openvino/frontend/graph_iterator.hpp" +#include "openvino/frontend/tensorflow/graph_iterator.hpp" namespace py = pybind11; diff --git a/src/bindings/python/src/pyopenvino/frontend/tensorflow/graph_iterator.hpp b/src/bindings/python/src/pyopenvino/frontend/tensorflow/graph_iterator.hpp index b0e333657f91e2..46e6bdebedcd21 100644 --- a/src/bindings/python/src/pyopenvino/frontend/tensorflow/graph_iterator.hpp +++ b/src/bindings/python/src/pyopenvino/frontend/tensorflow/graph_iterator.hpp @@ -7,7 +7,7 @@ #include #include "openvino/frontend/decoder.hpp" -#include "openvino/frontend/graph_iterator.hpp" +#include "openvino/frontend/tensorflow/graph_iterator.hpp" namespace py = pybind11; diff --git a/src/bindings/python/src/pyopenvino/utils/utils.cpp b/src/bindings/python/src/pyopenvino/utils/utils.cpp index d223a400ea2a49..526be24b989b09 100644 --- a/src/bindings/python/src/pyopenvino/utils/utils.cpp +++ b/src/bindings/python/src/pyopenvino/utils/utils.cpp @@ -454,9 +454,9 @@ ov::Any py_object_to_any(const py::object& py_obj) { // FrontEnd Decoder } else if (py::isinstance(py_obj)) { return py::cast>(py_obj); - // TF FrontEnd GraphIterator - } else if (py::isinstance(py_obj)) { - return py::cast>(py_obj); + // FrontEnd GraphIterator + } else if (py::isinstance(py_obj)) { + return py::cast>(py_obj); // Custom FrontEnd Types } else if (py::isinstance(py_obj)) { return py::cast(py_obj); diff --git a/src/frontends/common/include/openvino/frontend/complex_type_mark.hpp b/src/frontends/common/include/openvino/frontend/complex_type_mark.hpp index e7a89f4f3e933a..b23004237622a2 100644 --- a/src/frontends/common/include/openvino/frontend/complex_type_mark.hpp +++ b/src/frontends/common/include/openvino/frontend/complex_type_mark.hpp @@ -5,6 +5,7 @@ #pragma once #include "openvino/core/type/element_type.hpp" +#include "openvino/frontend/visibility.hpp" #include "openvino/op/util/framework_node.hpp" namespace ov { @@ -17,7 +18,7 @@ namespace frontend { // into a floating-point tensor [N1, N2, ..., Nk, 2] // where a slice with index [..., 0] represents a real part and // a slice with index [..., 1] represents a imaginary part. -class ComplexTypeMark : public ov::op::util::FrameworkNode { +class FRONTEND_API ComplexTypeMark : public ov::op::util::FrameworkNode { public: OPENVINO_OP("ComplexTypeMark", "util", ov::op::util::FrameworkNode); @@ -27,6 +28,8 @@ class ComplexTypeMark : public ov::op::util::FrameworkNode { validate_and_infer_types(); } + ~ComplexTypeMark() override; + void validate_and_infer_types() override { set_output_type(0, ov::element::dynamic, PartialShape::dynamic()); } diff --git a/src/frontends/common/include/openvino/frontend/graph_iterator.hpp b/src/frontends/common/include/openvino/frontend/graph_iterator.hpp index 9b05849c78e8a1..d26895c6a05abb 100644 --- a/src/frontends/common/include/openvino/frontend/graph_iterator.hpp +++ b/src/frontends/common/include/openvino/frontend/graph_iterator.hpp @@ -10,7 +10,6 @@ namespace ov { namespace frontend { -namespace tensorflow { /// Abstract representation for an input model graph that gives nodes in topologically sorted order class FRONTEND_API GraphIterator : ::ov::RuntimeAttribute { @@ -51,6 +50,5 @@ class FRONTEND_API GraphIterator : ::ov::RuntimeAttribute { virtual std::map get_output_names_map() const; }; -} // namespace tensorflow } // namespace frontend } // namespace ov diff --git a/src/frontends/common/src/complex_type_mark.cpp b/src/frontends/common/src/complex_type_mark.cpp new file mode 100644 index 00000000000000..25ccb1fe4a2095 --- /dev/null +++ b/src/frontends/common/src/complex_type_mark.cpp @@ -0,0 +1,9 @@ +// Copyright (C) 2018-2025 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "openvino/frontend/complex_type_mark.hpp" + +using namespace ov::frontend; + +ComplexTypeMark::~ComplexTypeMark() = default; diff --git a/src/frontends/common/src/graph_iterator.cpp b/src/frontends/common/src/graph_iterator.cpp index 1a97e35448cf06..c1293a7812a8a0 100644 --- a/src/frontends/common/src/graph_iterator.cpp +++ b/src/frontends/common/src/graph_iterator.cpp @@ -4,7 +4,7 @@ #include "openvino/frontend/graph_iterator.hpp" -using namespace ov::frontend::tensorflow; +using namespace ov::frontend; std::map GraphIterator::get_input_names_map() const { return {}; diff --git a/src/frontends/jax/include/openvino/frontend/jax/decoder.hpp b/src/frontends/jax/include/openvino/frontend/jax/decoder.hpp index 2cddb8b936d860..252feedb9f6115 100644 --- a/src/frontends/jax/include/openvino/frontend/jax/decoder.hpp +++ b/src/frontends/jax/include/openvino/frontend/jax/decoder.hpp @@ -11,12 +11,13 @@ #include "openvino/core/node.hpp" #include "openvino/core/node_vector.hpp" #include "openvino/frontend/decoder.hpp" +#include "openvino/frontend/jax/visibility.hpp" namespace ov { namespace frontend { namespace jax { -class JaxDecoder : public IDecoder { +class JAX_FRONTEND_API JaxDecoder : public IDecoder { public: virtual OutputVector as_constant() const = 0; @@ -64,6 +65,8 @@ class JaxDecoder : public IDecoder { /// If there is no query for specific sub-graph it shouldn't be converted // node_visitor is a function that will be fed by nodes in subgraph for all nodes in graph virtual void visit_subgraph(std::function)> node_visitor) const = 0; + + ~JaxDecoder() override; }; } // namespace jax diff --git a/src/frontends/jax/include/openvino/frontend/jax/extension/conversion.hpp b/src/frontends/jax/include/openvino/frontend/jax/extension/conversion.hpp index 490177dde53e5d..2fb18cd4907fe1 100644 --- a/src/frontends/jax/include/openvino/frontend/jax/extension/conversion.hpp +++ b/src/frontends/jax/include/openvino/frontend/jax/extension/conversion.hpp @@ -13,7 +13,7 @@ namespace ov { namespace frontend { namespace jax { -class JAX_API ConversionExtension : public ConversionExtensionBase { +class JAX_FRONTEND_API ConversionExtension : public ConversionExtensionBase { public: using Ptr = std::shared_ptr; diff --git a/src/frontends/jax/include/openvino/frontend/jax/frontend.hpp b/src/frontends/jax/include/openvino/frontend/jax/frontend.hpp index e40d6b772b95fa..94a6a859f76c04 100644 --- a/src/frontends/jax/include/openvino/frontend/jax/frontend.hpp +++ b/src/frontends/jax/include/openvino/frontend/jax/frontend.hpp @@ -14,7 +14,7 @@ namespace ov { namespace frontend { namespace jax { -class JAX_API FrontEnd : public ov::frontend::FrontEnd { +class JAX_FRONTEND_API FrontEnd : public ov::frontend::FrontEnd { public: using Ptr = std::shared_ptr; FrontEnd(); diff --git a/src/frontends/jax/include/openvino/frontend/jax/visibility.hpp b/src/frontends/jax/include/openvino/frontend/jax/visibility.hpp index 609248d4fc964e..f5c62f99c6a7c7 100644 --- a/src/frontends/jax/include/openvino/frontend/jax/visibility.hpp +++ b/src/frontends/jax/include/openvino/frontend/jax/visibility.hpp @@ -7,14 +7,14 @@ #include "openvino/frontend/visibility.hpp" #ifdef OPENVINO_STATIC_LIBRARY -# define JAX_API -# define JAX_C_API +# define JAX_FRONTEND_API +# define JAX_FRONTEND_C_API #else # ifdef openvino_jax_frontend_EXPORTS -# define JAX_API OPENVINO_CORE_EXPORTS -# define JAX_C_API OPENVINO_EXTERN_C OPENVINO_CORE_EXPORTS +# define JAX_FRONTEND_API OPENVINO_CORE_EXPORTS +# define JAX_FRONTEND_C_API OPENVINO_EXTERN_C OPENVINO_CORE_EXPORTS # else -# define JAX_API OPENVINO_CORE_IMPORTS -# define JAX_C_API OPENVINO_EXTERN_C OPENVINO_CORE_IMPORTS +# define JAX_FRONTEND_API OPENVINO_CORE_IMPORTS +# define JAX_FRONTEND_C_API OPENVINO_EXTERN_C OPENVINO_CORE_IMPORTS # endif // openvino_jax_frontend_EXPORTS #endif // OPENVINO_STATIC_LIBRARY diff --git a/src/frontends/jax/src/decoder.cpp b/src/frontends/jax/src/decoder.cpp new file mode 100644 index 00000000000000..d3eda7de215c37 --- /dev/null +++ b/src/frontends/jax/src/decoder.cpp @@ -0,0 +1,7 @@ +// Copyright (C) 2018-2025 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "openvino/frontend/jax/decoder.hpp" + +ov::frontend::jax::JaxDecoder::~JaxDecoder() = default; diff --git a/src/frontends/jax/src/jax.cpp b/src/frontends/jax/src/jax.cpp index 62fdbb1f01797e..4fbb08a4099b01 100644 --- a/src/frontends/jax/src/jax.cpp +++ b/src/frontends/jax/src/jax.cpp @@ -6,11 +6,11 @@ #include "openvino/frontend/jax/visibility.hpp" #include "openvino/frontend/manager.hpp" -JAX_C_API ov::frontend::FrontEndVersion get_api_version() { +JAX_FRONTEND_C_API ov::frontend::FrontEndVersion get_api_version() { return OV_FRONTEND_API_VERSION; } -JAX_C_API void* get_front_end_data() { +JAX_FRONTEND_C_API void* get_front_end_data() { auto res = new ov::frontend::FrontEndPluginInfo(); res->m_name = "jax"; res->m_creator = []() { diff --git a/src/frontends/paddle/include/openvino/frontend/paddle/extension/conversion.hpp b/src/frontends/paddle/include/openvino/frontend/paddle/extension/conversion.hpp index f27ddd55169b6c..d1b32052eb08bb 100644 --- a/src/frontends/paddle/include/openvino/frontend/paddle/extension/conversion.hpp +++ b/src/frontends/paddle/include/openvino/frontend/paddle/extension/conversion.hpp @@ -13,7 +13,7 @@ namespace ov { namespace frontend { namespace paddle { -class PADDLE_API ConversionExtension : public ConversionExtensionBase { +class PADDLE_FRONTEND_API ConversionExtension : public ConversionExtensionBase { public: using Ptr = std::shared_ptr; diff --git a/src/frontends/paddle/include/openvino/frontend/paddle/frontend.hpp b/src/frontends/paddle/include/openvino/frontend/paddle/frontend.hpp index 54bf8961c48c8b..77b59aa4ca695d 100644 --- a/src/frontends/paddle/include/openvino/frontend/paddle/frontend.hpp +++ b/src/frontends/paddle/include/openvino/frontend/paddle/frontend.hpp @@ -21,7 +21,7 @@ namespace paddle { class OpPlace; class TensorPlace; -class PADDLE_API FrontEnd : public ov::frontend::FrontEnd { +class PADDLE_FRONTEND_API FrontEnd : public ov::frontend::FrontEnd { public: using Ptr = std::shared_ptr; FrontEnd(); diff --git a/src/frontends/paddle/include/openvino/frontend/paddle/visibility.hpp b/src/frontends/paddle/include/openvino/frontend/paddle/visibility.hpp index d2430e9489a282..e9ea45c727cea4 100644 --- a/src/frontends/paddle/include/openvino/frontend/paddle/visibility.hpp +++ b/src/frontends/paddle/include/openvino/frontend/paddle/visibility.hpp @@ -7,14 +7,14 @@ #include "openvino/frontend/exception.hpp" #ifdef OPENVINO_STATIC_LIBRARY -# define PADDLE_API -# define PADDLE_C_API +# define PADDLE_FRONTEND_API +# define PADDLE_FRONTEND_C_API #else # ifdef openvino_paddle_frontend_EXPORTS -# define PADDLE_API OPENVINO_CORE_EXPORTS -# define PADDLE_C_API OPENVINO_EXTERN_C OPENVINO_CORE_EXPORTS +# define PADDLE_FRONTEND_API OPENVINO_CORE_EXPORTS +# define PADDLE_FRONTEND_C_API OPENVINO_EXTERN_C OPENVINO_CORE_EXPORTS # else -# define PADDLE_API OPENVINO_CORE_IMPORTS -# define PADDLE_C_API OPENVINO_EXTERN_C OPENVINO_CORE_IMPORTS +# define PADDLE_FRONTEND_API OPENVINO_CORE_IMPORTS +# define PADDLE_FRONTEND_C_API OPENVINO_EXTERN_C OPENVINO_CORE_IMPORTS # endif // openvino_paddle_frontend_EXPORTS #endif // OPENVINO_STATIC_LIBRARY diff --git a/src/frontends/paddle/src/frontend.cpp b/src/frontends/paddle/src/frontend.cpp index 22d5547489e723..c20852ebff655d 100644 --- a/src/frontends/paddle/src/frontend.cpp +++ b/src/frontends/paddle/src/frontend.cpp @@ -586,11 +586,11 @@ void FrontEnd::normalize(const std::shared_ptr& model) const { } // namespace frontend } // namespace ov -PADDLE_C_API FrontEndVersion get_api_version() { +PADDLE_FRONTEND_C_API FrontEndVersion get_api_version() { return OV_FRONTEND_API_VERSION; } -PADDLE_C_API void* get_front_end_data() { +PADDLE_FRONTEND_C_API void* get_front_end_data() { FrontEndPluginInfo* res = new FrontEndPluginInfo(); res->m_name = "paddle"; res->m_creator = []() { diff --git a/src/frontends/pytorch/include/openvino/frontend/pytorch/decoder.hpp b/src/frontends/pytorch/include/openvino/frontend/pytorch/decoder.hpp index 3da741be645cc5..97546c03534c0a 100644 --- a/src/frontends/pytorch/include/openvino/frontend/pytorch/decoder.hpp +++ b/src/frontends/pytorch/include/openvino/frontend/pytorch/decoder.hpp @@ -6,6 +6,7 @@ #include "openvino/core/node.hpp" #include "openvino/frontend/decoder.hpp" +#include "openvino/frontend/pytorch/visibility.hpp" namespace ov { namespace frontend { @@ -14,8 +15,10 @@ namespace pytorch { using DecoderRTInfo = std::unordered_map; /// Plays a role of node, block and module decoder (kind of temporary fat API) -class TorchDecoder : public IDecoder { +class PYTORCH_FRONTEND_API TorchDecoder : public IDecoder { public: + ~TorchDecoder() override; + // Do not search for input in tensor map; try to access it as a constant of specified type T and return its value // Using Any here is an easy way to avoid template definition, returned object is supposed to be of one of the // fundamental types like int, float etc. diff --git a/src/frontends/pytorch/include/openvino/frontend/pytorch/extension/conversion.hpp b/src/frontends/pytorch/include/openvino/frontend/pytorch/extension/conversion.hpp index 6c321ccd22df05..cf1f8632045a46 100644 --- a/src/frontends/pytorch/include/openvino/frontend/pytorch/extension/conversion.hpp +++ b/src/frontends/pytorch/include/openvino/frontend/pytorch/extension/conversion.hpp @@ -13,7 +13,7 @@ namespace ov { namespace frontend { namespace pytorch { -class PYTORCH_API ConversionExtension : public ConversionExtensionBase { +class PYTORCH_FRONTEND_API ConversionExtension : public ConversionExtensionBase { public: using Ptr = std::shared_ptr; diff --git a/src/frontends/pytorch/include/openvino/frontend/pytorch/frontend.hpp b/src/frontends/pytorch/include/openvino/frontend/pytorch/frontend.hpp index 76baa62a334dcb..6575aeb4fd983e 100644 --- a/src/frontends/pytorch/include/openvino/frontend/pytorch/frontend.hpp +++ b/src/frontends/pytorch/include/openvino/frontend/pytorch/frontend.hpp @@ -14,7 +14,7 @@ namespace ov { namespace frontend { namespace pytorch { -class PYTORCH_API FrontEnd : public ov::frontend::FrontEnd { +class PYTORCH_FRONTEND_API FrontEnd : public ov::frontend::FrontEnd { public: using Ptr = std::shared_ptr; FrontEnd(); diff --git a/src/frontends/pytorch/include/openvino/frontend/pytorch/visibility.hpp b/src/frontends/pytorch/include/openvino/frontend/pytorch/visibility.hpp index 3911ad8693bcf0..da35017bb868fa 100644 --- a/src/frontends/pytorch/include/openvino/frontend/pytorch/visibility.hpp +++ b/src/frontends/pytorch/include/openvino/frontend/pytorch/visibility.hpp @@ -7,14 +7,14 @@ #include "openvino/frontend/visibility.hpp" #ifdef OPENVINO_STATIC_LIBRARY -# define PYTORCH_API -# define PYTORCH_C_API +# define PYTORCH_FRONTEND_API +# define PYTORCH_FRONTEND_C_API #else # ifdef openvino_pytorch_frontend_EXPORTS -# define PYTORCH_API OPENVINO_CORE_EXPORTS -# define PYTORCH_C_API OPENVINO_EXTERN_C OPENVINO_CORE_EXPORTS +# define PYTORCH_FRONTEND_API OPENVINO_CORE_EXPORTS +# define PYTORCH_FRONTEND_C_API OPENVINO_EXTERN_C OPENVINO_CORE_EXPORTS # else -# define PYTORCH_API OPENVINO_CORE_IMPORTS -# define PYTORCH_C_API OPENVINO_EXTERN_C OPENVINO_CORE_IMPORTS +# define PYTORCH_FRONTEND_API OPENVINO_CORE_IMPORTS +# define PYTORCH_FRONTEND_C_API OPENVINO_EXTERN_C OPENVINO_CORE_IMPORTS # endif // openvino_pytorch_frontend_EXPORTS #endif // OPENVINO_STATIC_LIBRARY diff --git a/src/frontends/pytorch/src/decoder.cpp b/src/frontends/pytorch/src/decoder.cpp new file mode 100644 index 00000000000000..b07e4cbbd8c3f5 --- /dev/null +++ b/src/frontends/pytorch/src/decoder.cpp @@ -0,0 +1,7 @@ +// Copyright (C) 2018-2025 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "openvino/frontend/pytorch/decoder.hpp" + +ov::frontend::pytorch::TorchDecoder::~TorchDecoder() = default; diff --git a/src/frontends/pytorch/src/frontend.cpp b/src/frontends/pytorch/src/frontend.cpp index 8fb4dea7edf8f8..49e407d2a5010b 100644 --- a/src/frontends/pytorch/src/frontend.cpp +++ b/src/frontends/pytorch/src/frontend.cpp @@ -402,8 +402,9 @@ ov::frontend::InputModel::Ptr FrontEnd::load_impl(const std::vector& va "PyTorch Frontend doesn't support provided model type. Please provide supported model " "object using Python API."); auto decoder = variants[0].as>(); + FRONT_END_GENERAL_CHECK(decoder, "Couldn't cast ov::Any to std::shared_ptr"); auto tdecoder = std::dynamic_pointer_cast(decoder); - FRONT_END_GENERAL_CHECK(tdecoder, "Couldn't cast ov::Any to TorchDecoder"); + FRONT_END_GENERAL_CHECK(tdecoder, "Couldn't cast IDecoder to TorchDecoder"); return std::make_shared(tdecoder); } diff --git a/src/frontends/pytorch/src/pytorch.cpp b/src/frontends/pytorch/src/pytorch.cpp index 967fb43aa5840e..82dda9f5a84a4a 100644 --- a/src/frontends/pytorch/src/pytorch.cpp +++ b/src/frontends/pytorch/src/pytorch.cpp @@ -6,11 +6,11 @@ #include "openvino/frontend/pytorch/frontend.hpp" #include "openvino/frontend/pytorch/visibility.hpp" -PYTORCH_C_API ov::frontend::FrontEndVersion get_api_version() { +PYTORCH_FRONTEND_C_API ov::frontend::FrontEndVersion get_api_version() { return OV_FRONTEND_API_VERSION; } -PYTORCH_C_API void* get_front_end_data() { +PYTORCH_FRONTEND_C_API void* get_front_end_data() { auto res = new ov::frontend::FrontEndPluginInfo(); res->m_name = "pytorch"; res->m_creator = []() { diff --git a/src/frontends/pytorch/src/transforms/aten_index_put_replacer.hpp b/src/frontends/pytorch/src/transforms/aten_index_put_replacer.hpp index ee887004fa30f4..6a795b2d1d4f48 100644 --- a/src/frontends/pytorch/src/transforms/aten_index_put_replacer.hpp +++ b/src/frontends/pytorch/src/transforms/aten_index_put_replacer.hpp @@ -4,7 +4,6 @@ #pragma once -#include "openvino/frontend/pytorch/visibility.hpp" #include "openvino/pass/graph_rewrite.hpp" #include "openvino/pass/pass.hpp" @@ -13,7 +12,7 @@ namespace frontend { namespace pytorch { namespace pass { -class PYTORCH_API AtenIndexPutReplacer : public ov::pass::MatcherPass { +class AtenIndexPutReplacer : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("ov::frontend::pytorch::pass::AtenIndexPutReplacer"); AtenIndexPutReplacer(); diff --git a/src/frontends/pytorch/src/transforms/aten_index_replacer.hpp b/src/frontends/pytorch/src/transforms/aten_index_replacer.hpp index 2aa81063f4e05f..5d1eb662dc687b 100644 --- a/src/frontends/pytorch/src/transforms/aten_index_replacer.hpp +++ b/src/frontends/pytorch/src/transforms/aten_index_replacer.hpp @@ -4,7 +4,6 @@ #pragma once -#include "openvino/frontend/pytorch/visibility.hpp" #include "openvino/pass/graph_rewrite.hpp" #include "openvino/pass/pass.hpp" @@ -14,7 +13,7 @@ namespace pytorch { namespace pass { // This transformation replaces pattern prim::ListConstruct->aten::index -class PYTORCH_API AtenIndexToSelect : public ov::pass::MatcherPass { +class AtenIndexToSelect : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("ov::frontend::pytorch::pass::AtenIndexToSelect"); AtenIndexToSelect(); diff --git a/src/frontends/tensorflow/include/openvino/frontend/tensorflow/extension/conversion.hpp b/src/frontends/tensorflow/include/openvino/frontend/tensorflow/extension/conversion.hpp index 0b6b2aa5414fc4..cec9d2b872c345 100644 --- a/src/frontends/tensorflow/include/openvino/frontend/tensorflow/extension/conversion.hpp +++ b/src/frontends/tensorflow/include/openvino/frontend/tensorflow/extension/conversion.hpp @@ -13,7 +13,7 @@ namespace ov { namespace frontend { namespace tensorflow { -class TENSORFLOW_API ConversionExtension : public ConversionExtensionBase { +class TENSORFLOW_FRONTEND_API ConversionExtension : public ConversionExtensionBase { public: using Ptr = std::shared_ptr; diff --git a/src/frontends/tensorflow/include/openvino/frontend/tensorflow/frontend.hpp b/src/frontends/tensorflow/include/openvino/frontend/tensorflow/frontend.hpp index 8ba6326b493236..d0bd54b07f8cc8 100644 --- a/src/frontends/tensorflow/include/openvino/frontend/tensorflow/frontend.hpp +++ b/src/frontends/tensorflow/include/openvino/frontend/tensorflow/frontend.hpp @@ -21,7 +21,7 @@ namespace ov { namespace frontend { namespace tensorflow { -class TENSORFLOW_API FrontEnd : public ov::frontend::FrontEnd { +class TENSORFLOW_FRONTEND_API FrontEnd : public ov::frontend::FrontEnd { public: using Ptr = std::shared_ptr; FrontEnd(); diff --git a/src/frontends/tensorflow/include/openvino/frontend/tensorflow/graph_iterator.hpp b/src/frontends/tensorflow/include/openvino/frontend/tensorflow/graph_iterator.hpp new file mode 100644 index 00000000000000..079b423dab3f28 --- /dev/null +++ b/src/frontends/tensorflow/include/openvino/frontend/tensorflow/graph_iterator.hpp @@ -0,0 +1,17 @@ +// Copyright (C) 2018-2025 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/frontend/graph_iterator.hpp" + +namespace ov { +namespace frontend { +namespace tensorflow { + +using ov::frontend::GraphIterator; + +} // namespace tensorflow +} // namespace frontend +} // namespace ov diff --git a/src/frontends/tensorflow/include/openvino/frontend/tensorflow/node_context.hpp b/src/frontends/tensorflow/include/openvino/frontend/tensorflow/node_context.hpp index 84ab6dac099916..1f475aee50831f 100644 --- a/src/frontends/tensorflow/include/openvino/frontend/tensorflow/node_context.hpp +++ b/src/frontends/tensorflow/include/openvino/frontend/tensorflow/node_context.hpp @@ -19,7 +19,7 @@ class TranslateSession; /// Keep necessary data for a single node in the original FW graph to facilitate /// conversion process in the rules code. -class TENSORFLOW_API NodeContext : public ov::frontend::NodeContext { +class TENSORFLOW_FRONTEND_API NodeContext : public ov::frontend::NodeContext { public: using Ptr = std::shared_ptr; NodeContext(const std::shared_ptr& decoder, diff --git a/src/frontends/tensorflow/include/openvino/frontend/tensorflow/special_types.hpp b/src/frontends/tensorflow/include/openvino/frontend/tensorflow/special_types.hpp index c72ad868f2dfad..4a5f9384ed7604 100644 --- a/src/frontends/tensorflow/include/openvino/frontend/tensorflow/special_types.hpp +++ b/src/frontends/tensorflow/include/openvino/frontend/tensorflow/special_types.hpp @@ -11,7 +11,7 @@ namespace frontend { namespace tensorflow { // Type which is used to express empty list without any specific type -class TENSORFLOW_API EmptyList {}; +class TENSORFLOW_FRONTEND_API EmptyList {}; } // namespace tensorflow } // namespace frontend diff --git a/src/frontends/tensorflow/include/openvino/frontend/tensorflow/visibility.hpp b/src/frontends/tensorflow/include/openvino/frontend/tensorflow/visibility.hpp index 72359026d76d08..9901169bf3ec74 100644 --- a/src/frontends/tensorflow/include/openvino/frontend/tensorflow/visibility.hpp +++ b/src/frontends/tensorflow/include/openvino/frontend/tensorflow/visibility.hpp @@ -7,14 +7,14 @@ #include "openvino/frontend/exception.hpp" #ifdef OPENVINO_STATIC_LIBRARY -# define TENSORFLOW_API -# define TENSORFLOW_C_API +# define TENSORFLOW_FRONTEND_API +# define TENSORFLOW_FRONTEND_C_API #else # ifdef openvino_tensorflow_frontend_EXPORTS -# define TENSORFLOW_API OPENVINO_CORE_EXPORTS -# define TENSORFLOW_C_API OPENVINO_EXTERN_C OPENVINO_CORE_EXPORTS +# define TENSORFLOW_FRONTEND_API OPENVINO_CORE_EXPORTS +# define TENSORFLOW_FRONTEND_C_API OPENVINO_EXTERN_C OPENVINO_CORE_EXPORTS # else -# define TENSORFLOW_API OPENVINO_CORE_IMPORTS -# define TENSORFLOW_C_API OPENVINO_EXTERN_C OPENVINO_CORE_IMPORTS +# define TENSORFLOW_FRONTEND_API OPENVINO_CORE_IMPORTS +# define TENSORFLOW_FRONTEND_C_API OPENVINO_EXTERN_C OPENVINO_CORE_IMPORTS # endif // openvino_tensorflow_frontend_EXPORTS #endif // OPENVINO_STATIC_LIBRARY diff --git a/src/frontends/tensorflow/src/tensorflow.cpp b/src/frontends/tensorflow/src/tensorflow.cpp index 9a3ab3b242828e..7c9e2f727b6aa7 100644 --- a/src/frontends/tensorflow/src/tensorflow.cpp +++ b/src/frontends/tensorflow/src/tensorflow.cpp @@ -6,11 +6,11 @@ #include "openvino/frontend/tensorflow/frontend.hpp" #include "openvino/frontend/tensorflow/visibility.hpp" -TENSORFLOW_C_API ov::frontend::FrontEndVersion get_api_version() { +TENSORFLOW_FRONTEND_C_API ov::frontend::FrontEndVersion get_api_version() { return OV_FRONTEND_API_VERSION; } -TENSORFLOW_C_API void* get_front_end_data() { +TENSORFLOW_FRONTEND_C_API void* get_front_end_data() { auto res = new ov::frontend::FrontEndPluginInfo(); res->m_name = "tf"; res->m_creator = []() { diff --git a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/decoder.hpp b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/decoder.hpp index 49d6f7d576ecf8..424cec1f4d773b 100644 --- a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/decoder.hpp +++ b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/decoder.hpp @@ -14,7 +14,7 @@ namespace ov { namespace frontend { namespace tensorflow_lite { -struct TENSORFLOW_LITE_API TensorMetaInfo { +struct TENSORFLOW_LITE_FRONTEND_API TensorMetaInfo { std::shared_ptr m_quantization_info; std::shared_ptr m_sparsity_info; ov::PartialShape m_partial_shape; @@ -23,11 +23,14 @@ struct TENSORFLOW_LITE_API TensorMetaInfo { std::string m_tensor_name; }; -class TENSORFLOW_LITE_API DecoderBase : public ov::frontend::DecoderBase {}; +class TENSORFLOW_LITE_FRONTEND_API DecoderBase : public ov::frontend::DecoderBase { +public: + ~DecoderBase() override; +}; // DecoderBaseOperation corresponds to operation node to retrieve its attributes and information about input and output // tensors -class TENSORFLOW_LITE_API DecoderBaseOperation : public ov::frontend::tensorflow_lite::DecoderBase { +class TENSORFLOW_LITE_FRONTEND_API DecoderBaseOperation : public ov::frontend::tensorflow_lite::DecoderBase { public: /// \brief Get input tensor name by index /// Operation nodes are connected between each other by tensors. @@ -67,11 +70,13 @@ class TENSORFLOW_LITE_API DecoderBaseOperation : public ov::frontend::tensorflow /// \brief Get a number of outputs virtual size_t get_output_size() const = 0; + + ~DecoderBaseOperation() override; }; // DecoderBaseTensor corresponds to tensor node to retrieve information about type, shapem quantization and sparsity // information -class TENSORFLOW_LITE_API DecoderBaseTensor : public ov::frontend::tensorflow_lite::DecoderBase { +class TENSORFLOW_LITE_FRONTEND_API DecoderBaseTensor : public ov::frontend::tensorflow_lite::DecoderBase { public: /// \brief Get tensor info virtual TensorMetaInfo get_tensor_info() const = 0; @@ -87,6 +92,8 @@ class TENSORFLOW_LITE_API DecoderBaseTensor : public ov::frontend::tensorflow_li /// it must be from 0 to m-1, where m - number of outputs in the model /// if it is not input, returns -1 virtual int64_t get_output_idx() const = 0; + + ~DecoderBaseTensor() override; }; } // namespace tensorflow_lite diff --git a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/extension/conversion.hpp b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/extension/conversion.hpp index 4121f10d98968d..1f87626918277c 100644 --- a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/extension/conversion.hpp +++ b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/extension/conversion.hpp @@ -12,7 +12,7 @@ namespace ov { namespace frontend { namespace tensorflow_lite { -class TENSORFLOW_LITE_API ConversionExtension : public ConversionExtensionBase { +class TENSORFLOW_LITE_FRONTEND_API ConversionExtension : public ConversionExtensionBase { public: using Ptr = std::shared_ptr; diff --git a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/frontend.hpp b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/frontend.hpp index 4487509cd3864b..e2ec2943296a57 100644 --- a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/frontend.hpp +++ b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/frontend.hpp @@ -22,7 +22,7 @@ namespace tensorflow_lite { using CreatorFunction = std::function; using TranslatorDictionaryType = std::map; -class TENSORFLOW_LITE_API FrontEnd : public ov::frontend::FrontEnd { +class TENSORFLOW_LITE_FRONTEND_API FrontEnd : public ov::frontend::FrontEnd { public: FrontEnd(); /// \brief Completely convert the model diff --git a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/graph_iterator.hpp b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/graph_iterator.hpp index 35eb43af74c2d9..0b76336d822fe8 100644 --- a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/graph_iterator.hpp +++ b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/graph_iterator.hpp @@ -24,7 +24,7 @@ namespace tensorflow_lite { /// DecoderBaseOperation (for op 1), ..., DecoderBaseOperation (for op k), /// where n - number of inputs in the model, m - number of outputs in the model k - number of operation nodes. /// NOTE: constants are ignored and no decoder object is returned for constant. -class TENSORFLOW_LITE_API GraphIterator : ::ov::RuntimeAttribute { +class TENSORFLOW_LITE_FRONTEND_API GraphIterator : ::ov::RuntimeAttribute { public: using Ptr = std::shared_ptr; diff --git a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/node_context.hpp b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/node_context.hpp index faa496353c662c..77b1b1b02c0639 100644 --- a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/node_context.hpp +++ b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/node_context.hpp @@ -16,7 +16,7 @@ using SubGraphFuncs = std::vector()>>; /// Keep necessary data for a single node in the original FW graph to facilitate /// conversion process in the rules code. -class TENSORFLOW_LITE_API NodeContext : public ov::frontend::NodeContext { +class TENSORFLOW_LITE_FRONTEND_API NodeContext : public ov::frontend::NodeContext { public: using Ptr = std::shared_ptr; NodeContext(const std::shared_ptr& decoder, const OutputVector& inputs) diff --git a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/quantization_info.hpp b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/quantization_info.hpp index d9232b8d580a53..835aa242c3673d 100644 --- a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/quantization_info.hpp +++ b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/quantization_info.hpp @@ -15,13 +15,11 @@ namespace ov { namespace frontend { namespace tensorflow_lite { -class TENSORFLOW_LITE_API QuantizationInfo : public ov::RuntimeAttribute { +class TENSORFLOW_LITE_FRONTEND_API QuantizationInfo : public ov::RuntimeAttribute { public: OPENVINO_RTTI("QuantizationInfo", "0", RuntimeAttribute); QuantizationInfo() = default; - explicit QuantizationInfo(const std::vector& scale, - const std::vector& zero_point, - const int64_t& axis) + QuantizationInfo(const std::vector& scale, const std::vector& zero_point, const int64_t& axis) : m_scale(scale), m_zero_point(zero_point), m_axis(axis) {} diff --git a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/sparsity_info.hpp b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/sparsity_info.hpp index 440d6a81059c9d..bfcd1d9fc08f41 100644 --- a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/sparsity_info.hpp +++ b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/sparsity_info.hpp @@ -16,7 +16,7 @@ namespace ov { namespace frontend { namespace tensorflow_lite { -class TENSORFLOW_LITE_API SparsityInfo : public ov::RuntimeAttribute { +class TENSORFLOW_LITE_FRONTEND_API SparsityInfo : public ov::RuntimeAttribute { public: OPENVINO_RTTI("SparsityInfo", "0", RuntimeAttribute); @@ -28,13 +28,13 @@ class TENSORFLOW_LITE_API SparsityInfo : public ov::RuntimeAttribute { }; SparsityInfo() = default; - explicit SparsityInfo(const std::vector& shape, - const std::vector& traversal_order, - const std::vector& block_map, - const std::vector& dim_format, - const std::vector& data_desc, - const ov::element::Type target_type, - const uint8_t* values) + SparsityInfo(const std::vector& shape, + const std::vector& traversal_order, + const std::vector& block_map, + const std::vector& dim_format, + const std::vector& data_desc, + const ov::element::Type target_type, + const uint8_t* values) : m_shape(shape), m_traversal_order(traversal_order), m_block_map(block_map), diff --git a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/visibility.hpp b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/visibility.hpp index 381936419fb3aa..116c593ebfe9c9 100644 --- a/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/visibility.hpp +++ b/src/frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/visibility.hpp @@ -7,14 +7,14 @@ #include "openvino/frontend/exception.hpp" #ifdef OPENVINO_STATIC_LIBRARY -# define TENSORFLOW_LITE_API -# define TENSORFLOW_LITE_C_API +# define TENSORFLOW_LITE_FRONTEND_API +# define TENSORFLOW_LITE_FRONTEND_C_API #else # ifdef openvino_tensorflow_lite_frontend_EXPORTS -# define TENSORFLOW_LITE_API OPENVINO_CORE_EXPORTS -# define TENSORFLOW_LITE_C_API OPENVINO_EXTERN_C OPENVINO_CORE_EXPORTS +# define TENSORFLOW_LITE_FRONTEND_API OPENVINO_CORE_EXPORTS +# define TENSORFLOW_LITE_FRONTEND_C_API OPENVINO_EXTERN_C OPENVINO_CORE_EXPORTS # else -# define TENSORFLOW_LITE_API OPENVINO_CORE_IMPORTS -# define TENSORFLOW_LITE_C_API OPENVINO_EXTERN_C OPENVINO_CORE_IMPORTS +# define TENSORFLOW_LITE_FRONTEND_API OPENVINO_CORE_IMPORTS +# define TENSORFLOW_LITE_FRONTEND_C_API OPENVINO_EXTERN_C OPENVINO_CORE_IMPORTS # endif // openvino_tensorflow_lite_frontend_EXPORTS #endif // OPENVINO_STATIC_LIBRARY diff --git a/src/frontends/tensorflow_lite/src/decoder.cpp b/src/frontends/tensorflow_lite/src/decoder.cpp new file mode 100644 index 00000000000000..e9ce02275e5961 --- /dev/null +++ b/src/frontends/tensorflow_lite/src/decoder.cpp @@ -0,0 +1,13 @@ +// Copyright (C) 2018-2025 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "openvino/frontend/tensorflow_lite/decoder.hpp" + +using namespace ov::frontend::tensorflow_lite; + +DecoderBase::~DecoderBase() = default; + +DecoderBaseOperation::~DecoderBaseOperation() = default; + +DecoderBaseTensor::~DecoderBaseTensor() = default; diff --git a/src/frontends/tensorflow_lite/src/tensorflow_lite.cpp b/src/frontends/tensorflow_lite/src/tensorflow_lite.cpp index 2008a5bdc712c6..4d0b247f8708ef 100644 --- a/src/frontends/tensorflow_lite/src/tensorflow_lite.cpp +++ b/src/frontends/tensorflow_lite/src/tensorflow_lite.cpp @@ -6,11 +6,11 @@ #include "openvino/frontend/tensorflow_lite/frontend.hpp" #include "openvino/frontend/tensorflow_lite/visibility.hpp" -TENSORFLOW_LITE_C_API ov::frontend::FrontEndVersion get_api_version() { +TENSORFLOW_LITE_FRONTEND_C_API ov::frontend::FrontEndVersion get_api_version() { return OV_FRONTEND_API_VERSION; } -TENSORFLOW_LITE_C_API void* get_front_end_data() { +TENSORFLOW_LITE_FRONTEND_C_API void* get_front_end_data() { auto res = new ov::frontend::FrontEndPluginInfo(); res->m_name = "tflite"; res->m_creator = []() {