ArmNN
 20.05
TimelineModel.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 
9 
10 #include <map>
11 #include <vector>
12 
13 namespace armnn
14 {
15 
16 namespace profiling
17 {
18 using LabelMap = std::map<uint64_t, ITimelineDecoder::Label>;
19 using Attribute = std::pair<std::string, std::string>;
20 using Attributes = std::map<std::string, Attribute>;
21 class Entity
22 {
23 public:
24  Entity(uint64_t guid) : m_Guid(guid) {}
25  uint64_t GetGuid() {return m_Guid;}
26  void AddChild(Entity* child)
27  {
28  if (child != nullptr)
29  {
30  m_Children.push_back(child);
31  }
32  }
33  void AddAttribute(const std::string& type, const std::string& value)
34  {
35  Attribute attr(type, value);
36  m_Attributes.emplace(type, attr);
37  }
38 private:
39  uint64_t m_Guid;
40  Attributes m_Attributes;
41  std::vector<Entity*> m_Children;
42 };
43 using Entities = std::map<uint64_t, Entity>;
45 {
46  ModelRelationship(const ITimelineDecoder::Relationship& relationship) : m_Relationship(relationship) {}
48  std::vector<Entity*> m_RelatedEntities;
49 };
50 using Relationships = std::map<uint64_t, ModelRelationship>;
52 {
53 public:
54  void AddLabel(const ITimelineDecoder::Label& label);
55  void AddEntity(uint64_t guid);
56  Entity* findEntity(uint64_t id);
57  void AddRelationship(const ITimelineDecoder::Relationship& relationship);
58  ModelRelationship* findRelationship(uint64_t id);
59 private:
60  LabelMap m_LabelMap;
61  Entities m_Entities;
62  Relationships m_Relationships;
63 };
64 
65 } // namespace profiling
66 
67 } // namespace armnn
std::map< uint64_t, ITimelineDecoder::Label > LabelMap
std::map< uint64_t, Entity > Entities
std::map< uint64_t, ModelRelationship > Relationships
ITimelineDecoder::Relationship m_Relationship
std::map< std::string, Attribute > Attributes
Copyright (c) 2020 ARM Limited.
std::pair< std::string, std::string > Attribute
void AddChild(Entity *child)
void AddAttribute(const std::string &type, const std::string &value)
std::vector< Entity * > m_RelatedEntities
ModelRelationship(const ITimelineDecoder::Relationship &relationship)