ArmNN
 20.05
ITimelineDecoder.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2020 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <cstdint>
9 #include <string>
10 
12 {
13 
14 public:
15 
16  enum class TimelineStatus
17  {
20  };
21 
22  enum class RelationshipType
23  {
24  RetentionLink, /// Head retains(parents) Tail
25  ExecutionLink, /// Head execution start depends on Tail execution completion
26  DataLink, /// Head uses data of Tail
27  LabelLink /// Head uses label Tail (Tail MUST be a guid of a label).
28  };
29 
30  static char const* GetRelationshipAsCString(RelationshipType rType)
31  {
32  switch (rType)
33  {
34  case RelationshipType::RetentionLink: return "RetentionLink";
35  case RelationshipType::ExecutionLink: return "ExecutionLink";
36  case RelationshipType::DataLink: return "DataLink";
37  case RelationshipType::LabelLink: return "LabelLink";
38  default: return "Unknown";
39  }
40  }
41 
42  struct Entity
43  {
44  uint64_t m_Guid;
45  };
46 
47  struct EventClass
48  {
49  uint64_t m_Guid;
50  };
51 
52  struct Event
53  {
54  uint64_t m_Guid;
55  uint64_t m_TimeStamp;
56  uint64_t m_ThreadId;
57  };
58 
59  struct Label
60  {
61  uint64_t m_Guid;
62  std::string m_Name;
63  };
64 
65  struct Relationship
66  {
68  uint64_t m_Guid;
69  uint64_t m_HeadGuid;
70  uint64_t m_TailGuid;
71  };
72 
73  virtual ~ITimelineDecoder() = default;
74 
75  virtual TimelineStatus CreateEntity(const Entity&) = 0;
76  virtual TimelineStatus CreateEventClass(const EventClass&) = 0;
77  virtual TimelineStatus CreateEvent(const Event&) = 0;
78  virtual TimelineStatus CreateLabel(const Label&) = 0;
80 };
Head execution start depends on Tail execution completion.
virtual TimelineStatus CreateEvent(const Event &)=0
virtual TimelineStatus CreateLabel(const Label &)=0
virtual TimelineStatus CreateRelationship(const Relationship &)=0
virtual TimelineStatus CreateEntity(const Entity &)=0
virtual TimelineStatus CreateEventClass(const EventClass &)=0
static char const * GetRelationshipAsCString(RelationshipType rType)
virtual ~ITimelineDecoder()=default