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

Method print

src/module.cpp:1237–1264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1235}
1236
1237std::unordered_map<instruction_ref, std::string> module::print(
1238 const std::function<void(instruction_ref,
1239 const std::unordered_map<instruction_ref, std::string>&)>& print_func,
1240 std::unordered_map<instruction_ref, std::string> names) const
1241{
1242 const bool is_root = names.empty();
1243 int count = 0;
1244 for(auto ins : iterator_for(*this))
1245 {
1246 std::string var_name;
1247 if(not this->name().empty() and not is_root)
1248 var_name = this->name() + ":";
1249 if(ins->name() == "@param")
1250 {
1251 var_name.append(any_cast<builtin::param>(ins->get_operator()).parameter);
1252 }
1253 else
1254 {
1255 var_name.append("@" + std::to_string(count));
1256 }
1257 // count every instruction so index matches loc in the printout program
1258 count++;
1259 names.emplace(ins, var_name);
1260
1261 print_func(ins, names);
1262 }
1263 return names;
1264}
1265
1266void module::print(const std::function<
1267 void(instruction_ref, const std::unordered_map<instruction_ref, std::string>&)>&

Callers 9

debug_printMethod · 0.95
print_graphMethod · 0.95
print_pyMethod · 0.95
print_cppMethod · 0.95
annotateMethod · 0.95
TEST_CASEFunction · 0.45
module.cppFile · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 6

nameMethod · 0.95
iterator_forFunction · 0.85
emplaceMethod · 0.80
to_stringFunction · 0.50
emptyMethod · 0.45
appendMethod · 0.45

Tested by 1

TEST_CASEFunction · 0.36