"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "86294d3c7ffa5e97b9483d82c14021d06b701a12"
Commit af86d975 authored by Paul's avatar Paul
Browse files

Formatting

parent 94ef1ad0
...@@ -14,7 +14,7 @@ struct match_const_add ...@@ -14,7 +14,7 @@ struct match_const_add
void apply(program& p, match::matcher_result r) const void apply(program& p, match::matcher_result r) const
{ {
auto ins = r.result; auto ins = r.result;
auto arg1 = ins->inputs().at(0)->get_literal(); auto arg1 = ins->inputs().at(0)->get_literal();
auto arg2 = ins->inputs().at(1)->get_literal(); auto arg2 = ins->inputs().at(1)->get_literal();
...@@ -23,9 +23,6 @@ struct match_const_add ...@@ -23,9 +23,6 @@ struct match_const_add
} }
}; };
void constant_propagate::apply(program& p) const void constant_propagate::apply(program& p) const { match::find_matches(p, match_const_add{}); }
{
match::find_matches(p, match_const_add{});
}
} // namespace migraph } // namespace migraph
...@@ -14,7 +14,7 @@ struct const_prop_target ...@@ -14,7 +14,7 @@ struct const_prop_target
migraph::context get_context() const { return {}; } migraph::context get_context() const { return {}; }
}; };
void const_add1() void const_add1()
{ {
migraph::program p1; migraph::program p1;
auto one = p1.add_literal(1); auto one = p1.add_literal(1);
...@@ -29,8 +29,7 @@ void const_add1() ...@@ -29,8 +29,7 @@ void const_add1()
EXPECT(p1 == p2); EXPECT(p1 == p2);
} }
void const_add2()
void const_add2()
{ {
migraph::program p1; migraph::program p1;
auto one = p1.add_parameter("one", {migraph::shape::int32_type, {1}}); auto one = p1.add_parameter("one", {migraph::shape::int32_type, {1}});
...@@ -45,11 +44,11 @@ void const_add2() ...@@ -45,11 +44,11 @@ void const_add2()
EXPECT(p1 != p2); EXPECT(p1 != p2);
} }
void const_add3() void const_add3()
{ {
migraph::program p1; migraph::program p1;
auto one = p1.add_literal(1); auto one = p1.add_literal(1);
auto two = p1.add_literal(2); auto two = p1.add_literal(2);
auto sum1 = p1.add_instruction(migraph::op::add{}, one, two); auto sum1 = p1.add_instruction(migraph::op::add{}, one, two);
auto sum2 = p1.add_instruction(migraph::op::add{}, sum1, two); auto sum2 = p1.add_instruction(migraph::op::add{}, sum1, two);
p1.add_instruction(pass_op{}, sum2); p1.add_instruction(pass_op{}, sum2);
...@@ -61,9 +60,9 @@ void const_add3() ...@@ -61,9 +60,9 @@ void const_add3()
EXPECT(p1 == p2); EXPECT(p1 == p2);
} }
int main() { int main()
{
const_add1(); const_add1();
const_add2(); const_add2();
const_add3(); const_add3();
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment