Skip to content

Commit

Permalink
Added group for transformation passes
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyachur committed Mar 21, 2022
1 parent 2bf0c8a commit e731a4b
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/core/include/openvino/core/core_visibility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
* @ingroup ov_cpp_api
* OpenVINO C++ API to work with operation sets
*
* @defgroup ov_pass_cpp_api Transformation passes
* @ingroup ov_cpp_api
* OpenVINO C++ API to work with OpenVINO transformations
*
* @defgroup ov_runtime_cpp_api Inference
* @ingroup ov_cpp_api
* OpenVINO Inference C++ API provides ov::Core, ov::CompiledModel, ov::InferRequest
Expand Down
2 changes: 2 additions & 0 deletions src/core/include/openvino/pass/constant_folding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace pass {
* @brief Constant folding iterates over the function and tries to evaluate nodes
* with constant inputs. Such nodes are then replaced with new Constants containing
* the result of a folded operation.
* @ingroup ov_pass_cpp_api
*/
class OPENVINO_API ConstantFolding : public ModelPass {
public:
Expand All @@ -36,6 +37,7 @@ class OPENVINO_API ConstantFolding : public ModelPass {
* consumer)
* 2. If node with disable_constant_folding was replaced with another node, the attribute will be lost because
* it is not copyable.
* @ingroup ov_pass_cpp_api
*/
OPENVINO_API void disable_constant_folding(const std::shared_ptr<Node>& node);

Expand Down
4 changes: 4 additions & 0 deletions src/core/include/openvino/pass/convert_fp32_to_fp16.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

namespace ov {
namespace pass {
/**
* @brief ConvertFP32ToFP16 transformation
* @ingroup ov_pass_cpp_api
*/
class OPENVINO_API ConvertFP32ToFP16 : public ModelPass {
public:
OPENVINO_RTTI("ConvertFP32ToFP16");
Expand Down
4 changes: 2 additions & 2 deletions src/core/include/openvino/pass/graph_rewrite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace pass {
/// or has ov::pass::pattern::op::WrapType. That will help GraphRewrite to execute matcher
/// passes more
/// efficient.

/// \ingroup ov_pass_cpp_api
class OPENVINO_API MatcherPass : public PassBase {
public:
OPENVINO_RTTI("ov::pass::MatcherPass");
Expand Down Expand Up @@ -116,7 +116,7 @@ class OPENVINO_API MatcherPass : public PassBase {
/// or has ov::pattern::op::WrapType. That will help GraphRewrite to execute matcher
/// passes more
/// efficient.

/// \ingroup ov_pass_cpp_api
class OPENVINO_API GraphRewrite : public ModelPass {
public:
OPENVINO_RTTI("ov::pass::GraphRewrite");
Expand Down
1 change: 1 addition & 0 deletions src/core/include/openvino/pass/low_latency.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace pass {
* ->...
* After applying the transformation, the resulting network can be inferred
* step by step, the states will store between inferences.
* @ingroup ov_pass_cpp_api
*/
class OPENVINO_API LowLatency2 : public ModelPass {
public:
Expand Down
1 change: 1 addition & 0 deletions src/core/include/openvino/pass/make_stateful.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace pass {
/**
* @brief The transformation replaces the provided pairs Parameter and Result with ngraph Memory layers
* ReadValue and Assign
* \ingroup ov_pass_cpp_api
*/
class OPENVINO_API MakeStateful : public ModelPass {
public:
Expand Down
4 changes: 4 additions & 0 deletions src/core/include/openvino/pass/manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

namespace ov {
namespace pass {
/**
* @brief Manager class allows to manage transformation passes
* @ingroup ov_pass_cpp_api
*/
class OPENVINO_API Manager {
public:
Manager();
Expand Down
8 changes: 8 additions & 0 deletions src/core/include/openvino/pass/pass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ enum class PassProperty : uint32_t {

using PassPropertyMask = ov::EnumMask<PassProperty>;

/**
* @brief Base class for transformation passes
* @ingroup ov_pass_cpp_api
*/
class OPENVINO_API PassBase {
friend class Manager;

Expand Down Expand Up @@ -87,6 +91,10 @@ class OPENVINO_API PassBase {
std::shared_ptr<PassConfig> m_pass_config;
};

/**
* @brief Base class for Model passes
* @ingroup ov_pass_cpp_api
*/
class OPENVINO_API ModelPass : public PassBase {
public:
OPENVINO_RTTI("ov::pass::ModelPass");
Expand Down
1 change: 1 addition & 0 deletions src/core/include/openvino/pass/pass_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ using param_callback_map = std::map<ov::DiscreteTypeInfo, param_callback>;
///
/// Following this logic inside your transformations you will guaranty that transformations
/// will be executed in a right way.
/// \ingroup ov_pass_cpp_api
class OPENVINO_API PassConfig {
public:
/// \brief Disable transformation by its type_info
Expand Down
2 changes: 2 additions & 0 deletions src/core/include/openvino/pass/serialize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace pass {
* - order of generated layers in xml file is ngraph specific (given by
* get_ordered_ops()); MO generates file with different order, but they are
* logically equivalent
* \ingroup ov_pass_cpp_api
*/
class OPENVINO_API Serialize : public ov::pass::ModelPass {
public:
Expand Down Expand Up @@ -60,6 +61,7 @@ class OPENVINO_API Serialize : public ov::pass::ModelPass {
* @brief StreamSerialize transformation converts ngraph::Function into single binary stream
* @attention
* - dynamic shapes are not supported
* \ingroup ov_pass_cpp_api
*/
class OPENVINO_API StreamSerialize : public ov::pass::ModelPass {
public:
Expand Down
1 change: 1 addition & 0 deletions src/core/include/openvino/pass/validate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace pass {
/// pass does not break the shape and data type requirement on a computation node.
/// This default validation run can be changed via calling the
/// \link ov::pass::Manager::set_per_pass_validation(bool) \endlink function.
/// \ingroup ov_pass_cpp_api
class OPENVINO_API Validate : public ModelPass {
public:
OPENVINO_RTTI("ov::pass::Validate");
Expand Down
4 changes: 4 additions & 0 deletions src/core/include/openvino/pass/visualize_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ using visualize_tree_ops_map_t =

namespace ov {
namespace pass {
/**
* @brief VisualizeTree pass allows to serialize ov::Model to xDot format
* @ingroup ov_pass_cpp_api
*/
class OPENVINO_API VisualizeTree : public ModelPass {
public:
OPENVINO_RTTI("ov::pass::VisualizeTree");
Expand Down

0 comments on commit e731a4b

Please sign in to comment.