diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-10-28 15:24:34 +0000 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-10-30 09:55:44 +0000 |
commit | c04019985db1ee44c71834892ad17365185a3f8d (patch) | |
tree | 88c14371ea35118b5c0bd4d4b9f6b8c01d107840 /src/profiling/TimelineUtilityMethods.cpp | |
parent | 4d52775062995550b780040d7b79b827264b2175 (diff) | |
download | armnn-c04019985db1ee44c71834892ad17365185a3f8d.tar.gz |
IVGCVSW-4035 Add a CreateTypedLabel function
* Create new utility function in the TimelineUtilityMethods class
* Added unit tests
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Change-Id: I63704b94d5cc6861e4e160de2aae4ae497699dd2
Diffstat (limited to 'src/profiling/TimelineUtilityMethods.cpp')
-rw-r--r-- | src/profiling/TimelineUtilityMethods.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/profiling/TimelineUtilityMethods.cpp b/src/profiling/TimelineUtilityMethods.cpp index aa9f5a5635..b34b70f984 100644 --- a/src/profiling/TimelineUtilityMethods.cpp +++ b/src/profiling/TimelineUtilityMethods.cpp @@ -52,6 +52,39 @@ ProfilingStaticGuid TimelineUtilityMethods::DeclareLabel(const std::string& labe return labelGuid; } +void TimelineUtilityMethods::CreateTypedLabel(ProfilingGuid entityGuid, + const std::string& entityName, + ProfilingStaticGuid labelTypeGuid) +{ + // Check that the entity name is valid + if (entityName.empty()) + { + // The entity name is invalid + throw InvalidArgumentException("Invalid entity name, the entity name cannot be empty"); + } + + // Declare a label with the entity's name, this call throws in case of error + ProfilingGuid labelGuid = DeclareLabel(entityName); + + // Generate a GUID for the label relationship + ProfilingGuid relationshipGuid = ProfilingService::Instance().NextGuid(); + + // Send the new label link to the external profiling service, this call throws in case of error + m_SendTimelinePacket.SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink, + relationshipGuid, + entityGuid, + labelGuid); + + // Generate a GUID for the label relationship + ProfilingGuid relationshipLabelGuid = ProfilingService::Instance().NextGuid(); + + // Send the new label link to the external profiling service, this call throws in case of error + m_SendTimelinePacket.SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink, + relationshipLabelGuid, + relationshipGuid, + labelTypeGuid); +} + } // namespace profiling } // namespace armnn |