diff options
author | Narumol Prangnawarat <narumol.prangnawarat@arm.com> | 2019-11-22 11:26:06 +0000 |
---|---|---|
committer | Jim Flynn Arm <jim.flynn@arm.com> | 2019-11-29 17:01:45 +0000 |
commit | df31cfe29f9dccc4c2055a1d2a97de644b07d522 (patch) | |
tree | 15e848d398c35e669ecb0cff574907c4bd1662b9 /src/profiling/TimelineUtilityMethods.hpp | |
parent | a68d8530d3dcfc7c54b9c2bfa00b407f45145253 (diff) | |
download | armnn-df31cfe29f9dccc4c2055a1d2a97de644b07d522.tar.gz |
IVGCVSW-4070 Implement "send post-optimized network structure"
* Send post-optimisation network structure if profiling service is enabled
* Refactor TimelineUtilityMethods
* Fix RecordEvent to link eventGuid with eventClassGuid
* Add common types and guid to LabelsAndEventClasses
* Add CreateRelationship to TimelineUtilityMethods
* Add CreateTypedEntity to TimelineUtilityMethods
* Add MarkEntityWithType to TimelineUtilityMethods
* Move VerifyTimeline functions to ProfilingTestUtils
* Post-optimisation network structure unit tests to Ref, Cl, Neon
Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com>
Change-Id: I0194f2037c236450c912f4c3cb11e46b80c0f512
Diffstat (limited to 'src/profiling/TimelineUtilityMethods.hpp')
-rw-r--r-- | src/profiling/TimelineUtilityMethods.hpp | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/src/profiling/TimelineUtilityMethods.hpp b/src/profiling/TimelineUtilityMethods.hpp index 3683ed3383..8e071611a2 100644 --- a/src/profiling/TimelineUtilityMethods.hpp +++ b/src/profiling/TimelineUtilityMethods.hpp @@ -17,18 +17,34 @@ namespace profiling class TimelineUtilityMethods { public: - TimelineUtilityMethods(ISendTimelinePacket& sendTimelinePacket) - : m_SendTimelinePacket(sendTimelinePacket) - {} + + // static factory method which will return a pointer to a timelie utility methods + // object if profiling is enabled. Otherwise will return a null unique_ptr + static std::unique_ptr<TimelineUtilityMethods> GetTimelineUtils(); + + TimelineUtilityMethods(std::unique_ptr<ISendTimelinePacket>& sendTimelinePacket) + : m_SendTimelinePacket(std::move(sendTimelinePacket)) {} + + TimelineUtilityMethods(TimelineUtilityMethods&& other) + : m_SendTimelinePacket(std::move(other.m_SendTimelinePacket)) {} + + TimelineUtilityMethods(const TimelineUtilityMethods& other) = delete; + + TimelineUtilityMethods& operator=(const TimelineUtilityMethods& other) = delete; + + TimelineUtilityMethods& operator=(TimelineUtilityMethods&& other) = default; + ~TimelineUtilityMethods() = default; void SendWellKnownLabelsAndEventClasses(); ProfilingDynamicGuid CreateNamedTypedEntity(const std::string& name, const std::string& type); - void CreateNamedTypedEntity(ProfilingDynamicGuid entityGuid, const std::string& name, const std::string& type); + void CreateNamedTypedEntity(ProfilingGuid entityGuid, const std::string& name, const std::string& type); + + void CreateNamedTypedEntity(ProfilingGuid entityGuid, const std::string& name, ProfilingStaticGuid typeGuid); - void CreateTypedLabel(ProfilingGuid entityGuid, const std::string& entityName, ProfilingStaticGuid labelTypeGuid); + void MarkEntityWithLabel(ProfilingGuid entityGuid, const std::string &labelName, ProfilingStaticGuid labelLinkGuid); ProfilingStaticGuid DeclareLabel(const std::string& labelName); @@ -40,15 +56,34 @@ public: const std::string& entityName, const std::string& entityType); - void CreateNamedTypedChildEntity(ProfilingDynamicGuid entityGuid, + void CreateNamedTypedChildEntity(ProfilingGuid entityGuid, ProfilingGuid parentEntityGuid, const std::string& entityName, const std::string& entityType); + void CreateNamedTypedChildEntity(ProfilingGuid entityGuid, + ProfilingGuid parentEntityGuid, + const std::string& entityName, + ProfilingStaticGuid typeGuid); + + ProfilingDynamicGuid CreateRelationship(ProfilingRelationshipType relationshipType, + ProfilingGuid headGuid, + ProfilingGuid tailGuid); + + ProfilingDynamicGuid CreateConnectionRelationship(ProfilingRelationshipType relationshipType, + ProfilingGuid headGuid, + ProfilingGuid tailGuid); + + void CreateTypedEntity(ProfilingGuid entityGuid, ProfilingStaticGuid typeGuid); + + void MarkEntityWithType(ProfilingGuid entityGuid, ProfilingStaticGuid typeNameGuid); + ProfilingDynamicGuid RecordEvent(ProfilingGuid entityGuid, ProfilingStaticGuid eventClassGuid); + void Commit() { m_SendTimelinePacket->Commit(); } + private: - ISendTimelinePacket& m_SendTimelinePacket; + std::unique_ptr<ISendTimelinePacket> m_SendTimelinePacket; }; } // namespace profiling |