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

Method print_graph

src/program.cpp:1099–1140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1097}
1098
1099void program::print_graph(std::ostream& os, bool brief) const
1100{
1101 const auto* mm = this->get_main_module();
1102
1103 os << "digraph {\n\tperipheries=0;\n";
1104
1105 mm->print([&](auto ins, auto ins_names) {
1106 const auto& ins_name = graphviz::enclose_name(ins_names.at(ins));
1107
1108 os << "\t" << ins_name << "[";
1109
1110 if(brief)
1111 {
1112
1113 os << "label=" << graphviz::enclose_name(ins->name()) << "]";
1114 os << ";" << std::endl;
1115 }
1116 else
1117 {
1118 graphviz::graphviz_node_content content = graphviz::get_node_content(ins);
1119 os << "label=" << graphviz::build_html_label(content) << " ";
1120 os << graphviz::build_node_style(content.node_style);
1121 os << "];\n";
1122 }
1123
1124 if(not ins->inputs().empty())
1125 {
1126 for(auto&& arg : ins->inputs())
1127 {
1128 os << "\t" << graphviz::enclose_name(ins_names.at(arg)) << " -> "
1129 << graphviz::enclose_name(ins_names.at(ins));
1130 if(not brief)
1131 os << "[label="
1132 << graphviz::enclose_name(graphviz::format_shape_name(ins->get_shape()))
1133 << "]";
1134 os << ";\n";
1135 }
1136 }
1137 });
1138
1139 os << "}" << std::endl;
1140}
1141
1142void program::print_py(std::ostream& os) const
1143{

Callers

nothing calls this directly

Calls 12

get_main_moduleMethod · 0.95
get_node_contentFunction · 0.85
build_html_labelFunction · 0.85
build_node_styleFunction · 0.85
format_shape_nameFunction · 0.85
atMethod · 0.80
enclose_nameFunction · 0.70
printMethod · 0.45
nameMethod · 0.45
emptyMethod · 0.45
inputsMethod · 0.45
get_shapeMethod · 0.45

Tested by

no test coverage detected