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

Public Member Functions

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

Detailed Description

Definition at line 26 of file MetadataPrinter.cpp.

Member Function Documentation

◆ print()

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

source table consists of following parts

  • [ entry_number : uint32_t ]
  • [ id : uint32_t ][ length : uint32_t ][ data : 'length' Bytes ] * entry_number

Implements circledump::MetadataPrinter.

Definition at line 34 of file MetadataPrinter.cpp.

35 {
36 if (buffer)
37 {
38 os << " [node_id : node_name]" << std::endl;
39 auto cur = buffer;
40 // entry number
41 const uint32_t num = *reinterpret_cast<const uint32_t *>(cur);
42 cur += sizeof(uint32_t);
43 for (uint32_t entry = 0; entry < num; entry++)
44 {
45 // id
46 const uint32_t node_id = *reinterpret_cast<const uint32_t *>(cur);
47 cur += sizeof(uint32_t);
48 // length
49 const uint32_t len = *reinterpret_cast<const uint32_t *>(cur);
50 cur += sizeof(uint32_t);
51 assert(len != 0);
52 // data
53 // non-empty 'data' has trailing '\0'. Let's exclude it.
54 std::string node_name = std::string(cur, cur + len - 1);
55 cur += len;
56
57 // print
58 os << " [" << node_id << " : " << node_name << "]" << std::endl;
59 }
60 }
61 }
int entry(const int argc, char **argv)
Definition Driver.cpp:53

References entry().


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