MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / TEST_CASE

Function TEST_CASE

test/eliminate_concat_test.cpp:138–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136using identity = migraphx::op::identity;
137
138TEST_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
171TEST_CASE(negative_axis1)
172{

Callers

nothing calls this directly

Calls 4

create_shapeFunction · 0.85
concatClass · 0.70
run_passFunction · 0.70
add_instructionMethod · 0.45

Tested by

no test coverage detected