ONE - On-device Neural Engine
Loading...
Searching...
No Matches
InstrPrinter Struct Referencefinal
Collaboration diagram for InstrPrinter:

Public Member Functions

 InstrPrinter ()=delete
 
 InstrPrinter (int indent)
 
void visit (const coco::Eval *ins) override
 
void visit (const coco::Copy *ins) override
 
void visit (const coco::Shuffle *ins) override
 
- Public Member Functions inherited from coco::Instr::Visitor< pp::LinearDocument >
virtual ~Visitor ()=default
 
- Public Member Functions inherited from coco::Instr::IVisitor< T >
virtual ~IVisitor ()=default
 
- Public Member Functions inherited from coco::Instr::Visitor< void >
virtual ~Visitor ()=default
 

Detailed Description

Definition at line 137 of file Dump.cpp.

Constructor & Destructor Documentation

◆ InstrPrinter() [1/2]

InstrPrinter::InstrPrinter ( )
delete

◆ InstrPrinter() [2/2]

InstrPrinter::InstrPrinter ( int  indent)
inline

Definition at line 142 of file Dump.cpp.

142: _indent(indent) {}

Member Function Documentation

◆ visit() [1/3]

void InstrPrinter::visit ( const coco::Copy ins)
inlineoverride

Definition at line 156 of file Dump.cpp.

157 {
158 // copy is Producer and also Customer. We will use address for Producer
159 std::cout << tab(_indent) << "Copy (" << dynamic_cast<const coco::Instr *>(ins) << ")"
160 << std::endl;
161 std::cout << tab(_indent) << " from: " << ins->from() << std::endl;
162 std::cout << tab(_indent) << " into: " << ins->into() << std::endl;
163 }
Object * from(void) const
Definition Instrs.h:100
Object * into(void) const
Definition Instrs.h:104
Base interface on explicit computation steps in coco IR.
Definition Instr.h:57
std::string tab(int n)
Definition Dump.cpp:38

References coco::Copy::from(), coco::Copy::into(), and tab().

◆ visit() [2/3]

void InstrPrinter::visit ( const coco::Eval ins)
inlineoverride

Definition at line 144 of file Dump.cpp.

145 {
146 std::cout << tab(_indent) << "Eval (" << dynamic_cast<const coco::Instr *>(ins) << ")"
147 << std::endl;
148 std::cout << tab(_indent + 1) << "out: " << ins->out() << std::endl;
149 std::cout << tab(_indent + 1) << "<op>: " << std::endl;
150 {
151 OpPrinter prn(std::cout, _indent + 2);
152 ins->op()->accept(prn);
153 }
154 }
Op * op(void) const
Definition Instrs.h:59
Object * out(void) const
Definition Instrs.h:55
T accept(IVisitor< T > *v) const
Definition Op.h:101

References coco::Op::accept(), coco::Eval::op(), coco::Eval::out(), and tab().

◆ visit() [3/3]

void InstrPrinter::visit ( const coco::Shuffle ins)
inlineoverride

Definition at line 165 of file Dump.cpp.

166 {
167 std::cout << tab(_indent) << "Shuffle (" << dynamic_cast<const coco::Instr *>(ins) << ")"
168 << std::endl;
169 std::cout << tab(_indent) << " from: " << ins->from() << std::endl;
170 std::cout << tab(_indent) << " into: " << ins->into() << std::endl;
171 }
Bag * from(void) const
Definition Instrs.h:131
Bag * into(void) const
Definition Instrs.h:135

References coco::Shuffle::from(), coco::Shuffle::into(), and tab().


The documentation for this struct was generated from the following file: