Initial nGraph Transformations type info (#1635)
This commit is contained in:
parent
09c43536fe
commit
764eff9819
@ -32,6 +32,10 @@
|
|||||||
using namespace ngraph;
|
using namespace ngraph;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
NGRAPH_RTTI_DEFINITION(ngraph::pass::GetOutputElementElimination,
|
||||||
|
"ngraph::pass::GetOutputElementElimination",
|
||||||
|
0);
|
||||||
|
|
||||||
bool pass::GetOutputElementElimination::run_on_node(shared_ptr<Node> n)
|
bool pass::GetOutputElementElimination::run_on_node(shared_ptr<Node> n)
|
||||||
{
|
{
|
||||||
bool optimized = false;
|
bool optimized = false;
|
||||||
|
@ -30,6 +30,8 @@ NGRAPH_SUPPRESS_DEPRECATED_START
|
|||||||
class NGRAPH_API ngraph::pass::GetOutputElementElimination : public NodePass
|
class NGRAPH_API ngraph::pass::GetOutputElementElimination : public NodePass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
NGRAPH_RTTI_DECLARATION;
|
||||||
|
|
||||||
bool run_on_node(std::shared_ptr<Node> node) override;
|
bool run_on_node(std::shared_ptr<Node> node) override;
|
||||||
};
|
};
|
||||||
NGRAPH_SUPPRESS_DEPRECATED_END
|
NGRAPH_SUPPRESS_DEPRECATED_END
|
||||||
|
@ -62,6 +62,10 @@ using namespace ngraph;
|
|||||||
// If MatcherPass register more than one node make sure that this nodes are registered in
|
// If MatcherPass register more than one node make sure that this nodes are registered in
|
||||||
// topological order.
|
// topological order.
|
||||||
|
|
||||||
|
NGRAPH_RTTI_DEFINITION(ngraph::pass::GraphRewrite, "ngraph::pass::GraphRewrite", 0);
|
||||||
|
|
||||||
|
NGRAPH_RTTI_DEFINITION(ngraph::pass::MatcherPass, "ngraph::pass::MatcherPass", 0);
|
||||||
|
|
||||||
bool pass::GraphRewrite::run_on_function(shared_ptr<Function> f)
|
bool pass::GraphRewrite::run_on_function(shared_ptr<Function> f)
|
||||||
{
|
{
|
||||||
OV_ITT_SCOPED_TASK(itt::domains::Ngraph, "pass::GraphRewrite::run_on_function");
|
OV_ITT_SCOPED_TASK(itt::domains::Ngraph, "pass::GraphRewrite::run_on_function");
|
||||||
|
@ -57,6 +57,8 @@ namespace ngraph
|
|||||||
class NGRAPH_API ngraph::pass::MatcherPass : public ngraph::pass::PassBase
|
class NGRAPH_API ngraph::pass::MatcherPass : public ngraph::pass::PassBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
NGRAPH_RTTI_DECLARATION;
|
||||||
|
|
||||||
MatcherPass() = default;
|
MatcherPass() = default;
|
||||||
|
|
||||||
MatcherPass(const MatcherPass&) = delete;
|
MatcherPass(const MatcherPass&) = delete;
|
||||||
@ -114,6 +116,8 @@ private:
|
|||||||
class NGRAPH_API ngraph::pass::GraphRewrite : public ngraph::pass::FunctionPass
|
class NGRAPH_API ngraph::pass::GraphRewrite : public ngraph::pass::FunctionPass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
NGRAPH_RTTI_DECLARATION;
|
||||||
|
|
||||||
GraphRewrite() = default;
|
GraphRewrite() = default;
|
||||||
|
|
||||||
explicit GraphRewrite(const std::shared_ptr<MatcherPass>& pass)
|
explicit GraphRewrite(const std::shared_ptr<MatcherPass>& pass)
|
||||||
|
@ -27,6 +27,10 @@ using namespace ngraph;
|
|||||||
|
|
||||||
NGRAPH_SUPPRESS_DEPRECATED_START
|
NGRAPH_SUPPRESS_DEPRECATED_START
|
||||||
|
|
||||||
|
NGRAPH_RTTI_DEFINITION(ngraph::pass::FunctionPass, "ngraph::pass::FunctionPass", 0);
|
||||||
|
|
||||||
|
NGRAPH_RTTI_DEFINITION(ngraph::pass::NodePass, "ngraph::pass::NodePass", 0);
|
||||||
|
|
||||||
pass::PassBase::PassBase()
|
pass::PassBase::PassBase()
|
||||||
: m_property{all_pass_property_off}
|
: m_property{all_pass_property_off}
|
||||||
{
|
{
|
||||||
|
@ -57,6 +57,10 @@ namespace ngraph
|
|||||||
|
|
||||||
void set_callback(const param_callback& callback);
|
void set_callback(const param_callback& callback);
|
||||||
|
|
||||||
|
using type_info_t = DiscreteTypeInfo;
|
||||||
|
|
||||||
|
virtual const type_info_t& get_type_info() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ManagerState& get_state();
|
ManagerState& get_state();
|
||||||
void set_state(ManagerState&);
|
void set_state(ManagerState&);
|
||||||
@ -82,6 +86,7 @@ namespace ngraph
|
|||||||
class NGRAPH_API FunctionPass : public PassBase
|
class NGRAPH_API FunctionPass : public PassBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
NGRAPH_RTTI_DECLARATION;
|
||||||
virtual ~FunctionPass();
|
virtual ~FunctionPass();
|
||||||
virtual bool run_on_function(std::shared_ptr<ngraph::Function>) = 0;
|
virtual bool run_on_function(std::shared_ptr<ngraph::Function>) = 0;
|
||||||
};
|
};
|
||||||
@ -90,6 +95,7 @@ namespace ngraph
|
|||||||
: public PassBase
|
: public PassBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
NGRAPH_RTTI_DECLARATION;
|
||||||
virtual ~NodePass();
|
virtual ~NodePass();
|
||||||
virtual bool run_on_node(std::shared_ptr<ngraph::Node>) = 0;
|
virtual bool run_on_node(std::shared_ptr<ngraph::Node>) = 0;
|
||||||
};
|
};
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
using namespace ngraph;
|
using namespace ngraph;
|
||||||
|
|
||||||
|
NGRAPH_RTTI_DEFINITION(ngraph::pass::Validate, "ngraph::pass::Validate", 0);
|
||||||
|
|
||||||
bool pass::Validate::run_on_function(std::shared_ptr<Function> f)
|
bool pass::Validate::run_on_function(std::shared_ptr<Function> f)
|
||||||
{
|
{
|
||||||
f->validate_nodes_and_infer_types();
|
f->validate_nodes_and_infer_types();
|
||||||
|
@ -37,6 +37,8 @@ namespace ngraph
|
|||||||
class NGRAPH_API Validate : public FunctionPass
|
class NGRAPH_API Validate : public FunctionPass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
NGRAPH_RTTI_DECLARATION;
|
||||||
|
|
||||||
Validate()
|
Validate()
|
||||||
: FunctionPass()
|
: FunctionPass()
|
||||||
{
|
{
|
||||||
|
@ -183,6 +183,8 @@ static std::string label_edge(const std::shared_ptr<Node>& /* src */,
|
|||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NGRAPH_RTTI_DEFINITION(ngraph::pass::VisualizeTree, "ngraph::pass::VisualizeTree", 0);
|
||||||
|
|
||||||
bool pass::VisualizeTree::run_on_module(vector<shared_ptr<Function>>& functions)
|
bool pass::VisualizeTree::run_on_module(vector<shared_ptr<Function>>& functions)
|
||||||
{
|
{
|
||||||
for (shared_ptr<Function> f : functions)
|
for (shared_ptr<Function> f : functions)
|
||||||
|
@ -41,6 +41,8 @@ class HeightMap;
|
|||||||
class NGRAPH_API ngraph::pass::VisualizeTree : public ModulePass
|
class NGRAPH_API ngraph::pass::VisualizeTree : public ModulePass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
NGRAPH_RTTI_DECLARATION;
|
||||||
|
|
||||||
using node_modifiers_t =
|
using node_modifiers_t =
|
||||||
std::function<void(const Node& node, std::vector<std::string>& attributes)>;
|
std::function<void(const Node& node, std::vector<std::string>& attributes)>;
|
||||||
VisualizeTree(const std::string& file_name,
|
VisualizeTree(const std::string& file_name,
|
||||||
|
Loading…
Reference in New Issue
Block a user