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

Function TEST_CASE

test/gpu/mlir.cpp:169–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169TEST_CASE(conv)
170{
171 std::string mlir_output = R"__migraphx__(
172module {
173 func.func @mlir_convolution(%arg0: !migraphx.shaped<2x8x3x3xf32, 72x9x3x1>, %arg1: !migraphx.shaped<1x8x4x4xf32, 128x16x4x1>) -> !migraphx.shaped<1x2x2x2xf32, 8x4x2x1> attributes ${attrs} {
174 %0 = migraphx.convolution %arg1, %arg0 {dilation = [1, 1], group = 1 : i64, padding = [0, 0, 0, 0], padding_mode = 0 : i64, stride = [1, 1]} : <1x8x4x4xf32, 128x16x4x1>, <2x8x3x3xf32, 72x9x3x1> -> <1x2x2x2xf32, 8x4x2x1>
175 return %0 : !migraphx.shaped<1x2x2x2xf32, 8x4x2x1>
176 }
177}
178)__migraphx__";
179 migraphx::module m;
180 auto x = m.add_parameter("x", {migraphx::shape::float_type, {1, 8, 4, 4}});
181 auto w = m.add_parameter("w", {migraphx::shape::float_type, {2, 8, 3, 3}});
182 auto conv = m.add_instruction(migraphx::make_op("convolution"), x, w);
183 m.add_return({conv});
184 auto s = migraphx::gpu::dump_mlir(m);
185 // Skip test if MLIR is not enabled
186 if(s.empty())
187 return;
188 auto mlir_output_with_attrs =
189 migraphx::interpolate_string(mlir_output, {{"attrs", get_attrs()}});
190 CHECK(encode(s) == encode(mlir_output_with_attrs));
191 EXPECT(verify_mlir(m));
192}
193
194TEST_CASE(conv_nhwc)
195{

Callers

nothing calls this directly

Calls 10

dump_mlirFunction · 0.85
interpolate_stringFunction · 0.85
get_attrsFunction · 0.85
verify_mlirFunction · 0.85
add_parameterMethod · 0.80
encodeFunction · 0.70
make_opFunction · 0.50
add_instructionMethod · 0.45
add_returnMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected