| 82 | } |
| 83 | |
| 84 | TEST_CASE(simple_concat_pointwise) |
| 85 | { |
| 86 | migraphx::shape s{migraphx::shape::float_type, {2, 3}}; |
| 87 | migraphx::program p1; |
| 88 | { |
| 89 | auto* mm = p1.get_main_module(); |
| 90 | auto x = mm->add_parameter("x", s); |
| 91 | auto y = mm->add_parameter("y", s); |
| 92 | auto add = add_pointwise(p1, "main:pointwise0", {x, y}, single_pointwise("add")); |
| 93 | auto sub = add_pointwise(p1, "main:pointwise1", {x, y}, single_pointwise("sub")); |
| 94 | auto concat = mm->add_instruction(migraphx::make_op("concat", {{"axis", 1}}), add, sub); |
| 95 | mm->add_return({concat}); |
| 96 | } |
| 97 | run_pass(p1); |
| 98 | migraphx::program p2; |
| 99 | { |
| 100 | auto* mm = p2.get_main_module(); |
| 101 | auto x = mm->add_parameter("x", s); |
| 102 | auto y = mm->add_parameter("y", s); |
| 103 | auto fused_concat = |
| 104 | add_pointwise_concat(p2, |
| 105 | 1, |
| 106 | arg("noop:concat0", {}, noop_pointwise()), |
| 107 | arg("concat:main:pointwise0", {x, y}, single_pointwise("add")), |
| 108 | arg("concat:main:pointwise1", {x, y}, single_pointwise("sub"))); |
| 109 | mm->add_return({fused_concat}); |
| 110 | } |
| 111 | EXPECT(p1 == p2); |
| 112 | } |
| 113 | |
| 114 | TEST_CASE(partial_pointwise_concat) |
| 115 | { |
nothing calls this directly
no test coverage detected