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

Function run_program

test/ref/unique.cpp:55–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53
54template <typename T>
55auto run_program(T& data,
56 const migraphx::shape& data_shape,
57 int sorted,
58 std::optional<int64_t> axis = std::nullopt)
59{
60 auto p = create_program(data_shape, sorted, axis);
61 p.compile(migraphx::make_target("ref"));
62 migraphx::parameter_map pp;
63 pp["X"] = migraphx::argument(data_shape, data.data());
64 auto rets = p.eval(pp);
65 std::vector<typename std::remove_reference_t<decltype(data)>::value_type> y;
66 rets[0].visit([&](auto v) { y.assign(v.begin(), v.end()); });
67 std::vector<int64_t> y_idx;
68 rets[1].visit([&](auto v) { y_idx.assign(v.begin(), v.end()); });
69 std::vector<int64_t> x_rev_idx;
70 rets[2].visit([&](auto v) { x_rev_idx.assign(v.begin(), v.end()); });
71 std::vector<int64_t> y_ct;
72 rets[3].visit([&](auto v) { y_ct.assign(v.begin(), v.end()); });
73
74 return std::make_tuple(y, y_idx, x_rev_idx, y_ct);
75}
76} // namespace
77
78// sorted. single entry

Callers 1

TEST_CASEFunction · 0.70

Calls 11

make_targetFunction · 0.85
create_programFunction · 0.70
argumentClass · 0.50
make_tupleFunction · 0.50
compileMethod · 0.45
dataMethod · 0.45
evalMethod · 0.45
visitMethod · 0.45
assignMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected