From 91d80bdf86e7f5337f6cf17a2c292ae30359d5a0 Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Wed, 8 Oct 2025 15:06:54 +0200 Subject: [PATCH 1/4] [Snippets] Introduce SNIPPETS_API macro --- .../snippets/include/snippets/op/brgemm.hpp | 3 ++- .../include/snippets/op/broadcastload.hpp | 5 +++-- .../include/snippets/op/broadcastmove.hpp | 5 +++-- .../snippets/include/snippets/op/buffer.hpp | 15 +++++++------ .../snippets/op/convert_saturation.hpp | 3 ++- .../snippets/op/convert_truncation.hpp | 3 ++- .../snippets/include/snippets/op/fill.hpp | 3 ++- .../include/snippets/op/horizon_max.hpp | 3 ++- .../include/snippets/op/horizon_sum.hpp | 3 ++- .../snippets/include/snippets/op/kernel.hpp | 7 +++--- .../snippets/include/snippets/op/load.hpp | 7 +++--- .../snippets/include/snippets/op/loop.hpp | 7 +++--- .../include/snippets/op/memory_access.hpp | 5 +++-- .../snippets/include/snippets/op/nop.hpp | 3 ++- .../include/snippets/op/online_softmax.hpp | 3 ++- .../snippets/op/online_softmax_update_max.hpp | 3 ++- .../snippets/op/online_softmax_update_sum.hpp | 3 ++- .../include/snippets/op/perf_count.hpp | 15 +++++++------ .../include/snippets/op/powerstatic.hpp | 3 ++- .../snippets/op/rank_normalization.hpp | 5 +++-- .../snippets/include/snippets/op/reduce.hpp | 7 +++--- .../include/snippets/op/reg_spill.hpp | 9 ++++---- .../snippets/include/snippets/op/reorder.hpp | 5 +++-- .../snippets/include/snippets/op/reshape.hpp | 5 +++-- .../snippets/include/snippets/op/scalar.hpp | 3 ++- .../snippets/op/serialization_node.hpp | 3 ++- .../include/snippets/op/shape_infer_op.hpp | 3 ++- .../snippets/include/snippets/op/store.hpp | 3 ++- .../snippets/include/snippets/op/subgraph.hpp | 7 +++--- .../include/snippets/op/vector_buffer.hpp | 3 ++- .../snippets/pass/align_element_types.hpp | 3 ++- .../pass/analyze_broadcastable_inputs.hpp | 3 ++- .../pass/broadcast_to_movebroadcast.hpp | 3 ++- .../snippets/pass/canonicalization.hpp | 3 ++- .../snippets/pass/collapse_subgraph.hpp | 3 ++- .../snippets/pass/common_optimizations.hpp | 5 +++-- .../snippets/pass/convert_constants.hpp | 3 ++- .../pass/convert_power_to_powerstatic.hpp | 3 ++- .../pass/explicit_transpose_matmul_inputs.hpp | 3 ++- .../snippets/pass/extract_constants.hpp | 3 ++- .../pass/extract_reshapes_from_mha.hpp | 7 +++--- .../pass/extract_unsupported_transposes.hpp | 3 ++- .../include/snippets/pass/fc_tokenization.hpp | 3 ++- .../snippets/pass/fq_decomposition.hpp | 5 +++-- .../snippets/pass/fuse_transpose_brgemm.hpp | 3 ++- .../snippets/pass/gated_mlp_tokenization.hpp | 3 ++- .../snippets/pass/gn_decomposition.hpp | 3 ++- .../include/snippets/pass/gn_tokenization.hpp | 3 ++- .../snippets/include/snippets/pass/hash.hpp | 3 ++- .../include/snippets/pass/manager.hpp | 3 ++- .../snippets/pass/matmul_to_brgemm.hpp | 3 ++- .../snippets/pass/mha_tokenization.hpp | 5 +++-- .../snippets/pass/mlp_seq_tokenization.hpp | 5 +++-- .../pass/online_softmax_decomposition.hpp | 3 ++- .../include/snippets/pass/positioned_pass.hpp | 5 +++-- .../snippets/pass/propagate_precision.hpp | 3 ++- .../pass/reduce_to_snippets_reduce.hpp | 3 ++- .../snippets/pass/softmax_decomposition.hpp | 3 ++- .../pass/softmax_reshape_elimination.hpp | 3 ++- .../snippets/pass/split_dimension_m.hpp | 3 ++- .../snippets/pass/subgraph_manager.hpp | 3 ++- .../include/snippets/pass/subgraph_pass.hpp | 3 ++- .../include/snippets/pass/tokenization.hpp | 17 +++++++------- .../snippets/pass/tokenization_config.hpp | 3 ++- .../snippets/pass/transform_convert.hpp | 3 ++- .../snippets/pass/transpose_decomposition.hpp | 3 ++- .../include/snippets/pass/validate.hpp | 3 ++- .../include/snippets/snippets_visibility.hpp | 22 +++++++++++++++++++ 68 files changed, 201 insertions(+), 112 deletions(-) create mode 100644 src/common/snippets/include/snippets/snippets_visibility.hpp diff --git a/src/common/snippets/include/snippets/op/brgemm.hpp b/src/common/snippets/include/snippets/op/brgemm.hpp index 2c6ca0d0bd46ce..8dac97982d3154 100644 --- a/src/common/snippets/include/snippets/op/brgemm.hpp +++ b/src/common/snippets/include/snippets/op/brgemm.hpp @@ -7,6 +7,7 @@ #include "memory_access.hpp" #include "openvino/op/op.hpp" #include "snippets/shape_inference/shape_inference.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -15,7 +16,7 @@ namespace ov::snippets::op { * @brief Brgemm is a batch-reduced matrix multiplication with the support of arbitrary strides between matrices rows * @ingroup snippets */ -class Brgemm : virtual public modifier::MemoryAccess, public ov::op::Op { +class SNIPPETS_API Brgemm : virtual public modifier::MemoryAccess, public ov::op::Op { public: OPENVINO_OP("Brgemm", "SnippetsOpset"); explicit Brgemm(const Output& A, diff --git a/src/common/snippets/include/snippets/op/broadcastload.hpp b/src/common/snippets/include/snippets/op/broadcastload.hpp index 6828c10df5918e..f3482d76ec4883 100644 --- a/src/common/snippets/include/snippets/op/broadcastload.hpp +++ b/src/common/snippets/include/snippets/op/broadcastload.hpp @@ -16,6 +16,7 @@ #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" #include "snippets/shape_inference/shape_infer_instances.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -25,7 +26,7 @@ namespace ov::snippets::op { * dimension for blocked * @ingroup snippets */ -class BroadcastLoad : public modifier::MemoryAccess, public ov::op::Op { +class SNIPPETS_API BroadcastLoad : public modifier::MemoryAccess, public ov::op::Op { public: OPENVINO_OP("BroadcastLoad", "SnippetsOpset"); @@ -50,7 +51,7 @@ class BroadcastLoad : public modifier::MemoryAccess, public ov::op::Op { // but have identical shapeInfer semantics. In order to avoid code duplication, // we created dummy ShapeInfer classes that are essentially instantiations // of a common ShapeInfer class template; - struct ShapeInfer : public BroadcastShapeInfer { + struct SNIPPETS_API ShapeInfer : public BroadcastShapeInfer { explicit ShapeInfer(const std::shared_ptr& n) : BroadcastShapeInfer(n) {} }; diff --git a/src/common/snippets/include/snippets/op/broadcastmove.hpp b/src/common/snippets/include/snippets/op/broadcastmove.hpp index 11c879e17250bd..4facd2c264327d 100644 --- a/src/common/snippets/include/snippets/op/broadcastmove.hpp +++ b/src/common/snippets/include/snippets/op/broadcastmove.hpp @@ -14,6 +14,7 @@ #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" #include "snippets/shape_inference/shape_infer_instances.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -22,7 +23,7 @@ namespace ov::snippets::op { * @brief Added to a subgraph if explicit broadcast instruction should be generated * @ingroup snippets */ -class BroadcastMove : public ov::op::Op { +class SNIPPETS_API BroadcastMove : public ov::op::Op { public: OPENVINO_OP("BroadcastMove", "SnippetsOpset"); @@ -44,7 +45,7 @@ class BroadcastMove : public ov::op::Op { // but have identical shapeInfer semantics. In order to avoid code duplication, // we created dummy ShapeInfer classes that are essentially instantiations // of a common ShapeInfer class template; - struct ShapeInfer : public BroadcastShapeInfer { + struct SNIPPETS_API ShapeInfer : public BroadcastShapeInfer { explicit ShapeInfer(const std::shared_ptr& n) : BroadcastShapeInfer(n) {} }; diff --git a/src/common/snippets/include/snippets/op/buffer.hpp b/src/common/snippets/include/snippets/op/buffer.hpp index ae58c9ab55fd57..c16f9d7fbdd4fa 100644 --- a/src/common/snippets/include/snippets/op/buffer.hpp +++ b/src/common/snippets/include/snippets/op/buffer.hpp @@ -17,6 +17,7 @@ #include "openvino/op/op.hpp" #include "snippets/shape_inference/shape_inference.hpp" #include "snippets/shape_types.hpp" +#include "snippets/snippets_visibility.hpp" #include "snippets/utils/utils.hpp" namespace ov::snippets::op { @@ -32,7 +33,7 @@ namespace ov::snippets::op { * implemented in the field `m_impl`. * @ingroup snippets */ -class Buffer : public ov::op::Op { +class SNIPPETS_API Buffer : public ov::op::Op { public: OPENVINO_OP("Buffer", "SnippetsOpset"); Buffer() = default; @@ -50,7 +51,7 @@ class Buffer : public ov::op::Op { return m_impl->get_allocation_size(); } - class ShapeInfer : public IShapeInferSnippets { + class SNIPPETS_API ShapeInfer : public IShapeInferSnippets { std::shared_ptr m_impl_shape_infer{nullptr}; public: @@ -60,7 +61,7 @@ class Buffer : public ov::op::Op { private: // Base class for implementations of Buffer - class BaseImpl { + class SNIPPETS_API BaseImpl { public: BaseImpl() = default; virtual ~BaseImpl() = default; @@ -73,7 +74,7 @@ class Buffer : public ov::op::Op { // IntermediateMemoryImpl represents intermediate memory. // The buffers with this implementation must have source (parents) - class IntermediateMemoryImpl : public BaseImpl { + class SNIPPETS_API IntermediateMemoryImpl : public BaseImpl { public: IntermediateMemoryImpl() = default; @@ -90,7 +91,7 @@ class Buffer : public ov::op::Op { } private: - class ShapeInfer : public IShapeInferSnippets { + class SNIPPETS_API ShapeInfer : public IShapeInferSnippets { public: Result infer(const std::vector& input_shapes) override; }; @@ -98,7 +99,7 @@ class Buffer : public ov::op::Op { // NewMemoryImpl represents a new empty memory for allocation with specified shape and element type. // The buffers with this implementation mustn't have source (parents) - class NewMemoryImpl : public BaseImpl { + class SNIPPETS_API NewMemoryImpl : public BaseImpl { public: explicit NewMemoryImpl(const ov::Shape& shape, ov::element::Type element_type); @@ -111,7 +112,7 @@ class Buffer : public ov::op::Op { } private: - class ShapeInfer : public IShapeInferSnippets { + class SNIPPETS_API ShapeInfer : public IShapeInferSnippets { ov::Shape m_shape; public: diff --git a/src/common/snippets/include/snippets/op/convert_saturation.hpp b/src/common/snippets/include/snippets/op/convert_saturation.hpp index db2465dd31abb9..5c8d6c09cc0474 100644 --- a/src/common/snippets/include/snippets/op/convert_saturation.hpp +++ b/src/common/snippets/include/snippets/op/convert_saturation.hpp @@ -12,6 +12,7 @@ #include "openvino/core/node_vector.hpp" #include "openvino/core/type/element_type.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -25,7 +26,7 @@ namespace ov::snippets::op { * 129 ---> 127 * @ingroup snippets */ -class ConvertSaturation : public ov::op::v0::Convert { +class SNIPPETS_API ConvertSaturation : public ov::op::v0::Convert { public: OPENVINO_OP("ConvertSaturation", "SnippetsOpset", ov::op::v0::Convert); diff --git a/src/common/snippets/include/snippets/op/convert_truncation.hpp b/src/common/snippets/include/snippets/op/convert_truncation.hpp index 8e6c0551bc2238..6131977f06b936 100644 --- a/src/common/snippets/include/snippets/op/convert_truncation.hpp +++ b/src/common/snippets/include/snippets/op/convert_truncation.hpp @@ -12,6 +12,7 @@ #include "openvino/core/node_vector.hpp" #include "openvino/core/type/element_type.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -24,7 +25,7 @@ namespace ov::snippets::op { * 129 ---> -127 * @ingroup snippets */ -class ConvertTruncation : public ov::op::v0::Convert { +class SNIPPETS_API ConvertTruncation : public ov::op::v0::Convert { public: OPENVINO_OP("ConvertTruncation", "SnippetsOpset", ov::op::v0::Convert); diff --git a/src/common/snippets/include/snippets/op/fill.hpp b/src/common/snippets/include/snippets/op/fill.hpp index 83a72546a789b8..91e2fdc8f64cba 100644 --- a/src/common/snippets/include/snippets/op/fill.hpp +++ b/src/common/snippets/include/snippets/op/fill.hpp @@ -13,6 +13,7 @@ #include "openvino/core/node_output.hpp" #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -26,7 +27,7 @@ namespace ov::snippets::op { * - fill_value - hexadecimal filling value * @ingroup snippets */ -class Fill : public ov::op::Op { +class SNIPPETS_API Fill : public ov::op::Op { public: OPENVINO_OP("Fill", "SnippetsOpset"); diff --git a/src/common/snippets/include/snippets/op/horizon_max.hpp b/src/common/snippets/include/snippets/op/horizon_max.hpp index 397138a3b51d23..61bd6cfa648a28 100644 --- a/src/common/snippets/include/snippets/op/horizon_max.hpp +++ b/src/common/snippets/include/snippets/op/horizon_max.hpp @@ -11,6 +11,7 @@ #include "openvino/core/node_output.hpp" #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -19,7 +20,7 @@ namespace ov::snippets::op { * @brief The operation calculates a horizon maximum of a vector register * @ingroup snippets */ -class HorizonMax : public ov::op::Op { +class SNIPPETS_API HorizonMax : public ov::op::Op { public: OPENVINO_OP("HorizonMax", "SnippetsOpset"); diff --git a/src/common/snippets/include/snippets/op/horizon_sum.hpp b/src/common/snippets/include/snippets/op/horizon_sum.hpp index 360ff98c0920ba..5bd92c6b313087 100644 --- a/src/common/snippets/include/snippets/op/horizon_sum.hpp +++ b/src/common/snippets/include/snippets/op/horizon_sum.hpp @@ -11,6 +11,7 @@ #include "openvino/core/node_output.hpp" #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -19,7 +20,7 @@ namespace ov::snippets::op { * @brief The operation calculates a horizon sum of a vector register * @ingroup snippets */ -class HorizonSum : public ov::op::Op { +class SNIPPETS_API HorizonSum : public ov::op::Op { public: OPENVINO_OP("HorizonSum", "SnippetsOpset"); diff --git a/src/common/snippets/include/snippets/op/kernel.hpp b/src/common/snippets/include/snippets/op/kernel.hpp index 41f7a24af850ab..def3cb20eaf028 100644 --- a/src/common/snippets/include/snippets/op/kernel.hpp +++ b/src/common/snippets/include/snippets/op/kernel.hpp @@ -11,6 +11,7 @@ #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" #include "snippets/lowered/linear_ir.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -19,7 +20,7 @@ namespace ov::snippets::op { * @brief Generated by Canonicalization and represents compute kernel legal for scheduling * @ingroup snippets */ -class Kernel : public ov::op::Op { +class SNIPPETS_API Kernel : public ov::op::Op { public: OPENVINO_OP("Kernel", "SnippetsOpset"); Kernel() = default; @@ -33,7 +34,7 @@ class Kernel : public ov::op::Op { const void* compile_params = nullptr; }; -class KernelStatic : public Kernel { +class SNIPPETS_API KernelStatic : public Kernel { public: OPENVINO_OP("KernelStatic", "SnippetsOpset", Kernel); KernelStatic() = default; @@ -44,7 +45,7 @@ class KernelStatic : public Kernel { std::shared_ptr clone_with_new_inputs(const OutputVector& inputs) const override; }; -class KernelDynamic : public Kernel { +class SNIPPETS_API KernelDynamic : public Kernel { public: OPENVINO_OP("KernelDynamic", "SnippetsOpset", Kernel); KernelDynamic() = default; diff --git a/src/common/snippets/include/snippets/op/load.hpp b/src/common/snippets/include/snippets/op/load.hpp index d7aa5a78be4e53..59b0c3e4c6e0ff 100644 --- a/src/common/snippets/include/snippets/op/load.hpp +++ b/src/common/snippets/include/snippets/op/load.hpp @@ -16,6 +16,7 @@ #include "snippets/op/memory_access.hpp" #include "snippets/shape_inference/shape_inference.hpp" #include "snippets/shape_types.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -27,7 +28,7 @@ namespace ov::snippets::op { * first element) * @ingroup snippets */ -class Load : public modifier::MemoryAccess, public ov::op::Op { +class SNIPPETS_API Load : public modifier::MemoryAccess, public ov::op::Op { public: OPENVINO_OP("Load", "SnippetsOpset"); @@ -63,7 +64,7 @@ class Load : public modifier::MemoryAccess, public ov::op::Op { * Load and Store. This is a temporary solution until tokenization of Reshape operation is supported. * @ingroup snippets */ -class LoadReorder : public Load { +class SNIPPETS_API LoadReorder : public Load { public: OPENVINO_OP("LoadReorder", "SnippetsOpset", Load); explicit LoadReorder(const Output& x, @@ -83,7 +84,7 @@ class LoadReorder : public Load { std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; void validate_and_infer_types() override; - class ShapeInfer : public IShapeInferSnippets { + class SNIPPETS_API ShapeInfer : public IShapeInferSnippets { std::vector m_order; public: diff --git a/src/common/snippets/include/snippets/op/loop.hpp b/src/common/snippets/include/snippets/op/loop.hpp index b5d3c7c11eac01..03c646526b1b4b 100644 --- a/src/common/snippets/include/snippets/op/loop.hpp +++ b/src/common/snippets/include/snippets/op/loop.hpp @@ -14,6 +14,7 @@ #include "openvino/core/node_output.hpp" #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { /** @@ -21,7 +22,7 @@ namespace ov::snippets::op { * @brief Base class for LoopBegin and LoopEnd * @ingroup snippets */ -class LoopBase : public ov::op::Op { +class SNIPPETS_API LoopBase : public ov::op::Op { public: OPENVINO_OP("LoopBase", "SnippetsOpset"); explicit LoopBase(const OutputVector& args, bool is_parallel); @@ -48,7 +49,7 @@ class LoopEnd; * @param args - vector of input values, they are passed directly to output. * @ingroup snippets */ -class LoopBegin : public LoopBase { +class SNIPPETS_API LoopBegin : public LoopBase { friend LoopEnd; public: @@ -79,7 +80,7 @@ class LoopBegin : public LoopBase { * @param id the identifier of Loop in Loop system in LoopManager * @ingroup snippets */ -class LoopEnd : public LoopBase { +class SNIPPETS_API LoopEnd : public LoopBase { public: OPENVINO_OP("LoopEnd", "SnippetsOpset", LoopBase); LoopEnd() = default; diff --git a/src/common/snippets/include/snippets/op/memory_access.hpp b/src/common/snippets/include/snippets/op/memory_access.hpp index 1d09bc463a6845..286987d0405365 100644 --- a/src/common/snippets/include/snippets/op/memory_access.hpp +++ b/src/common/snippets/include/snippets/op/memory_access.hpp @@ -11,6 +11,7 @@ #include "openvino/core/attribute_visitor.hpp" #include "openvino/core/node.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::modifier { @@ -23,7 +24,7 @@ namespace ov::snippets::modifier { * @ingroup snippets */ -class MemoryAccess { +class SNIPPETS_API MemoryAccess { public: /** * @interface PortDescriptor @@ -33,7 +34,7 @@ class MemoryAccess { * @param m_index - port index * @ingroup snippets */ - struct PortDescriptor { + struct SNIPPETS_API PortDescriptor { PortDescriptor(size_t count, size_t offset) : count(count), offset(offset) {} PortDescriptor() = default; // TODO: should we deprecate count in favor of subtensors, ticket: 130004 diff --git a/src/common/snippets/include/snippets/op/nop.hpp b/src/common/snippets/include/snippets/op/nop.hpp index fff0a95aba390f..b688187f8a3e7c 100644 --- a/src/common/snippets/include/snippets/op/nop.hpp +++ b/src/common/snippets/include/snippets/op/nop.hpp @@ -9,6 +9,7 @@ #include "openvino/core/node.hpp" #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -17,7 +18,7 @@ namespace ov::snippets::op { * @brief Generated by Canonicalization and represents not-an-operation * @ingroup snippets */ -class Nop : public ov::op::Op { +class SNIPPETS_API Nop : public ov::op::Op { public: OPENVINO_OP("Nop", "SnippetsOpset"); diff --git a/src/common/snippets/include/snippets/op/online_softmax.hpp b/src/common/snippets/include/snippets/op/online_softmax.hpp index 19366dad649c03..d6b281dcfef8c7 100644 --- a/src/common/snippets/include/snippets/op/online_softmax.hpp +++ b/src/common/snippets/include/snippets/op/online_softmax.hpp @@ -7,6 +7,7 @@ #include "openvino/core/node.hpp" #include "openvino/core/node_output.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -15,7 +16,7 @@ namespace ov::snippets::op { * @brief OnlineSoftmax is a softmax that evaluate with online manner with axis on last dimension. * @ingroup snippets */ -class OnlineSoftmax : public ov::op::Op { +class SNIPPETS_API OnlineSoftmax : public ov::op::Op { public: OPENVINO_OP("OnlineSoftmax", "SnippetsOpset"); diff --git a/src/common/snippets/include/snippets/op/online_softmax_update_max.hpp b/src/common/snippets/include/snippets/op/online_softmax_update_max.hpp index 1725970a357704..0ba3d68216a5e9 100644 --- a/src/common/snippets/include/snippets/op/online_softmax_update_max.hpp +++ b/src/common/snippets/include/snippets/op/online_softmax_update_max.hpp @@ -11,6 +11,7 @@ #include "openvino/core/node.hpp" #include "openvino/core/node_output.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -32,7 +33,7 @@ namespace ov::snippets::op { * * Note that Buffer must be updated with the Max result only after Sub from control flow perspective. */ -class OnlineSoftmaxUpdateMax : public ov::op::Op { +class SNIPPETS_API OnlineSoftmaxUpdateMax : public ov::op::Op { public: OPENVINO_OP("OnlineSoftmaxUpdateMax", "SnippetsOpset"); diff --git a/src/common/snippets/include/snippets/op/online_softmax_update_sum.hpp b/src/common/snippets/include/snippets/op/online_softmax_update_sum.hpp index 9f7cb29167946e..13e74459d1fe8a 100644 --- a/src/common/snippets/include/snippets/op/online_softmax_update_sum.hpp +++ b/src/common/snippets/include/snippets/op/online_softmax_update_sum.hpp @@ -11,6 +11,7 @@ #include "openvino/core/node.hpp" #include "openvino/core/node_output.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -27,7 +28,7 @@ namespace ov::snippets::op { * | * Result0 */ -class OnlineSoftmaxUpdateSum : public ov::op::Op { +class SNIPPETS_API OnlineSoftmaxUpdateSum : public ov::op::Op { public: OPENVINO_OP("OnlineSoftmaxUpdateSum", "SnippetsOpset"); diff --git a/src/common/snippets/include/snippets/op/perf_count.hpp b/src/common/snippets/include/snippets/op/perf_count.hpp index e7642158b1a0fd..423d08007718f4 100644 --- a/src/common/snippets/include/snippets/op/perf_count.hpp +++ b/src/common/snippets/include/snippets/op/perf_count.hpp @@ -1,3 +1,4 @@ +#include "snippets/snippets_visibility.hpp" // Copyright (C) 2018-2025 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -33,7 +34,7 @@ namespace utils { * @brief Dumper for node debug properties * @ingroup snippets */ -class Dumper { +class SNIPPETS_API Dumper { public: Dumper() = default; virtual ~Dumper() = default; @@ -51,7 +52,7 @@ class Dumper { * @brief Dumper for node debug properties (output: stdout) * @ingroup snippets */ -class ConsoleDumper : public Dumper { +class SNIPPETS_API ConsoleDumper : public Dumper { public: ConsoleDumper() = default; ~ConsoleDumper() override; @@ -68,7 +69,7 @@ class ConsoleDumper : public Dumper { * @brief Dumper for node debug properties (output: .csv file) * @ingroup snippets */ -class CSVDumper : public Dumper { +class SNIPPETS_API CSVDumper : public Dumper { public: explicit CSVDumper(std::string csv_path); ~CSVDumper() override; @@ -88,7 +89,7 @@ namespace op { * @brief Base class for PerfCountBegin and PerfCountRdtscBegin(cpu) * @ingroup snippets */ -class PerfCountBeginBase : public ov::op::Op { +class SNIPPETS_API PerfCountBeginBase : public ov::op::Op { public: OPENVINO_OP("PerfCountBeginBase", "SnippetsOpset"); explicit PerfCountBeginBase(const std::vector>& args); @@ -105,7 +106,7 @@ class PerfCountBeginBase : public ov::op::Op { * @brief Base class for PerfCountEnd and PerfCountRdtscEnd * @ingroup snippets */ -class PerfCountEndBase : public ov::op::Op { +class SNIPPETS_API PerfCountEndBase : public ov::op::Op { public: OPENVINO_OP("PerfCountEndBase", "SnippetsOpset"); explicit PerfCountEndBase(const std::vector>& args); @@ -119,7 +120,7 @@ class PerfCountEndBase : public ov::op::Op { * @brief Performance count start time with chrono call * @ingroup snippets */ -class PerfCountBegin : public PerfCountBeginBase { +class SNIPPETS_API PerfCountBegin : public PerfCountBeginBase { public: OPENVINO_OP("PerfCountBegin", "SnippetsOpset", PerfCountBeginBase); PerfCountBegin(); @@ -138,7 +139,7 @@ class PerfCountBegin : public PerfCountBeginBase { * @brief Performance count end time and duration with chrono call * @ingroup snippets */ -class PerfCountEnd : public PerfCountEndBase { +class SNIPPETS_API PerfCountEnd : public PerfCountEndBase { public: OPENVINO_OP("PerfCountEnd", "SnippetsOpset", PerfCountEndBase); explicit PerfCountEnd(const Output& pc_begin, diff --git a/src/common/snippets/include/snippets/op/powerstatic.hpp b/src/common/snippets/include/snippets/op/powerstatic.hpp index 8ea3e9f5c40576..e06bc988f359bb 100644 --- a/src/common/snippets/include/snippets/op/powerstatic.hpp +++ b/src/common/snippets/include/snippets/op/powerstatic.hpp @@ -12,6 +12,7 @@ #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" #include "openvino/op/util/unary_elementwise_arithmetic.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -20,7 +21,7 @@ namespace ov::snippets::op { * @brief Generated by Canonicalization for a spasical case of power innstruction which has constant power value * @ingroup snippets */ -class PowerStatic : public ov::op::util::UnaryElementwiseArithmetic { +class SNIPPETS_API PowerStatic : public ov::op::util::UnaryElementwiseArithmetic { public: OPENVINO_OP("PowerStatic", "SnippetsOpset", ov::op::util::UnaryElementwiseArithmetic); diff --git a/src/common/snippets/include/snippets/op/rank_normalization.hpp b/src/common/snippets/include/snippets/op/rank_normalization.hpp index 8c5b74a6c49b6b..900aa3ca7f9cef 100644 --- a/src/common/snippets/include/snippets/op/rank_normalization.hpp +++ b/src/common/snippets/include/snippets/op/rank_normalization.hpp @@ -16,6 +16,7 @@ #include "shape_infer_op.hpp" #include "snippets/shape_inference/shape_inference.hpp" #include "snippets/shape_types.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -31,7 +32,7 @@ namespace ov::snippets::op { // but RankNormalization has a much narrower semantics, and hence allows for an easier control and a more efficient // shape infer. // -class RankNormalization : public ShapeInferOp { +class SNIPPETS_API RankNormalization : public ShapeInferOp { public: OPENVINO_OP("RankNormalization", "SnippetsOpset", ShapeInferOp); @@ -49,7 +50,7 @@ class RankNormalization : public ShapeInferOp { return m_num_prepend; } - class ShapeInfer : public IShapeInferSnippets { + class SNIPPETS_API ShapeInfer : public IShapeInferSnippets { size_t m_num_prepend = 0; size_t m_num_append = 0; diff --git a/src/common/snippets/include/snippets/op/reduce.hpp b/src/common/snippets/include/snippets/op/reduce.hpp index f8b365f266a71e..72cf22e10341dc 100644 --- a/src/common/snippets/include/snippets/op/reduce.hpp +++ b/src/common/snippets/include/snippets/op/reduce.hpp @@ -12,6 +12,7 @@ #include "openvino/core/node_output.hpp" #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -21,7 +22,7 @@ namespace ov::snippets::op { * @param m_axis reduce axis. * @ingroup snippets */ -class ReduceBase : public ov::op::Op { +class SNIPPETS_API ReduceBase : public ov::op::Op { public: OPENVINO_OP("ReduceBase", "SnippetsOpset"); @@ -39,7 +40,7 @@ class ReduceBase : public ov::op::Op { size_t m_axis = 0; }; -class ReduceSum : public ReduceBase { +class SNIPPETS_API ReduceSum : public ReduceBase { public: OPENVINO_OP("ReduceSum", "SnippetsOpset", ReduceBase); ReduceSum(const Output& x, size_t axis) : ReduceBase(x, axis) {} @@ -47,7 +48,7 @@ class ReduceSum : public ReduceBase { std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; }; -class ReduceMax : public ReduceBase { +class SNIPPETS_API ReduceMax : public ReduceBase { public: OPENVINO_OP("ReduceMax", "SnippetsOpset", ReduceBase); ReduceMax(const Output& x, size_t axis) : ReduceBase(x, axis) {} diff --git a/src/common/snippets/include/snippets/op/reg_spill.hpp b/src/common/snippets/include/snippets/op/reg_spill.hpp index c52b41f3533fba..3e3021e19a8242 100644 --- a/src/common/snippets/include/snippets/op/reg_spill.hpp +++ b/src/common/snippets/include/snippets/op/reg_spill.hpp @@ -19,6 +19,7 @@ #include "snippets/emitter.hpp" #include "snippets/shape_inference/shape_inference.hpp" #include "snippets/shape_types.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -27,7 +28,7 @@ namespace ov::snippets::op { * @brief Base class for RegSpillBegin and RegSpillEnd ops * @ingroup snippets */ -class RegSpillBase : public ov::op::Op { +class SNIPPETS_API RegSpillBase : public ov::op::Op { public: OPENVINO_OP("RegSpillBaseBase", "SnippetsOpset"); explicit RegSpillBase(const std::vector>& args); @@ -41,7 +42,7 @@ class RegSpillEnd; * @brief Marks the start of the register spill region. * @ingroup snippets */ -class RegSpillBegin : public RegSpillBase { +class SNIPPETS_API RegSpillBegin : public RegSpillBase { public: OPENVINO_OP("RegSpillBegin", "SnippetsOpset", RegSpillBase); explicit RegSpillBegin(std::set regs_to_spill); @@ -53,7 +54,7 @@ class RegSpillBegin : public RegSpillBase { return m_regs_to_spill; } - class ShapeInfer : public IShapeInferSnippets { + class SNIPPETS_API ShapeInfer : public IShapeInferSnippets { size_t num_out_shapes = 0; public: @@ -70,7 +71,7 @@ class RegSpillBegin : public RegSpillBase { * @brief Marks the end of the register spill region. * @ingroup snippets */ -class RegSpillEnd : public RegSpillBase { +class SNIPPETS_API RegSpillEnd : public RegSpillBase { public: OPENVINO_OP("RegSpillEnd", "SnippetsOpset", RegSpillBase); RegSpillEnd() = default; diff --git a/src/common/snippets/include/snippets/op/reorder.hpp b/src/common/snippets/include/snippets/op/reorder.hpp index 3ce31e9686c934..9d4ef6f5732748 100644 --- a/src/common/snippets/include/snippets/op/reorder.hpp +++ b/src/common/snippets/include/snippets/op/reorder.hpp @@ -16,6 +16,7 @@ #include "shape_infer_op.hpp" #include "snippets/shape_inference/shape_inference.hpp" #include "snippets/shape_types.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { /** @@ -25,7 +26,7 @@ namespace ov::snippets::op { * Note: Order is stored in input PortDescriptor * @ingroup snippets */ -class Reorder : public ShapeInferOp { +class SNIPPETS_API Reorder : public ShapeInferOp { public: OPENVINO_OP("Reorder", "SnippetsOpset", ShapeInferOp); Reorder() = default; @@ -35,7 +36,7 @@ class Reorder : public ShapeInferOp { std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; void validate_and_infer_types() override; - class ShapeInfer : public IShapeInferSnippets { + class SNIPPETS_API ShapeInfer : public IShapeInferSnippets { std::vector m_target_order; public: diff --git a/src/common/snippets/include/snippets/op/reshape.hpp b/src/common/snippets/include/snippets/op/reshape.hpp index ca3bf4a42de8aa..93d103c4a717bd 100644 --- a/src/common/snippets/include/snippets/op/reshape.hpp +++ b/src/common/snippets/include/snippets/op/reshape.hpp @@ -17,6 +17,7 @@ #include "shape_infer_op.hpp" #include "snippets/shape_inference/shape_inference.hpp" #include "snippets/shape_types.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -25,7 +26,7 @@ namespace ov::snippets::op { * @brief Reshape input tensor to reqiured target shape * @ingroup snippets */ -class Reshape : public ShapeInferOp { +class SNIPPETS_API Reshape : public ShapeInferOp { public: OPENVINO_OP("Reshape", "SnippetsOpset", ShapeInferOp); Reshape(const Output& arg, ov::PartialShape target_shape); @@ -38,7 +39,7 @@ class Reshape : public ShapeInferOp { const ov::PartialShape& get_target_shape() const; void set_target_shape(ov::PartialShape shape); - class ShapeInfer : public IShapeInferSnippets { + class SNIPPETS_API ShapeInfer : public IShapeInferSnippets { VectorDims target_shape; size_t target_shape_volume = 0; diff --git a/src/common/snippets/include/snippets/op/scalar.hpp b/src/common/snippets/include/snippets/op/scalar.hpp index efe1b75e007461..f5db95d87252f9 100644 --- a/src/common/snippets/include/snippets/op/scalar.hpp +++ b/src/common/snippets/include/snippets/op/scalar.hpp @@ -15,6 +15,7 @@ #include "openvino/core/type/element_type.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -23,7 +24,7 @@ namespace ov::snippets::op { * @brief Generated by Canonicalization for a scalar constant Shape() == {1} * @ingroup snippets */ -class Scalar : public ov::op::v0::Constant { +class SNIPPETS_API Scalar : public ov::op::v0::Constant { public: OPENVINO_OP("Scalar", "SnippetsOpset", ov::op::v0::Constant); diff --git a/src/common/snippets/include/snippets/op/serialization_node.hpp b/src/common/snippets/include/snippets/op/serialization_node.hpp index 0e6065aa6cacb7..bc810a1c077b33 100644 --- a/src/common/snippets/include/snippets/op/serialization_node.hpp +++ b/src/common/snippets/include/snippets/op/serialization_node.hpp @@ -12,6 +12,7 @@ #include "openvino/core/node.hpp" #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -20,7 +21,7 @@ namespace ov::snippets::op { * @brief Fake node needed to serialize lowered::Expression sessionIR * @ingroup snippets */ -class SerializationNode : public ov::op::Op { +class SNIPPETS_API SerializationNode : public ov::op::Op { public: OPENVINO_OP("SerializationNode", "SnippetsOpset"); diff --git a/src/common/snippets/include/snippets/op/shape_infer_op.hpp b/src/common/snippets/include/snippets/op/shape_infer_op.hpp index 2a82f909c674c0..74c2c0982bbe00 100644 --- a/src/common/snippets/include/snippets/op/shape_infer_op.hpp +++ b/src/common/snippets/include/snippets/op/shape_infer_op.hpp @@ -6,6 +6,7 @@ #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -14,7 +15,7 @@ namespace ov::snippets::op { * @brief Op which infers shape without actually moving data * @ingroup snippets */ -class ShapeInferOp : public ov::op::Op { +class SNIPPETS_API ShapeInferOp : public ov::op::Op { public: OPENVINO_OP("ShapeInferOp", "SnippetsOpset"); ShapeInferOp() = default; diff --git a/src/common/snippets/include/snippets/op/store.hpp b/src/common/snippets/include/snippets/op/store.hpp index 17c62896e59381..55f7d85439e1b1 100644 --- a/src/common/snippets/include/snippets/op/store.hpp +++ b/src/common/snippets/include/snippets/op/store.hpp @@ -13,6 +13,7 @@ #include "openvino/core/node_vector.hpp" #include "openvino/op/op.hpp" #include "snippets/op/memory_access.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -24,7 +25,7 @@ namespace ov::snippets::op { * memory ptr) * @ingroup snippets */ -class Store : public modifier::MemoryAccess, public ov::op::Op { +class SNIPPETS_API Store : public modifier::MemoryAccess, public ov::op::Op { public: OPENVINO_OP("Store", "SnippetsOpset"); diff --git a/src/common/snippets/include/snippets/op/subgraph.hpp b/src/common/snippets/include/snippets/op/subgraph.hpp index 283baff38b6e1e..ffcfec22dcf237 100644 --- a/src/common/snippets/include/snippets/op/subgraph.hpp +++ b/src/common/snippets/include/snippets/op/subgraph.hpp @@ -31,6 +31,7 @@ #include "snippets/runtime_configurator.hpp" #include "snippets/shape_inference/shape_inference.hpp" #include "snippets/shape_types.hpp" +#include "snippets/snippets_visibility.hpp" #include "snippets/utils/debug_caps_config.hpp" namespace ov::snippets::op { @@ -40,7 +41,7 @@ namespace ov::snippets::op { * @brief An operation that is implemented by a model * @ingroup snippets */ -class Subgraph : public ov::op::util::SubGraphOp { +class SNIPPETS_API Subgraph : public ov::op::util::SubGraphOp { public: OPENVINO_OP("Subgraph", "SnippetsOpset", ov::op::util::SubGraphOp); // < 1, 42, 17, 15, 16> < 0, 1, 2, 3, 1> @@ -225,7 +226,7 @@ class Subgraph : public ov::op::util::SubGraphOp { * @brief Config to optimize IR transformation pipeline. It indicates which transformations are necessary * so the irrelevant ones could be skipped. */ - class SubgraphConfig { + class SNIPPETS_API SubgraphConfig { public: // True if Subgraph contains FakeQuantize -> FQ decomposition should be called bool m_is_quantized = false; @@ -242,7 +243,7 @@ class Subgraph : public ov::op::util::SubGraphOp { std::shared_ptr m_shape_infer = nullptr; - class OVShapeInfer : public ShapeInferSnippetsNode { + class SNIPPETS_API OVShapeInfer : public ShapeInferSnippetsNode { std::shared_ptr m_ov_body; public: diff --git a/src/common/snippets/include/snippets/op/vector_buffer.hpp b/src/common/snippets/include/snippets/op/vector_buffer.hpp index 36d9a8d9f5f728..3b84f38ce1b02d 100644 --- a/src/common/snippets/include/snippets/op/vector_buffer.hpp +++ b/src/common/snippets/include/snippets/op/vector_buffer.hpp @@ -11,6 +11,7 @@ #include "openvino/core/node_vector.hpp" #include "openvino/core/type/element_type.hpp" #include "openvino/op/op.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::op { @@ -19,7 +20,7 @@ namespace ov::snippets::op { * @brief The operation is for intermediate data storage in vector register * @ingroup snippets */ -class VectorBuffer : public ov::op::Op { +class SNIPPETS_API VectorBuffer : public ov::op::Op { public: OPENVINO_OP("VectorBuffer", "SnippetsOpset"); diff --git a/src/common/snippets/include/snippets/pass/align_element_types.hpp b/src/common/snippets/include/snippets/pass/align_element_types.hpp index 290d819fc6e17a..0170d35f5fae5b 100644 --- a/src/common/snippets/include/snippets/pass/align_element_types.hpp +++ b/src/common/snippets/include/snippets/pass/align_element_types.hpp @@ -10,6 +10,7 @@ #include "openvino/core/model.hpp" #include "openvino/core/type/element_type.hpp" #include "openvino/pass/pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -18,7 +19,7 @@ namespace ov::snippets::pass { * @brief Align body precision with expected input/output precision. Insert op::ConvertSaturation if necessary. * @ingroup snippets */ -class AlignElementTypes : public ov::pass::ModelPass { +class SNIPPETS_API AlignElementTypes : public ov::pass::ModelPass { public: OPENVINO_MODEL_PASS_RTTI("snippets::pass::AlignElementTypes"); AlignElementTypes(std::vector input_precisions, diff --git a/src/common/snippets/include/snippets/pass/analyze_broadcastable_inputs.hpp b/src/common/snippets/include/snippets/pass/analyze_broadcastable_inputs.hpp index 4502761c358ce6..1536314436defc 100644 --- a/src/common/snippets/include/snippets/pass/analyze_broadcastable_inputs.hpp +++ b/src/common/snippets/include/snippets/pass/analyze_broadcastable_inputs.hpp @@ -10,6 +10,7 @@ #include "openvino/core/model.hpp" #include "openvino/pass/pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -21,7 +22,7 @@ namespace ov::snippets::pass { * - Doesn't support `layouts` in PortDescriptors * @ingroup snippets */ -class AnalyzeBroadcastableInputs : public ov::pass::ModelPass { +class SNIPPETS_API AnalyzeBroadcastableInputs : public ov::pass::ModelPass { public: OPENVINO_MODEL_PASS_RTTI("snippets::pass::AnalyzeBroadcastableInputs"); // [Index of Parameter -> Index of broadcastable dimension from end] diff --git a/src/common/snippets/include/snippets/pass/broadcast_to_movebroadcast.hpp b/src/common/snippets/include/snippets/pass/broadcast_to_movebroadcast.hpp index e6e9be6142f3f6..949668a3ca6c7c 100644 --- a/src/common/snippets/include/snippets/pass/broadcast_to_movebroadcast.hpp +++ b/src/common/snippets/include/snippets/pass/broadcast_to_movebroadcast.hpp @@ -5,6 +5,7 @@ #pragma once #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -14,7 +15,7 @@ namespace ov::snippets::pass { * Broadcast. Otherwise the pass removes Broadcast operation. * @ingroup snippets */ -class BroadcastToMoveBroadcast : public ov::pass::MatcherPass { +class SNIPPETS_API BroadcastToMoveBroadcast : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::BroadcastToMoveBroadcast"); BroadcastToMoveBroadcast(); diff --git a/src/common/snippets/include/snippets/pass/canonicalization.hpp b/src/common/snippets/include/snippets/pass/canonicalization.hpp index 9dbd2d1f9633d2..78f94145866b51 100644 --- a/src/common/snippets/include/snippets/pass/canonicalization.hpp +++ b/src/common/snippets/include/snippets/pass/canonicalization.hpp @@ -12,6 +12,7 @@ #include "openvino/pass/pass.hpp" #include "snippets/op/subgraph.hpp" #include "snippets/shape_types.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -22,7 +23,7 @@ namespace ov::snippets::pass { * - layouts mismatch (only planar + blocked is supported), planar shapes are postpended with 1 * @ingroup snippets */ -class Canonicalization : public ov::pass::ModelPass { +class SNIPPETS_API Canonicalization : public ov::pass::ModelPass { public: OPENVINO_MODEL_PASS_RTTI("snippets::pass::Canonicalization"); using BlockedShapeVector = op::Subgraph::BlockedShapeVector; diff --git a/src/common/snippets/include/snippets/pass/collapse_subgraph.hpp b/src/common/snippets/include/snippets/pass/collapse_subgraph.hpp index 0806e52f208579..cee1246001a376 100644 --- a/src/common/snippets/include/snippets/pass/collapse_subgraph.hpp +++ b/src/common/snippets/include/snippets/pass/collapse_subgraph.hpp @@ -11,6 +11,7 @@ #include "openvino/core/type/element_type.hpp" #include "openvino/pass/matcher_pass.hpp" #include "snippets/pass/tokenization.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -38,7 +39,7 @@ namespace ov::snippets::pass { * Scalar constants are placed as is into subgraph due to optimization purpose * @ingroup snippets */ -class TokenizeSnippets : public ov::pass::MatcherPass { +class SNIPPETS_API TokenizeSnippets : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::TokenizeSnippets"); explicit TokenizeSnippets(const TokenizationConfig& config); diff --git a/src/common/snippets/include/snippets/pass/common_optimizations.hpp b/src/common/snippets/include/snippets/pass/common_optimizations.hpp index ebda54f9841384..84d50000ad941d 100644 --- a/src/common/snippets/include/snippets/pass/common_optimizations.hpp +++ b/src/common/snippets/include/snippets/pass/common_optimizations.hpp @@ -5,10 +5,11 @@ #pragma once #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { -class CommonOptimizations : public ov::pass::MatcherPass { +class SNIPPETS_API CommonOptimizations : public ov::pass::MatcherPass { class SubgraphPass; class SubgraphManager; friend class ExtractConstants; @@ -23,7 +24,7 @@ class CommonOptimizations : public ov::pass::MatcherPass { * @brief Configuration for CommonOptimizations pass * @ingroup snippets */ - struct Config { + struct SNIPPETS_API Config { Config(size_t concurrency, bool split_m_dimension) : m_concurrency(concurrency), m_split_m_dimension(split_m_dimension) { diff --git a/src/common/snippets/include/snippets/pass/convert_constants.hpp b/src/common/snippets/include/snippets/pass/convert_constants.hpp index 010cfac4bdf0ad..e16ff8b9d32c39 100644 --- a/src/common/snippets/include/snippets/pass/convert_constants.hpp +++ b/src/common/snippets/include/snippets/pass/convert_constants.hpp @@ -5,6 +5,7 @@ #pragma once #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -14,7 +15,7 @@ namespace ov::snippets::pass { * Only single-value (0D) constants are currently supported. * @ingroup snippets */ -class ConvertConstantsToScalars : public ov::pass::MatcherPass { +class SNIPPETS_API ConvertConstantsToScalars : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::ConvertConstantsToScalars"); ConvertConstantsToScalars(); diff --git a/src/common/snippets/include/snippets/pass/convert_power_to_powerstatic.hpp b/src/common/snippets/include/snippets/pass/convert_power_to_powerstatic.hpp index f74b65bff91cfb..41db04895dd4dc 100644 --- a/src/common/snippets/include/snippets/pass/convert_power_to_powerstatic.hpp +++ b/src/common/snippets/include/snippets/pass/convert_power_to_powerstatic.hpp @@ -5,6 +5,7 @@ #pragma once #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -13,7 +14,7 @@ namespace ov::snippets::pass { * @brief Replace Power with a scalar input with snippets::op::PowerStatic for generation of a more optimal code. * @ingroup snippets */ -class ConvertPowerToPowerStatic : public ov::pass::MatcherPass { +class SNIPPETS_API ConvertPowerToPowerStatic : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::ConvertPowerToPowerStatic"); ConvertPowerToPowerStatic(); diff --git a/src/common/snippets/include/snippets/pass/explicit_transpose_matmul_inputs.hpp b/src/common/snippets/include/snippets/pass/explicit_transpose_matmul_inputs.hpp index 845ecfe7dcb3d0..be9cb0d07b04c7 100644 --- a/src/common/snippets/include/snippets/pass/explicit_transpose_matmul_inputs.hpp +++ b/src/common/snippets/include/snippets/pass/explicit_transpose_matmul_inputs.hpp @@ -9,6 +9,7 @@ #include "openvino/core/node.hpp" #include "openvino/core/node_input.hpp" #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -25,7 +26,7 @@ namespace ov::snippets::pass { * which is supported by Snippets * @ingroup snippets */ -class ExplicitTransposeMatMulInputs : public ov::pass::MatcherPass { +class SNIPPETS_API ExplicitTransposeMatMulInputs : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::ExplicitTransposeMatMulInputs"); ExplicitTransposeMatMulInputs(); diff --git a/src/common/snippets/include/snippets/pass/extract_constants.hpp b/src/common/snippets/include/snippets/pass/extract_constants.hpp index d9662e82c138a8..bd0f3728ec2eab 100644 --- a/src/common/snippets/include/snippets/pass/extract_constants.hpp +++ b/src/common/snippets/include/snippets/pass/extract_constants.hpp @@ -9,6 +9,7 @@ #include "openvino/core/rtti.hpp" #include "snippets/op/subgraph.hpp" #include "snippets/pass/common_optimizations.hpp" +#include "snippets/snippets_visibility.hpp" #include "subgraph_pass.hpp" namespace ov::snippets::pass { @@ -19,7 +20,7 @@ namespace ov::snippets::pass { * inside body * @ingroup snippets */ -class ExtractConstants : public CommonOptimizations::SubgraphPass { +class SNIPPETS_API ExtractConstants : public CommonOptimizations::SubgraphPass { public: OPENVINO_RTTI("ExtractConstants", "0"); ExtractConstants() : SubgraphPass("ExtractConstants") {} diff --git a/src/common/snippets/include/snippets/pass/extract_reshapes_from_mha.hpp b/src/common/snippets/include/snippets/pass/extract_reshapes_from_mha.hpp index 8663d5c3afcad0..a8d788a3617a62 100644 --- a/src/common/snippets/include/snippets/pass/extract_reshapes_from_mha.hpp +++ b/src/common/snippets/include/snippets/pass/extract_reshapes_from_mha.hpp @@ -6,6 +6,7 @@ #include "openvino/pass/graph_rewrite.hpp" #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -28,7 +29,7 @@ namespace ov::snippets::pass { * * @ingroup snippets */ -class ExtractPairsAfterMatmul : public ov::pass::MatcherPass { +class SNIPPETS_API ExtractPairsAfterMatmul : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::ExtractPairsAfterMatmul"); ExtractPairsAfterMatmul(); @@ -55,13 +56,13 @@ class ExtractPairsAfterMatmul : public ov::pass::MatcherPass { * * @ingroup snippets */ -class RankUpgradeToRankReduction : public ov::pass::MatcherPass { +class SNIPPETS_API RankUpgradeToRankReduction : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::RankUpgradeToRankReduction"); RankUpgradeToRankReduction(); }; -class ExtractReshapesFromMHA : public ov::pass::GraphRewrite { +class SNIPPETS_API ExtractReshapesFromMHA : public ov::pass::GraphRewrite { public: OPENVINO_GRAPH_REWRITE_RTTI("ExtractReshapesFromMHA"); ExtractReshapesFromMHA() { diff --git a/src/common/snippets/include/snippets/pass/extract_unsupported_transposes.hpp b/src/common/snippets/include/snippets/pass/extract_unsupported_transposes.hpp index 59862292f08f14..de128cddb28101 100644 --- a/src/common/snippets/include/snippets/pass/extract_unsupported_transposes.hpp +++ b/src/common/snippets/include/snippets/pass/extract_unsupported_transposes.hpp @@ -9,6 +9,7 @@ #include "openvino/core/rtti.hpp" #include "snippets/op/subgraph.hpp" #include "snippets/pass/common_optimizations.hpp" +#include "snippets/snippets_visibility.hpp" #include "subgraph_pass.hpp" namespace ov::snippets::pass { @@ -18,7 +19,7 @@ namespace ov::snippets::pass { * @brief Moves up unsupported Transposes on Parameter outputs from body * @ingroup snippets */ -class ExtractUnsupportedTransposes : public CommonOptimizations::SubgraphPass { +class SNIPPETS_API ExtractUnsupportedTransposes : public CommonOptimizations::SubgraphPass { public: OPENVINO_RTTI("ExtractUnsupportedTransposes", "0"); ExtractUnsupportedTransposes() : SubgraphPass("ExtractUnsupportedTransposes") {} diff --git a/src/common/snippets/include/snippets/pass/fc_tokenization.hpp b/src/common/snippets/include/snippets/pass/fc_tokenization.hpp index 2c1ea706b9bdca..8bf5ea7d485637 100644 --- a/src/common/snippets/include/snippets/pass/fc_tokenization.hpp +++ b/src/common/snippets/include/snippets/pass/fc_tokenization.hpp @@ -6,6 +6,7 @@ #include "openvino/pass/matcher_pass.hpp" #include "snippets/pass/tokenization.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -14,7 +15,7 @@ namespace ov::snippets::pass { * @brief The pass tokenizes FullyConnected like (with constant path on B input) MatMuls * @ingroup snippets */ -class TokenizeFCSnippets : public ov::pass::MatcherPass { +class SNIPPETS_API TokenizeFCSnippets : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::TokenizeFCSnippets"); explicit TokenizeFCSnippets(const TokenizationConfig& config); diff --git a/src/common/snippets/include/snippets/pass/fq_decomposition.hpp b/src/common/snippets/include/snippets/pass/fq_decomposition.hpp index 8f2ba86c83e1aa..6f602b029324b6 100644 --- a/src/common/snippets/include/snippets/pass/fq_decomposition.hpp +++ b/src/common/snippets/include/snippets/pass/fq_decomposition.hpp @@ -12,6 +12,7 @@ #include "openvino/op/fake_quantize.hpp" #include "openvino/pass/matcher_pass.hpp" #include "openvino/pass/pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -52,7 +53,7 @@ namespace ov::snippets::pass { * */ -class FakeQuantizeDecomposition : public ov::pass::MatcherPass { +class SNIPPETS_API FakeQuantizeDecomposition : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::FakeQuantizeDecomposition"); FakeQuantizeDecomposition(); @@ -83,7 +84,7 @@ class FakeQuantizeDecomposition : public ov::pass::MatcherPass { * 2. ConstantFolding * 3. Validate */ -class CommonFakeQuantizeDecomposition : public ov::pass::ModelPass { +class SNIPPETS_API CommonFakeQuantizeDecomposition : public ov::pass::ModelPass { public: OPENVINO_MODEL_PASS_RTTI("snippets::pass::CommonFakeQuantizeDecomposition"); diff --git a/src/common/snippets/include/snippets/pass/fuse_transpose_brgemm.hpp b/src/common/snippets/include/snippets/pass/fuse_transpose_brgemm.hpp index 0db79d553198fe..f9e37b03d3f700 100644 --- a/src/common/snippets/include/snippets/pass/fuse_transpose_brgemm.hpp +++ b/src/common/snippets/include/snippets/pass/fuse_transpose_brgemm.hpp @@ -10,6 +10,7 @@ #include "openvino/core/node.hpp" #include "openvino/core/node_output.hpp" #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -21,7 +22,7 @@ namespace ov::snippets::pass { * moved. * @ingroup snippets */ -class FuseTransposeBrgemm : public ov::pass::MatcherPass { +class SNIPPETS_API FuseTransposeBrgemm : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::FuseTransposeBrgemm"); FuseTransposeBrgemm(); diff --git a/src/common/snippets/include/snippets/pass/gated_mlp_tokenization.hpp b/src/common/snippets/include/snippets/pass/gated_mlp_tokenization.hpp index c84d85e3051b98..4ef908f4d6b96c 100644 --- a/src/common/snippets/include/snippets/pass/gated_mlp_tokenization.hpp +++ b/src/common/snippets/include/snippets/pass/gated_mlp_tokenization.hpp @@ -6,6 +6,7 @@ #include "openvino/pass/matcher_pass.hpp" #include "snippets/pass/tokenization.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -24,7 +25,7 @@ namespace ov::snippets::pass { * FullyConnected * @ingroup snippets */ -class TokenizeGatedMLPSnippets : public ov::pass::MatcherPass { +class SNIPPETS_API TokenizeGatedMLPSnippets : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::TokenizeGatedMLPSnippets"); explicit TokenizeGatedMLPSnippets(const TokenizationConfig& config); diff --git a/src/common/snippets/include/snippets/pass/gn_decomposition.hpp b/src/common/snippets/include/snippets/pass/gn_decomposition.hpp index 05f632fa769500..83f100d926328c 100644 --- a/src/common/snippets/include/snippets/pass/gn_decomposition.hpp +++ b/src/common/snippets/include/snippets/pass/gn_decomposition.hpp @@ -5,6 +5,7 @@ #pragma once #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -13,7 +14,7 @@ namespace ov::snippets::pass { * @brief Decomposes GroupNormalization to a range of low-level operations * @ingroup snippets */ -class GNDecomposition : public ov::pass::MatcherPass { +class SNIPPETS_API GNDecomposition : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::GNDecomposition"); GNDecomposition(); diff --git a/src/common/snippets/include/snippets/pass/gn_tokenization.hpp b/src/common/snippets/include/snippets/pass/gn_tokenization.hpp index 5ae0145b485b42..f21fee6b5da575 100644 --- a/src/common/snippets/include/snippets/pass/gn_tokenization.hpp +++ b/src/common/snippets/include/snippets/pass/gn_tokenization.hpp @@ -5,6 +5,7 @@ #pragma once #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -13,7 +14,7 @@ namespace ov::snippets::pass { * @brief Tokenize GroupNormalization to a subgraph * @ingroup snippets */ -class TokenizeGNSnippets : public ov::pass::MatcherPass { +class SNIPPETS_API TokenizeGNSnippets : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::TokenizeGNSnippets"); TokenizeGNSnippets(); diff --git a/src/common/snippets/include/snippets/pass/hash.hpp b/src/common/snippets/include/snippets/pass/hash.hpp index f3c0d55e4393c7..9292ede84d5aa7 100644 --- a/src/common/snippets/include/snippets/pass/hash.hpp +++ b/src/common/snippets/include/snippets/pass/hash.hpp @@ -9,6 +9,7 @@ #include #include "openvino/core/model.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -16,7 +17,7 @@ namespace ov::snippets::pass { * @brief Hash transformation calculates hash value for snippets. Don't care about names as no difference from execution * perspective */ -class Hash : public ov::pass::ModelPass { +class SNIPPETS_API Hash : public ov::pass::ModelPass { public: OPENVINO_MODEL_PASS_RTTI("snippets::pass::Hash"); diff --git a/src/common/snippets/include/snippets/pass/manager.hpp b/src/common/snippets/include/snippets/pass/manager.hpp index c7c6758e132108..883c387f286a4a 100644 --- a/src/common/snippets/include/snippets/pass/manager.hpp +++ b/src/common/snippets/include/snippets/pass/manager.hpp @@ -14,6 +14,7 @@ #include "openvino/pass/pass_config.hpp" #include "openvino/pass/validate.hpp" #include "positioned_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -21,7 +22,7 @@ namespace ov::snippets::pass { * @brief Manager is like ov::pass::Manager, but allows to insert new passes at arbitrary places in the pipeline * @ingroup snippets */ -class Manager : public ov::pass::Manager { +class SNIPPETS_API Manager : public ov::pass::Manager { public: explicit Manager(std::shared_ptr pass_config = std::make_shared(), std::string name = "UnnamedSnippetsManager"); diff --git a/src/common/snippets/include/snippets/pass/matmul_to_brgemm.hpp b/src/common/snippets/include/snippets/pass/matmul_to_brgemm.hpp index cc514e62a39eb9..3cda54ee8027e1 100644 --- a/src/common/snippets/include/snippets/pass/matmul_to_brgemm.hpp +++ b/src/common/snippets/include/snippets/pass/matmul_to_brgemm.hpp @@ -5,6 +5,7 @@ #pragma once #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -13,7 +14,7 @@ namespace ov::snippets::pass { * @brief Replaces ov::MatMul with snippets::op::Brgemm operation (only non-trasposing MatMuls are currently supported) * @ingroup snippets */ -class MatMulToBrgemm : public ov::pass::MatcherPass { +class SNIPPETS_API MatMulToBrgemm : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::MatMulToBrgemm"); MatMulToBrgemm(); diff --git a/src/common/snippets/include/snippets/pass/mha_tokenization.hpp b/src/common/snippets/include/snippets/pass/mha_tokenization.hpp index 9d2de5286b5725..d40303568a95b8 100644 --- a/src/common/snippets/include/snippets/pass/mha_tokenization.hpp +++ b/src/common/snippets/include/snippets/pass/mha_tokenization.hpp @@ -12,6 +12,7 @@ #include "openvino/opsets/opset1.hpp" #include "openvino/pass/matcher_pass.hpp" #include "snippets/pass/tokenization_config.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -42,7 +43,7 @@ namespace ov::snippets::pass { * * After MatMul1 may be only Transpose3 or any count of Eltwise, Select ops. * @ingroup snippets */ -class TokenizeMHASnippets : public ov::pass::MatcherPass { +class SNIPPETS_API TokenizeMHASnippets : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::TokenizeMHASnippets"); @@ -51,7 +52,7 @@ class TokenizeMHASnippets : public ov::pass::MatcherPass { * @brief Configuration for TokenizeMHASnippets pass * @ingroup snippets */ - struct Config : public TokenizationConfig { + struct SNIPPETS_API Config : public TokenizationConfig { Config(const TokenizationConfig& tokenization_config, bool enable_transpose_on_output, bool dyn_mha_token, diff --git a/src/common/snippets/include/snippets/pass/mlp_seq_tokenization.hpp b/src/common/snippets/include/snippets/pass/mlp_seq_tokenization.hpp index 8483d537c83e9d..3e6f30250a8b1c 100644 --- a/src/common/snippets/include/snippets/pass/mlp_seq_tokenization.hpp +++ b/src/common/snippets/include/snippets/pass/mlp_seq_tokenization.hpp @@ -13,6 +13,7 @@ #include "openvino/op/matmul.hpp" #include "openvino/pass/matcher_pass.hpp" #include "snippets/pass/tokenization_config.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -31,7 +32,7 @@ namespace ov::snippets::pass { * ... * @ingroup snippets */ -class TokenizeMLPSeqSnippets : public ov::pass::MatcherPass { +class SNIPPETS_API TokenizeMLPSeqSnippets : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::TokenizeMLPSeqSnippets"); @@ -40,7 +41,7 @@ class TokenizeMLPSeqSnippets : public ov::pass::MatcherPass { * @brief Configuration for TokenizeMLPSeqSnippets pass * @ingroup snippets */ - struct Config : public TokenizationConfig { + struct SNIPPETS_API Config : public TokenizationConfig { using CanBeFusedAsPostOpPred = std::function&, const std::shared_ptr&)>; diff --git a/src/common/snippets/include/snippets/pass/online_softmax_decomposition.hpp b/src/common/snippets/include/snippets/pass/online_softmax_decomposition.hpp index e0440bab13bafd..f7415edbddbfb0 100644 --- a/src/common/snippets/include/snippets/pass/online_softmax_decomposition.hpp +++ b/src/common/snippets/include/snippets/pass/online_softmax_decomposition.hpp @@ -5,6 +5,7 @@ #pragma once #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -37,7 +38,7 @@ namespace ov::snippets::pass { * | * Result0 */ -class OnlineSoftmaxDecomposition : public ov::pass::MatcherPass { +class SNIPPETS_API OnlineSoftmaxDecomposition : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::OnlineSoftmaxDecomposition"); OnlineSoftmaxDecomposition(); diff --git a/src/common/snippets/include/snippets/pass/positioned_pass.hpp b/src/common/snippets/include/snippets/pass/positioned_pass.hpp index d633320819a95d..13171fabae6d37 100644 --- a/src/common/snippets/include/snippets/pass/positioned_pass.hpp +++ b/src/common/snippets/include/snippets/pass/positioned_pass.hpp @@ -13,6 +13,7 @@ #include "openvino/core/except.hpp" #include "openvino/core/type.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -29,7 +30,7 @@ namespace ov::snippets::pass { * 0 (default) means the first pass with `pass_name` will be considered as the anchor pass. * @ingroup snippets */ -class PassPosition { +class SNIPPETS_API PassPosition { public: enum class Place : uint8_t { Before, After, PipelineStart, PipelineEnd }; @@ -47,7 +48,7 @@ class PassPosition { }; template -struct PositionedPass { +struct SNIPPETS_API PositionedPass { PositionedPass(PassPosition arg_pos, std::shared_ptr arg_pass) : position(std::move(arg_pos)), pass(std::move(arg_pass)) {} diff --git a/src/common/snippets/include/snippets/pass/propagate_precision.hpp b/src/common/snippets/include/snippets/pass/propagate_precision.hpp index acc795c95db6da..8705144419662b 100644 --- a/src/common/snippets/include/snippets/pass/propagate_precision.hpp +++ b/src/common/snippets/include/snippets/pass/propagate_precision.hpp @@ -12,6 +12,7 @@ #include "openvino/core/node.hpp" #include "openvino/core/type/element_type.hpp" #include "openvino/pass/pass.hpp" +#include "snippets/snippets_visibility.hpp" #include "snippets/target_machine.hpp" namespace ov::snippets::pass { @@ -21,7 +22,7 @@ namespace ov::snippets::pass { * @ingroup snippets * @brief PropagatePrecision transformation propagate precision from parameters to results. */ -class PropagatePrecision : public ov::pass::ModelPass { +class SNIPPETS_API PropagatePrecision : public ov::pass::ModelPass { public: OPENVINO_MODEL_PASS_RTTI("snippets::pass::PropagatePrecision"); explicit PropagatePrecision(const std::shared_ptr& target_machine); diff --git a/src/common/snippets/include/snippets/pass/reduce_to_snippets_reduce.hpp b/src/common/snippets/include/snippets/pass/reduce_to_snippets_reduce.hpp index 4fa1b628bc3f2d..03604f5b13478c 100644 --- a/src/common/snippets/include/snippets/pass/reduce_to_snippets_reduce.hpp +++ b/src/common/snippets/include/snippets/pass/reduce_to_snippets_reduce.hpp @@ -5,6 +5,7 @@ #pragma once #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -14,7 +15,7 @@ namespace ov::snippets::pass { * Also checks that reduction operation is supported by snippets. * @ingroup snippets */ -class ReduceToSnippetsReduce : public ov::pass::MatcherPass { +class SNIPPETS_API ReduceToSnippetsReduce : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::ReduceToSnippetsReduce"); ReduceToSnippetsReduce(); diff --git a/src/common/snippets/include/snippets/pass/softmax_decomposition.hpp b/src/common/snippets/include/snippets/pass/softmax_decomposition.hpp index 8ac6de14f02ed5..0cb2c2ff1cad45 100644 --- a/src/common/snippets/include/snippets/pass/softmax_decomposition.hpp +++ b/src/common/snippets/include/snippets/pass/softmax_decomposition.hpp @@ -5,6 +5,7 @@ #pragma once #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -13,7 +14,7 @@ namespace ov::snippets::pass { * @brief Decomposes Softmax to a range of low-level operations * @ingroup snippets */ -class SoftmaxDecomposition : public ov::pass::MatcherPass { +class SNIPPETS_API SoftmaxDecomposition : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::SoftmaxDecomposition"); SoftmaxDecomposition(); diff --git a/src/common/snippets/include/snippets/pass/softmax_reshape_elimination.hpp b/src/common/snippets/include/snippets/pass/softmax_reshape_elimination.hpp index 5e7233c8b1b798..437874b1429059 100644 --- a/src/common/snippets/include/snippets/pass/softmax_reshape_elimination.hpp +++ b/src/common/snippets/include/snippets/pass/softmax_reshape_elimination.hpp @@ -5,6 +5,7 @@ #pragma once #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -13,7 +14,7 @@ namespace ov::snippets::pass { * @brief The pass removes Reshape operations around Softmax if possible * @ingroup snippets */ -class SoftmaxReshapeElimination : public ov::pass::MatcherPass { +class SNIPPETS_API SoftmaxReshapeElimination : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::SoftmaxReshapeElimination"); SoftmaxReshapeElimination(); diff --git a/src/common/snippets/include/snippets/pass/split_dimension_m.hpp b/src/common/snippets/include/snippets/pass/split_dimension_m.hpp index cc642ae29d496f..93a467007953c0 100644 --- a/src/common/snippets/include/snippets/pass/split_dimension_m.hpp +++ b/src/common/snippets/include/snippets/pass/split_dimension_m.hpp @@ -16,6 +16,7 @@ #include "snippets/op/subgraph.hpp" #include "snippets/pass/common_optimizations.hpp" #include "snippets/shape_types.hpp" +#include "snippets/snippets_visibility.hpp" #include "subgraph_pass.hpp" namespace ov::snippets::pass { @@ -29,7 +30,7 @@ namespace ov::snippets::pass { * @todo Ticket 148805: Move static cases handling in RuntimeConfigurator as well. * @ingroup snippets */ -class SplitDimensionM : public CommonOptimizations::SubgraphPass { +class SNIPPETS_API SplitDimensionM : public CommonOptimizations::SubgraphPass { public: OPENVINO_RTTI("SplitDimensionM", "0"); explicit SplitDimensionM(size_t concurrency) : SubgraphPass("SplitDimensionM"), m_concurrency(concurrency) {} diff --git a/src/common/snippets/include/snippets/pass/subgraph_manager.hpp b/src/common/snippets/include/snippets/pass/subgraph_manager.hpp index 76fdde2282dfd7..530c1677ed1153 100644 --- a/src/common/snippets/include/snippets/pass/subgraph_manager.hpp +++ b/src/common/snippets/include/snippets/pass/subgraph_manager.hpp @@ -11,6 +11,7 @@ #include "snippets/op/subgraph.hpp" #include "snippets/pass/common_optimizations.hpp" #include "snippets/pass/subgraph_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { /** @@ -20,7 +21,7 @@ namespace ov::snippets::pass { * node in model. * @ingroup snippets */ -class CommonOptimizations::SubgraphManager { +class SNIPPETS_API CommonOptimizations::SubgraphManager { public: SubgraphManager() = default; diff --git a/src/common/snippets/include/snippets/pass/subgraph_pass.hpp b/src/common/snippets/include/snippets/pass/subgraph_pass.hpp index 7f06d1cd7df74a..7506583fe80df6 100644 --- a/src/common/snippets/include/snippets/pass/subgraph_pass.hpp +++ b/src/common/snippets/include/snippets/pass/subgraph_pass.hpp @@ -10,6 +10,7 @@ #include "openvino/core/type.hpp" #include "snippets/op/subgraph.hpp" #include "snippets/pass/common_optimizations.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -22,7 +23,7 @@ namespace ov::snippets::pass { * registration to ov::Model * @ingroup snippets */ -class CommonOptimizations::SubgraphPass { +class SNIPPETS_API CommonOptimizations::SubgraphPass { public: SubgraphPass() = delete; explicit SubgraphPass(std::string name) : m_name(std::move(name)) {} diff --git a/src/common/snippets/include/snippets/pass/tokenization.hpp b/src/common/snippets/include/snippets/pass/tokenization.hpp index 701bba13522e37..4787da64e66ba4 100644 --- a/src/common/snippets/include/snippets/pass/tokenization.hpp +++ b/src/common/snippets/include/snippets/pass/tokenization.hpp @@ -21,6 +21,7 @@ #include "snippets/pass/mha_tokenization.hpp" #include "snippets/pass/mlp_seq_tokenization.hpp" #include "snippets/pass/tokenization_config.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -36,19 +37,19 @@ enum class SnippetsNodeType : uint8_t { NotSet, SkippedByPlugin }; It's used in separate tokenization pass, for example, tokenization by matcher (MHA Tokenization). */ enum class SnippetsSubgraphType : uint8_t { NotSet, Completed }; -void SetSnippetsNodeType(const std::shared_ptr& node, SnippetsNodeType nodeType); -void SetSnippetsSubgraphType(const std::shared_ptr& node, SnippetsSubgraphType nodeType); -SnippetsNodeType GetSnippetsNodeType(const std::shared_ptr& node); -SnippetsSubgraphType GetSnippetsSubgraphType(const std::shared_ptr& node); -void SetTopologicalOrder(const std::shared_ptr& node, int64_t order); -int64_t GetTopologicalOrder(const std::shared_ptr& node); +SNIPPETS_API void SetSnippetsNodeType(const std::shared_ptr& node, SnippetsNodeType nodeType); +SNIPPETS_API void SetSnippetsSubgraphType(const std::shared_ptr& node, SnippetsSubgraphType nodeType); +SNIPPETS_API SnippetsNodeType GetSnippetsNodeType(const std::shared_ptr& node); +SNIPPETS_API SnippetsSubgraphType GetSnippetsSubgraphType(const std::shared_ptr& node); +SNIPPETS_API void SetTopologicalOrder(const std::shared_ptr& node, int64_t order); +SNIPPETS_API int64_t GetTopologicalOrder(const std::shared_ptr& node); /** * @interface EnumerateNodes * @brief Snippets rely on topological order to avoid creating cyclic dependencies. This transformation sets the order. * @ingroup snippets */ -class EnumerateNodes : public ov::pass::ModelPass { +class SNIPPETS_API EnumerateNodes : public ov::pass::ModelPass { public: OPENVINO_MODEL_PASS_RTTI("snippets::pass::EnumerateNodes"); EnumerateNodes() : ModelPass() {} @@ -70,7 +71,7 @@ class EnumerateNodes : public ov::pass::ModelPass { * "_original". * @ingroup snippets */ -class SnippetsTokenization : public ov::pass::ModelPass { +class SNIPPETS_API SnippetsTokenization : public ov::pass::ModelPass { public: OPENVINO_MODEL_PASS_RTTI("snippets::pass::SnippetsTokenization"); diff --git a/src/common/snippets/include/snippets/pass/tokenization_config.hpp b/src/common/snippets/include/snippets/pass/tokenization_config.hpp index 7009cb1661fa9c..e8b94203394914 100644 --- a/src/common/snippets/include/snippets/pass/tokenization_config.hpp +++ b/src/common/snippets/include/snippets/pass/tokenization_config.hpp @@ -7,6 +7,7 @@ #include #include "openvino/core/except.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -15,7 +16,7 @@ namespace ov::snippets::pass { * @brief Base configuration for tokenization passes containing common GPR management logic * @ingroup snippets */ -struct TokenizationConfig { +struct SNIPPETS_API TokenizationConfig { explicit TokenizationConfig(size_t available_gprs_count) : m_available_gprs_count(available_gprs_count) { OPENVINO_ASSERT(available_gprs_count > 0, "available_gprs_count should be greater than 0"); } diff --git a/src/common/snippets/include/snippets/pass/transform_convert.hpp b/src/common/snippets/include/snippets/pass/transform_convert.hpp index 40ac95cc89cc00..6a0e5093d0860b 100644 --- a/src/common/snippets/include/snippets/pass/transform_convert.hpp +++ b/src/common/snippets/include/snippets/pass/transform_convert.hpp @@ -5,6 +5,7 @@ #pragma once #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -15,7 +16,7 @@ namespace ov::snippets::pass { * This op is used for real Convert ops inside subgraph body in CPU Plugin * @ingroup snippets */ -class TransformConvertToConvertTruncation : public ov::pass::MatcherPass { +class SNIPPETS_API TransformConvertToConvertTruncation : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::TransformConvertToConvertTruncation"); TransformConvertToConvertTruncation(); diff --git a/src/common/snippets/include/snippets/pass/transpose_decomposition.hpp b/src/common/snippets/include/snippets/pass/transpose_decomposition.hpp index d5375e80b32e45..f6fc50fbdf30c0 100644 --- a/src/common/snippets/include/snippets/pass/transpose_decomposition.hpp +++ b/src/common/snippets/include/snippets/pass/transpose_decomposition.hpp @@ -10,6 +10,7 @@ #include "openvino/core/node.hpp" #include "openvino/core/node_output.hpp" #include "openvino/pass/matcher_pass.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -18,7 +19,7 @@ namespace ov::snippets::pass { * @brief Decompose Transpose to Load + Store wrapped in several loops. * @ingroup snippets */ -class TransposeDecomposition : public ov::pass::MatcherPass { +class SNIPPETS_API TransposeDecomposition : public ov::pass::MatcherPass { public: OPENVINO_MATCHER_PASS_RTTI("snippets::pass::TransposeDecomposition"); TransposeDecomposition(); diff --git a/src/common/snippets/include/snippets/pass/validate.hpp b/src/common/snippets/include/snippets/pass/validate.hpp index 08f808e1367411..4c09868a20b50a 100644 --- a/src/common/snippets/include/snippets/pass/validate.hpp +++ b/src/common/snippets/include/snippets/pass/validate.hpp @@ -10,6 +10,7 @@ #include "openvino/core/node.hpp" #include "openvino/pass/pass.hpp" #include "openvino/pass/pass_config.hpp" +#include "snippets/snippets_visibility.hpp" namespace ov::snippets::pass { @@ -18,7 +19,7 @@ namespace ov::snippets::pass { * @brief The pass validates OV model on correctness after all common optimizations * @ingroup snippets */ -class Validate : public ov::pass::ModelPass { +class SNIPPETS_API Validate : public ov::pass::ModelPass { public: OPENVINO_MODEL_PASS_RTTI("snippets::pass::Validate"); explicit Validate(const std::shared_ptr& pass_config) : m_pass_config(pass_config) {} diff --git a/src/common/snippets/include/snippets/snippets_visibility.hpp b/src/common/snippets/include/snippets/snippets_visibility.hpp new file mode 100644 index 00000000000000..0a8d1cf4349572 --- /dev/null +++ b/src/common/snippets/include/snippets/snippets_visibility.hpp @@ -0,0 +1,22 @@ +// Copyright (C) 2018-2025 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/core/visibility.hpp" + +/** + * @file snippets_visibility.hpp + * @brief Defines visibility settings for OpenVINO Snippets library + */ + +#ifdef OPENVINO_STATIC_LIBRARY +# define SNIPPETS_API +#else +# ifdef IMPLEMENT_OPENVINO_API +# define SNIPPETS_API OPENVINO_CORE_EXPORTS +# else +# define SNIPPETS_API OPENVINO_CORE_IMPORTS +# endif // IMPLEMENT_OPENVINO_API +#endif // OPENVINO_STATIC_LIBRARY From 75df1ad26c06870be7a49eb9bdc11b976fdddfe9 Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Wed, 8 Oct 2025 15:39:48 +0200 Subject: [PATCH 2/4] win wa --- src/common/snippets/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/snippets/CMakeLists.txt b/src/common/snippets/CMakeLists.txt index b121e16a719535..03bc35da58b051 100644 --- a/src/common/snippets/CMakeLists.txt +++ b/src/common/snippets/CMakeLists.txt @@ -9,6 +9,11 @@ set(PUBLIC_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include") file(GLOB_RECURSE LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) file(GLOB_RECURSE PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp) +# TODO: Fix MSVC inconsistent dll linkage warning suppression +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + ov_add_compiler_flags(/wd4273) +endif() + # Create named folders for the sources within the .vcproj # Empty name lists them directly under the .vcproj From e330258e00c77908f9c1557fe4ed987007e6e533 Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Wed, 8 Oct 2025 16:19:45 +0200 Subject: [PATCH 3/4] static variables fix --- .../snippets/include/snippets/pass/mlp_seq_tokenization.hpp | 2 +- .../snippets/include/snippets/pass/split_dimension_m.hpp | 4 ++-- src/common/snippets/src/pass/mlp_seq_tokenization.cpp | 2 -- src/common/snippets/src/pass/split_dimension_m.cpp | 3 --- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/common/snippets/include/snippets/pass/mlp_seq_tokenization.hpp b/src/common/snippets/include/snippets/pass/mlp_seq_tokenization.hpp index 3e6f30250a8b1c..f561880790fb70 100644 --- a/src/common/snippets/include/snippets/pass/mlp_seq_tokenization.hpp +++ b/src/common/snippets/include/snippets/pass/mlp_seq_tokenization.hpp @@ -73,7 +73,7 @@ class SNIPPETS_API TokenizeMLPSeqSnippets : public ov::pass::MatcherPass { static bool is_supported_intermediate_op(const std::shared_ptr& node); static bool is_tensor_supported(const ov::descriptor::Tensor& t); - static const size_t m_rank; + static constexpr size_t m_rank = 2; }; } // namespace ov::snippets::pass diff --git a/src/common/snippets/include/snippets/pass/split_dimension_m.hpp b/src/common/snippets/include/snippets/pass/split_dimension_m.hpp index 93a467007953c0..bcc4b2af7f3290 100644 --- a/src/common/snippets/include/snippets/pass/split_dimension_m.hpp +++ b/src/common/snippets/include/snippets/pass/split_dimension_m.hpp @@ -119,7 +119,7 @@ class SNIPPETS_API SplitDimensionM : public CommonOptimizations::SubgraphPass { size_t m_concurrency; - static const size_t min_kernel_m; - static const size_t dim_M_index; + static constexpr size_t min_kernel_m = 32; + static constexpr size_t dim_M_index = 1; }; } // namespace ov::snippets::pass diff --git a/src/common/snippets/src/pass/mlp_seq_tokenization.cpp b/src/common/snippets/src/pass/mlp_seq_tokenization.cpp index 9a0803537d9a82..4762e5059b2d6a 100644 --- a/src/common/snippets/src/pass/mlp_seq_tokenization.cpp +++ b/src/common/snippets/src/pass/mlp_seq_tokenization.cpp @@ -41,8 +41,6 @@ inline bool has_one_consumer(const std::shared_ptr& node) { } } // namespace -const size_t TokenizeMLPSeqSnippets::m_rank = 2; - bool TokenizeMLPSeqSnippets::is_tensor_supported(const ov::descriptor::Tensor& t) { return t.get_partial_shape().rank().is_static() && t.get_partial_shape().size() <= m_rank; } diff --git a/src/common/snippets/src/pass/split_dimension_m.cpp b/src/common/snippets/src/pass/split_dimension_m.cpp index 3da37524875177..f0fedc7e3d9746 100644 --- a/src/common/snippets/src/pass/split_dimension_m.cpp +++ b/src/common/snippets/src/pass/split_dimension_m.cpp @@ -54,9 +54,6 @@ bool is_prime_number(size_t value) { namespace ov::snippets::pass { -const size_t SplitDimensionM::min_kernel_m = 32; -const size_t SplitDimensionM::dim_M_index = 1; - bool SplitDimensionM::is_supported_matmul(const std::shared_ptr& node) { const auto matmul = ov::as_type_ptr(node); return matmul && !matmul->get_transpose_a() && !matmul->is_dynamic(); From bf9fdfbe30c3000bb44769cc05d3686a97f1a5bf Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Thu, 9 Oct 2025 09:17:46 +0200 Subject: [PATCH 4/4] win wa 2 --- src/common/snippets/CMakeLists.txt | 5 ----- src/common/snippets/include/snippets/snippets_visibility.hpp | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/common/snippets/CMakeLists.txt b/src/common/snippets/CMakeLists.txt index 03bc35da58b051..b121e16a719535 100644 --- a/src/common/snippets/CMakeLists.txt +++ b/src/common/snippets/CMakeLists.txt @@ -9,11 +9,6 @@ set(PUBLIC_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include") file(GLOB_RECURSE LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) file(GLOB_RECURSE PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp) -# TODO: Fix MSVC inconsistent dll linkage warning suppression -if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - ov_add_compiler_flags(/wd4273) -endif() - # Create named folders for the sources within the .vcproj # Empty name lists them directly under the .vcproj diff --git a/src/common/snippets/include/snippets/snippets_visibility.hpp b/src/common/snippets/include/snippets/snippets_visibility.hpp index 0a8d1cf4349572..3cf872a940654d 100644 --- a/src/common/snippets/include/snippets/snippets_visibility.hpp +++ b/src/common/snippets/include/snippets/snippets_visibility.hpp @@ -11,7 +11,7 @@ * @brief Defines visibility settings for OpenVINO Snippets library */ -#ifdef OPENVINO_STATIC_LIBRARY +#if defined(OPENVINO_STATIC_LIBRARY) || defined(_WIN32) # define SNIPPETS_API #else # ifdef IMPLEMENT_OPENVINO_API