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

Function get_graph_color

src/graphviz.cpp:111–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111std::string get_graph_color(const instruction_ref& ins)
112{
113 const auto& op = ins->get_operator();
114 const auto& attr = op.attributes();
115
116 bool context_free = is_context_free(op);
117 bool alias = not op.output_alias(to_shapes(ins->inputs())).empty();
118
119 if(ins->can_eval())
120 {
121 return "#ADD8E6"; // lightblue
122 }
123 else if(attr.contains("pointwise"))
124 {
125 return "#9ACD32"; // yellowgreen
126 }
127 else if(starts_with(op.name(), "reduce"))
128 {
129 return "#90EE90"; // light green
130 }
131 else if(context_free and alias)
132 {
133 return "#98FB98"; // palegreen
134 }
135 else if(context_free and not alias)
136 {
137 return "#FFA500"; // orange
138 }
139 else if(not context_free and alias)
140 {
141 return "#EFBF04"; // gold
142 }
143 else if(attr.contains("fillcolor"))
144 {
145 return attr.at("fillcolor").to<std::string>();
146 }
147 else
148 {
149 return "#D3D3D3"; // lightgray
150 }
151}
152
153graphviz_node_content get_node_content(const instruction_ref& ins)
154{

Callers 1

get_node_contentFunction · 0.85

Calls 11

starts_withFunction · 0.85
can_evalMethod · 0.80
atMethod · 0.80
to_shapesFunction · 0.70
is_context_freeFunction · 0.50
attributesMethod · 0.45
emptyMethod · 0.45
output_aliasMethod · 0.45
inputsMethod · 0.45
containsMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected