| 39 | } |
| 40 | |
| 41 | TEST_CASE(single) |
| 42 | { |
| 43 | migraphx::shape s{migraphx::shape::float_type, {2, 3}}; |
| 44 | migraphx::program p1; |
| 45 | { |
| 46 | auto* mm = p1.get_main_module(); |
| 47 | auto x = mm->add_parameter("x", s); |
| 48 | auto y = mm->add_parameter("y", s); |
| 49 | auto z = mm->add_parameter("z", s); |
| 50 | auto add1 = mm->add_instruction(migraphx::make_op("add"), x, y); |
| 51 | auto pass = mm->add_instruction(pass_op{}, add1); |
| 52 | auto add2 = mm->add_instruction(migraphx::make_op("add"), pass, z); |
| 53 | mm->add_return({add2}); |
| 54 | } |
| 55 | run_pass(p1); |
| 56 | migraphx::program p2; |
| 57 | { |
| 58 | auto* mm = p2.get_main_module(); |
| 59 | auto x = mm->add_parameter("x", s); |
| 60 | auto y = mm->add_parameter("y", s); |
| 61 | auto z = mm->add_parameter("z", s); |
| 62 | auto add1 = add_pointwise(p2, "main:pointwise0", {x, y}, single_pointwise("add")); |
| 63 | auto pass = mm->add_instruction(pass_op{}, add1); |
| 64 | auto add2 = add_pointwise(p2, "main:pointwise1", {pass, z}, single_pointwise("add")); |
| 65 | mm->add_return({add2}); |
| 66 | } |
| 67 | EXPECT(p1 == p2); |
| 68 | } |
| 69 | |
| 70 | TEST_CASE(double_add) |
| 71 | { |
nothing calls this directly
no test coverage detected