ONE - On-device Neural Engine
Loading...
Searching...
No Matches
circledump::OpTablePrinter Class Reference
Collaboration diagram for circledump::OpTablePrinter:

Public Member Functions

virtual void print (const uint8_t *buffer, std::ostream &os) const override
 

Detailed Description

Definition at line 64 of file MetadataPrinter.cpp.

Member Function Documentation

◆ print()

virtual void circledump::OpTablePrinter::print ( const uint8_t *  buffer,
std::ostream &  os 
) const
inlineoverridevirtual

op table consists of following parts

  • [ entry_number : uint32_t ]
  • [ id : uint32_t ][ length : uint32_t ][ origin_ids : length * uint32_t ] * entry_number

Implements circledump::MetadataPrinter.

Definition at line 72 of file MetadataPrinter.cpp.

73 {
74 if (buffer)
75 {
76 os << " [node_id : origin_ids]" << std::endl;
77 auto cur = buffer;
78 // entry number
79 const uint32_t num = *reinterpret_cast<const uint32_t *>(cur);
80 cur += sizeof(uint32_t);
81 for (uint32_t entry = 0; entry < num; entry++)
82 {
83 // id
84 const uint32_t node_id = *reinterpret_cast<const uint32_t *>(cur);
85 cur += sizeof(uint32_t);
86 // length
87 const uint32_t len = *reinterpret_cast<const uint32_t *>(cur);
88 cur += sizeof(uint32_t);
89 assert(len != 0);
90 // origin_ids
91 std::vector<uint32_t> origin_ids;
92 for (uint32_t o = 0; o < len; o++)
93 {
94 origin_ids.push_back(*reinterpret_cast<const uint32_t *>(cur));
95 cur += sizeof(uint32_t);
96 }
97
98 // print
99 os << " [" << node_id << " : ";
100 uint32_t i = 0;
101 for (const auto &id : origin_ids)
102 {
103 if (i++)
104 os << ", ";
105 os << id;
106 }
107 os << "]" << std::endl;
108 }
109 }
110 }
int entry(const int argc, char **argv)
Definition Driver.cpp:53

References entry().


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