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

Function TEST_CASE

test/simplify_dyn_ops_test.cpp:38–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38TEST_CASE(broadcast_with_dims)
39{
40 migraphx::module m0;
41 {
42 // the X input
43 migraphx::shape sx{migraphx::shape::float_type, {3, 1, 1}};
44 auto inx = m0.add_parameter("x", sx);
45
46 // the shape input. Broadcast to this
47 migraphx::shape dims_s{migraphx::shape::int64_type, {4}};
48 std::vector<size_t> dims = {2, 3, 4, 5};
49 auto out_dims = m0.add_literal(migraphx::literal{dims_s, dims});
50
51 auto r = m0.add_instruction(migraphx::make_op("broadcast_with_dims"), inx, out_dims);
52 m0.add_return({r});
53 }
54 run_pass(m0);
55
56 migraphx::module m1;
57 {
58 migraphx::shape sx{migraphx::shape::float_type, {3, 1, 1}};
59 auto inx = m1.add_parameter("x", sx);
60
61 auto r = m1.add_instruction(
62 migraphx::make_op("multibroadcast", {{"out_lens", {2, 3, 4, 5}}}), inx);
63 m1.add_return({r});
64 }
65 EXPECT(m0 == m1);
66}
67
68TEST_CASE(broadcast_with_dims_invalid)
69{

Callers

nothing calls this directly

Calls 15

run_passesFunction · 0.85
add_common_opFunction · 0.85
add_parameterMethod · 0.80
insert_literalMethod · 0.80
lensMethod · 0.80
get_main_moduleMethod · 0.80
run_passFunction · 0.70
make_opFunction · 0.50
to_valueFunction · 0.50
literalClass · 0.50
maxClass · 0.50
add_literalMethod · 0.45

Tested by

no test coverage detected