Skip to content

Commit

Permalink
Fixed more C++ RTTI on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Jan 23, 2025
1 parent 46b5ed1 commit 28aa5d9
Show file tree
Hide file tree
Showing 45 changed files with 188 additions and 124 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/mac_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "graph_iterator.hpp"

#include "openvino/frontend/graph_iterator.hpp"
#include "openvino/frontend/tensorflow/graph_iterator.hpp"

namespace py = pybind11;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <pybind11/pybind11.h>

#include "openvino/frontend/decoder.hpp"
#include "openvino/frontend/graph_iterator.hpp"
#include "openvino/frontend/tensorflow/graph_iterator.hpp"

namespace py = pybind11;

Expand Down
6 changes: 3 additions & 3 deletions src/bindings/python/src/pyopenvino/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,9 @@ ov::Any py_object_to_any(const py::object& py_obj) {
// FrontEnd Decoder
} else if (py::isinstance<ov::frontend::IDecoder>(py_obj)) {
return py::cast<std::shared_ptr<ov::frontend::IDecoder>>(py_obj);
// TF FrontEnd GraphIterator
} else if (py::isinstance<ov::frontend::tensorflow::GraphIterator>(py_obj)) {
return py::cast<std::shared_ptr<ov::frontend::tensorflow::GraphIterator>>(py_obj);
// FrontEnd GraphIterator
} else if (py::isinstance<ov::frontend::GraphIterator>(py_obj)) {
return py::cast<std::shared_ptr<ov::frontend::GraphIterator>>(py_obj);
// Custom FrontEnd Types
} else if (py::isinstance<ov::frontend::type::Tensor>(py_obj)) {
return py::cast<ov::frontend::type::Tensor>(py_obj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);

Expand All @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -51,6 +50,5 @@ class FRONTEND_API GraphIterator : ::ov::RuntimeAttribute {
virtual std::map<std::string, std::string> get_output_names_map() const;
};

} // namespace tensorflow
} // namespace frontend
} // namespace ov
9 changes: 9 additions & 0 deletions src/frontends/common/src/complex_type_mark.cpp
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion src/frontends/common/src/graph_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "openvino/frontend/graph_iterator.hpp"

using namespace ov::frontend::tensorflow;
using namespace ov::frontend;

std::map<std::string, std::string> GraphIterator::get_input_names_map() const {
return {};
Expand Down
5 changes: 4 additions & 1 deletion src/frontends/jax/include/openvino/frontend/jax/decoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<void(std::shared_ptr<JaxDecoder>)> node_visitor) const = 0;

~JaxDecoder() override;
};

} // namespace jax
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ConversionExtension>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
FrontEnd();
Expand Down
12 changes: 6 additions & 6 deletions src/frontends/jax/include/openvino/frontend/jax/visibility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions src/frontends/jax/src/decoder.cpp
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 2 additions & 2 deletions src/frontends/jax/src/jax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ConversionExtension>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
FrontEnd();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/frontends/paddle/src/frontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,11 +586,11 @@ void FrontEnd::normalize(const std::shared_ptr<ov::Model>& 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 = []() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "openvino/core/node.hpp"
#include "openvino/frontend/decoder.hpp"
#include "openvino/frontend/pytorch/visibility.hpp"

namespace ov {
namespace frontend {
Expand All @@ -14,8 +15,10 @@ namespace pytorch {
using DecoderRTInfo = std::unordered_map<std::string, ov::Any>;

/// 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ConversionExtension>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
FrontEnd();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions src/frontends/pytorch/src/decoder.cpp
Original file line number Diff line number Diff line change
@@ -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;
3 changes: 2 additions & 1 deletion src/frontends/pytorch/src/frontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,9 @@ ov::frontend::InputModel::Ptr FrontEnd::load_impl(const std::vector<ov::Any>& va
"PyTorch Frontend doesn't support provided model type. Please provide supported model "
"object using Python API.");
auto decoder = variants[0].as<std::shared_ptr<IDecoder>>();
FRONT_END_GENERAL_CHECK(decoder, "Couldn't cast ov::Any to std::shared_ptr<IDecoder>");
auto tdecoder = std::dynamic_pointer_cast<TorchDecoder>(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<pytorch::InputModel>(tdecoder);
}

Expand Down
Loading

0 comments on commit 28aa5d9

Please sign in to comment.