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

Function add_mlir

test/gpu/fuse_mlir.cpp:65–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63
64template <class F>
65static migraphx::instruction_ref add_mlir(migraphx::program& p,
66 const std::string& name,
67 std::vector<migraphx::instruction_ref> inputs,
68 std::vector<std::string> arg_names,
69 const F& f)
70{
71 assert(inputs.size() == arg_names.size() and "One interior parameter name given per input.");
72 auto* mm = p.get_main_module();
73 auto* pm = p.create_module(name);
74 pm->set_bypass();
75 std::vector<migraphx::instruction_ref> params;
76 for(size_t i = 0, e = inputs.size(); i < e; ++i)
77 {
78 params.push_back(pm->add_parameter(arg_names[i], inputs[i]->get_shape().as_standard()));
79 }
80 auto values = f(pm, params);
81 auto root = std::get<0>(values);
82 auto r = std::get<1>(values);
83 auto_add_return(pm, r);
84 return mm->add_instruction(
85 migraphx::make_op("gpu::mlir_op", {{"op", migraphx::to_value(root)}}), inputs, {pm});
86}
87
88template <class F>
89static migraphx::instruction_ref add_mlir(migraphx::program& p,

Callers 1

TEST_CASEFunction · 0.85

Calls 15

auto_add_returnFunction · 0.85
param_nameFunction · 0.85
get_main_moduleMethod · 0.80
set_bypassMethod · 0.80
add_parameterMethod · 0.80
as_standardMethod · 0.80
make_opFunction · 0.50
to_valueFunction · 0.50
transformFunction · 0.50
rangeFunction · 0.50
sizeMethod · 0.45
create_moduleMethod · 0.45

Tested by

no test coverage detected