ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
onert::dumper::dot::DotDumper Class Reference

#include <DotDumper.h>

Public Types

enum  Level { OFF = 0 , ALL_BUT_CONSTANTS = 1 , ALL = 2 }
 

Public Member Functions

 DotDumper (Level level)
 
void dump (const ir::Graph &graph, const std::string &tag)
 Dump graph information to dot file as tag name if "GRAPH_DOT_DUMP" is set.
 
void dump (const compiler::ILoweredGraph &lowered_graph, const std::string &tag)
 Dump lowered graph information to dot file as tag name if "GRAPH_DOT_DUMP" is set.
 
void dump (const ir::train::TrainableGraph &graph, const std::string &tag)
 Dump graph information to dot file as tag name if "GRAPH_DOT_DUMP" is set.
 

Detailed Description

Definition at line 27 of file DotDumper.h.

Member Enumeration Documentation

◆ Level

Enumerator
OFF 
ALL_BUT_CONSTANTS 
ALL 

Definition at line 30 of file DotDumper.h.

31 {
32 OFF = 0, //< Do not dump
33 ALL_BUT_CONSTANTS = 1, //< Emit all operations and operands but constants
34 ALL = 2 //< Emit all operations and operands
35 };

Constructor & Destructor Documentation

◆ DotDumper()

onert::dumper::dot::DotDumper::DotDumper ( Level  level)
inline

Definition at line 38 of file DotDumper.h.

38: _level{level} {}

Member Function Documentation

◆ dump() [1/3]

void onert::dumper::dot::DotDumper::dump ( const compiler::ILoweredGraph lowered_graph,
const std::string &  tag 
)

Dump lowered graph information to dot file as tag name if "GRAPH_DOT_DUMP" is set.

Parameters
[in]graphThe graph that would be used to get operations and operands
[in]tagThe name of dot file that would be created
Returns
N/A

Definition at line 213 of file DotDumper.cc.

214{
215 if (_level == Level::OFF)
216 {
217 return;
218 }
219
220 auto dot_operands = generate_dot_operands(lowered_graph.graph(), _level);
221 auto dot_operations = generate_dot_operations(lowered_graph.graph(), dot_operands);
222 update_lower_info(lowered_graph, &dot_operands);
223 update_lower_info(lowered_graph, &dot_operations);
224 dump_to_file(dot_operands, dot_operations, tag);
225}

References onert::compiler::ILoweredGraph::graph().

◆ dump() [2/3]

void onert::dumper::dot::DotDumper::dump ( const ir::Graph graph,
const std::string &  tag 
)

Dump graph information to dot file as tag name if "GRAPH_DOT_DUMP" is set.

Parameters
[in]graphThe graph that would be used to get operations and operands
[in]tagThe name of dot file that would be created
Returns
N/A

Definition at line 200 of file DotDumper.cc.

201{
202 if (_level == Level::OFF)
203 {
204 return;
205 }
206
207 const auto dot_operands = generate_dot_operands(graph, _level);
208 const auto dot_operations = generate_dot_operations(graph, dot_operands);
209 dump_to_file(dot_operands, dot_operations, tag);
210}

Referenced by onert::compiler::Compiler::compile(), onert::compiler::MultiModelCompiler::compile(), and onert::compiler::train::TrainingCompiler::compile().

◆ dump() [3/3]

void onert::dumper::dot::DotDumper::dump ( const ir::train::TrainableGraph graph,
const std::string &  tag 
)

Dump graph information to dot file as tag name if "GRAPH_DOT_DUMP" is set.

Parameters
[in]graphTrainableGraph to be dumped
[in]tagThe name of dot file to be dumped
Returns
N/A

Definition at line 227 of file DotDumper.cc.

228{
229 dump(graph.graph(), tag);
230}
void dump(const ir::Graph &graph, const std::string &tag)
Dump graph information to dot file as tag name if "GRAPH_DOT_DUMP" is set.
Definition DotDumper.cc:200

References dump().


The documentation for this class was generated from the following files: