Commit 282fd136 authored by Paul's avatar Paul
Browse files

Fix simplify_algebra tests

parent 455e6535
...@@ -1055,22 +1055,35 @@ TEST_CASE(simplify_div_const) ...@@ -1055,22 +1055,35 @@ TEST_CASE(simplify_div_const)
{ {
migraphx::module m1; migraphx::module m1;
{ {
auto x = m1.add_parameter("x", {migraphx::shape::int32_type, {1}}); auto x = m1.add_parameter("x", {migraphx::shape::float_type, {1}});
auto two = m1.add_literal(2); auto two = m1.add_literal(2.0f);
m1.add_instruction(migraphx::make_op("div"), x, two); m1.add_instruction(migraphx::make_op("div"), x, two);
} }
run_pass(m1); run_pass(m1);
migraphx::module m2; migraphx::module m2;
{ {
auto x = m2.add_parameter("x", {migraphx::shape::int32_type, {1}}); auto x = m2.add_parameter("x", {migraphx::shape::float_type, {1}});
auto two = m2.add_literal(2); auto two = m2.add_literal(2.0f);
auto recip = m2.insert_instruction(std::next(two), migraphx::make_op("recip"), two); auto recip = m2.insert_instruction(std::next(two), migraphx::make_op("recip"), two);
m2.add_instruction(migraphx::make_op("mul"), x, recip); m2.add_instruction(migraphx::make_op("mul"), x, recip);
} }
EXPECT(m1 == m2); EXPECT(m1 == m2);
} }
TEST_CASE(simplify_div_integral_const)
{
migraphx::module m1;
{
auto x = m1.add_parameter("x", {migraphx::shape::int32_type, {1}});
auto two = m1.add_literal(2);
m1.add_instruction(migraphx::make_op("div"), x, two);
}
migraphx::module m2 = m1;
run_pass(m1);
EXPECT(m1 == m2);
}
TEST_CASE(simplify_unit_mult_const) TEST_CASE(simplify_unit_mult_const)
{ {
migraphx::module m1; migraphx::module m1;
......
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