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

Method apply

src/preallocate_param.cpp:34–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32inline namespace MIGRAPHX_INLINE_NS {
33
34void preallocate_param::apply(module& m) const
35{
36 auto last = std::prev(m.end());
37 for(auto ins : iterator_for(m))
38 {
39 if(ins->name() != "@param")
40 continue;
41 if(param != any_cast<builtin::param>(ins->get_operator()).parameter)
42 continue;
43 std::string id = m.name() + ":" + param;
44 auto r = m.insert_instruction(ins, model.preallocate(ins->get_shape(), id));
45 m.replace_instruction(ins, r);
46 m.move_instruction(ins, m.end());
47 }
48 m.remove_instructions(std::next(last), m.end());
49}
50
51} // namespace MIGRAPHX_INLINE_NS
52} // namespace migraphx

Callers

nothing calls this directly

Calls 9

iterator_forFunction · 0.85
insert_instructionMethod · 0.80
replace_instructionMethod · 0.80
move_instructionMethod · 0.80
remove_instructionsMethod · 0.80
endMethod · 0.45
nameMethod · 0.45
preallocateMethod · 0.45
get_shapeMethod · 0.45

Tested by

no test coverage detected