| 40 | } |
| 41 | |
| 42 | TEST_CASE(simplify_add1) |
| 43 | { |
| 44 | migraphx::module m1; |
| 45 | { |
| 46 | auto x = m1.add_parameter("x", {migraphx::shape::int32_type, {1}}); |
| 47 | auto y = m1.add_parameter("y", {migraphx::shape::int32_type, {1}}); |
| 48 | auto one = m1.add_literal(1); |
| 49 | auto two = m1.add_literal(2); |
| 50 | auto sum1 = m1.add_instruction(migraphx::make_op("add"), x, one); |
| 51 | auto sum2 = m1.add_instruction(migraphx::make_op("add"), y, two); |
| 52 | auto sum3 = m1.add_instruction(migraphx::make_op("add"), sum1, sum2); |
| 53 | m1.add_instruction(pass_op{}, sum3); |
| 54 | } |
| 55 | run_pass(m1); |
| 56 | |
| 57 | migraphx::module m2; |
| 58 | { |
| 59 | auto x = m2.add_parameter("x", {migraphx::shape::int32_type, {1}}); |
| 60 | auto y = m2.add_parameter("y", {migraphx::shape::int32_type, {1}}); |
| 61 | auto one = m2.add_literal(1); |
| 62 | auto two = m2.add_literal(2); |
| 63 | auto sum1 = m2.add_instruction(migraphx::make_op("add"), one, two); |
| 64 | auto sum2 = m2.add_instruction(migraphx::make_op("add"), x, y); |
| 65 | auto sum3 = m2.add_instruction(migraphx::make_op("add"), sum2, sum1); |
| 66 | m2.add_instruction(pass_op{}, sum3); |
| 67 | } |
| 68 | EXPECT(m1 == m2); |
| 69 | } |
| 70 | |
| 71 | TEST_CASE(simplify_add2) |
| 72 | { |
nothing calls this directly
no test coverage detected