ONE - On-device Neural Engine
Loading...
Searching...
No Matches
locop::GenericNodeSummaryBuilder Class Referencefinal

Dialect-agnostic Node Summary Builder. More...

#include <GenericNodeSummaryBuilder.h>

Collaboration diagram for locop::GenericNodeSummaryBuilder:

Public Member Functions

 GenericNodeSummaryBuilder (const SymbolTable *tbl)
 
bool build (const loco::Node *node, locop::NodeSummary &out) const final
 
- Public Member Functions inherited from locop::NodeSummaryBuilder
virtual ~NodeSummaryBuilder ()=default
 

Detailed Description

Dialect-agnostic Node Summary Builder.

Definition at line 28 of file GenericNodeSummaryBuilder.h.

Constructor & Destructor Documentation

◆ GenericNodeSummaryBuilder()

locop::GenericNodeSummaryBuilder::GenericNodeSummaryBuilder ( const SymbolTable tbl)
inline

Definition at line 31 of file GenericNodeSummaryBuilder.h.

31 : _tbl{tbl}
32 {
33 // DO NOTHING
34 }

Member Function Documentation

◆ build()

bool locop::GenericNodeSummaryBuilder::build ( const loco::Node node,
locop::NodeSummary out 
) const
finalvirtual

Implements locop::NodeSummaryBuilder.

Definition at line 24 of file GenericNodeSummaryBuilder.cpp.

25{
26 out.opname(pp::fmt(node->dialect(), ".op_", node->opnum()));
27
28 for (uint32_t n = 0; n < node->arity(); ++n)
29 {
30 out.args().append(pp::fmt("arg", n), _tbl->lookup(node->arg(n)));
31 }
32
34
35 return true;
36}
virtual Node * arg(uint32_t N) const =0
Access N-th argument node.
virtual uint32_t arity(void) const =0
Return the number of arguments.
virtual const Dialect * dialect(void) const =0
Return "Dialect" identifier that this node belongs to.
virtual uint32_t opnum(void) const =0
void append(const ArgName &name, const ArgValue &value)
Definition NodeSummary.h:43
const OpName & opname(void) const
const State & state(void) const
const ArgDesc & args(void) const
Definition NodeSummary.h:94
virtual std::string lookup(const loco::Node *) const =0

References locop::ArgDesc::append(), loco::Node::arg(), locop::NodeDesc::args(), loco::Node::arity(), loco::Node::dialect(), locop::SymbolTable::lookup(), locop::NodeDesc::opname(), loco::Node::opnum(), locop::NodeDesc::PartiallyKnown, and locop::NodeDesc::state().


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