| 136 | using identity = migraphx::op::identity; |
| 137 | |
| 138 | TEST_CASE(simple) |
| 139 | { |
| 140 | auto create_test_program = [] { |
| 141 | migraphx::module m; |
| 142 | |
| 143 | auto a1 = m.add_instruction(allocate{create_shape(1)}); |
| 144 | auto m1 = m.add_instruction(simple_op{}, a1); |
| 145 | auto a2 = m.add_instruction(allocate{create_shape(1)}); |
| 146 | auto m2 = m.add_instruction(simple_op{}, a2); |
| 147 | std::size_t axis = 0; |
| 148 | auto a3 = m.add_instruction(allocate{create_shape(2)}); |
| 149 | m.add_instruction(concat(axis), m1, m2, a3); |
| 150 | return m; |
| 151 | }; |
| 152 | auto create_control_program = [] { |
| 153 | migraphx::module m; |
| 154 | |
| 155 | auto a1 = m.add_instruction(allocate{create_shape(2)}); |
| 156 | auto l1 = m.add_instruction(load{create_shape(1), 0}, a1); |
| 157 | auto m1 = m.add_instruction(simple_op{}, l1); |
| 158 | auto l2 = m.add_instruction(load{create_shape(1), 4}, a1); |
| 159 | auto m2 = m.add_instruction(simple_op{}, l2); |
| 160 | m.add_instruction(identity{}, a1, m1, m2); |
| 161 | return m; |
| 162 | }; |
| 163 | |
| 164 | auto m1 = create_test_program(); |
| 165 | auto m2 = create_control_program(); |
| 166 | run_pass(m1); |
| 167 | |
| 168 | EXPECT(m1 == m2); |
| 169 | } |
| 170 | |
| 171 | TEST_CASE(negative_axis1) |
| 172 | { |
nothing calls this directly
no test coverage detected