| 55 | } |
| 56 | |
| 57 | TEST_CASE(simplify_pow2_div) |
| 58 | { |
| 59 | migraphx::module m1; |
| 60 | { |
| 61 | auto x = m1.add_parameter("x", {migraphx::shape::half_type, {1}}); |
| 62 | auto n = m1.add_literal(migraphx::half{5.0f}); |
| 63 | auto two = m1.add_literal(migraphx::half{2.0f}); |
| 64 | |
| 65 | auto pow = m1.add_instruction(migraphx::make_op("pow"), x, two); |
| 66 | auto div = m1.add_instruction(migraphx::make_op("div"), pow, n); |
| 67 | m1.add_instruction(pass_op{}, div); |
| 68 | } |
| 69 | run_pass(m1); |
| 70 | |
| 71 | migraphx::module m2; |
| 72 | { |
| 73 | auto x = m2.add_parameter("x", {migraphx::shape::half_type, {1}}); |
| 74 | auto n = m2.add_literal(migraphx::half{5.0f}); |
| 75 | |
| 76 | auto x_div_n = m2.add_instruction(migraphx::make_op("div"), x, n); |
| 77 | auto mul = m2.add_instruction(migraphx::make_op("mul"), x_div_n, x); |
| 78 | m2.add_instruction(pass_op{}, mul); |
| 79 | } |
| 80 | EXPECT(m1 == m2); |
| 81 | } |
| 82 | |
| 83 | TEST_CASE(no_simplify_float_pow2_div) |
| 84 | { |
nothing calls this directly
no test coverage detected