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

Method fuse

src/module.cpp:1106–1129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1104}
1105
1106std::vector<instruction_ref>
1107module::fuse(const std::vector<instruction_ref>& inss,
1108 std::unordered_map<instruction_ref, instruction_ref>* map_ins,
1109 module::inserter insert,
1110 const std::function<shape(const shape&)>& shape_transform)
1111{
1112 std::unordered_map<instruction_ref, instruction_ref> default_map_ins;
1113 if(map_ins == nullptr)
1114 map_ins = &default_map_ins;
1115 std::vector<instruction_ref> inputs;
1116 for(auto ins : inss)
1117 {
1118 for(auto input : ins->inputs())
1119 {
1120 if(contains(inss, input))
1121 continue;
1122 if(contains(inputs, input))
1123 continue;
1124 inputs.push_back(input);
1125 }
1126 }
1127 insert_params(*this, inputs, *map_ins, shape_transform);
1128 return this->add_instructions(inss, map_ins, std::move(insert));
1129}
1130
1131std::vector<instruction_ref>
1132module::fuse(const module& m,

Callers 15

TEST_CASEFunction · 0.45
append_pointwise_moduleFunction · 0.45
applyMethod · 0.45
applyMethod · 0.45
create_reduce_modulesFunction · 0.45
applyMethod · 0.45
applyMethod · 0.45
applyMethod · 0.45
insertMethod · 0.45
applyMethod · 0.45
applyMethod · 0.45

Calls 7

add_instructionsMethod · 0.95
containsFunction · 0.85
insert_paramsFunction · 0.85
get_ins_param_mapMethod · 0.80
atMethod · 0.80
inputsMethod · 0.45
push_backMethod · 0.45

Tested by 1

TEST_CASEFunction · 0.36