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

Function create_program

test/ref/unique.cpp:35–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33namespace {
34
35migraphx::program
36create_program(const migraphx::shape& data_shape, int64_t sorted, std::optional<int64_t> axis)
37{
38 migraphx::program p;
39 auto* mm = p.get_main_module();
40 auto data = mm->add_parameter("X", data_shape);
41 auto op = axis ? migraphx::make_op("unique", {{"axis", *axis}, {"sorted", sorted}})
42 : migraphx::make_op("unique", {{"sorted", sorted}});
43
44 auto r = mm->add_instruction(op, data);
45
46 auto r0 = mm->add_instruction(migraphx::make_op("get_tuple_elem", {{"index", 0}}), r);
47 auto r1 = mm->add_instruction(migraphx::make_op("get_tuple_elem", {{"index", 1}}), r);
48 auto r2 = mm->add_instruction(migraphx::make_op("get_tuple_elem", {{"index", 2}}), r);
49 auto r3 = mm->add_instruction(migraphx::make_op("get_tuple_elem", {{"index", 3}}), r);
50 mm->add_return({r0, r1, r2, r3});
51 return p;
52};
53
54template <typename T>
55auto run_program(T& data,

Callers 15

TEST_CASEFunction · 0.70
TEST_CASEFunction · 0.70
TEST_CASEFunction · 0.70
quantizelinear_fp8e4m3Function · 0.70
quantizelinear_fp8e5m2Function · 0.70
TEST_CASEFunction · 0.70
run_programFunction · 0.70
run_progFunction · 0.70
TEST_CASEFunction · 0.70
TEST_CASEFunction · 0.50
TEST_CASEFunction · 0.50
TEST_CASEFunction · 0.50

Calls 5

get_main_moduleMethod · 0.80
add_parameterMethod · 0.80
make_opFunction · 0.50
add_instructionMethod · 0.45
add_returnMethod · 0.45

Tested by 6

TEST_CASEFunction · 0.40
TEST_CASEFunction · 0.40
TEST_CASEFunction · 0.40
TEST_CASEFunction · 0.40
TEST_CASEFunction · 0.40
TEST_CASEFunction · 0.40