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 8dfb9cc commit be92a37
Show file tree
Hide file tree
Showing 42 changed files with 151 additions and 85 deletions.
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
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 @@ -6,6 +6,7 @@

#include "openvino/core/type/element_type.hpp"
#include "openvino/op/util/framework_node.hpp"
#include "openvino/frontend/visibility.hpp"

namespace ov {
namespace frontend {
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 @@ -403,8 +403,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
4 changes: 2 additions & 2 deletions src/frontends/pytorch/src/pytorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#pragma once

#include "openvino/frontend/pytorch/visibility.hpp"
#include "openvino/pass/graph_rewrite.hpp"
#include "openvino/pass/pass.hpp"

Expand All @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions src/frontends/pytorch/src/transforms/aten_index_replacer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#pragma once

#include "openvino/frontend/pytorch/visibility.hpp"
#include "openvino/pass/graph_rewrite.hpp"
#include "openvino/pass/pass.hpp"

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
FrontEnd();
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
NodeContext(const std::shared_ptr<DecoderBase>& decoder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit be92a37

Please sign in to comment.