From df31cfe29f9dccc4c2055a1d2a97de644b07d522 Mon Sep 17 00:00:00 2001 From: Narumol Prangnawarat Date: Fri, 22 Nov 2019 11:26:06 +0000 Subject: 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 Change-Id: I0194f2037c236450c912f4c3cb11e46b80c0f512 --- src/profiling/test/ProfilingTestUtils.hpp | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 src/profiling/test/ProfilingTestUtils.hpp (limited to 'src/profiling/test/ProfilingTestUtils.hpp') diff --git a/src/profiling/test/ProfilingTestUtils.hpp b/src/profiling/test/ProfilingTestUtils.hpp new file mode 100644 index 0000000000..7fb5d62591 --- /dev/null +++ b/src/profiling/test/ProfilingTestUtils.hpp @@ -0,0 +1,70 @@ +// +// Copyright © 2019 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include "ProfilingUtils.hpp" + +#include +#include +#include +#include +#include + +using namespace armnn; +using namespace armnn::profiling; + +inline unsigned int OffsetToNextWord(unsigned int numberOfBytes); + +void VerifyTimelineLabelBinaryPacket(Optional guid, + const std::string& label, + const unsigned char* readableData, + unsigned int& offset); + +void VerifyTimelineEventClassBinaryPacket(ProfilingGuid guid, + const unsigned char* readableData, + unsigned int& offset); + +void VerifyTimelineRelationshipBinaryPacket(ProfilingRelationshipType relationshipType, + Optional relationshipGuid, + Optional headGuid, + Optional tailGuid, + const unsigned char* readableData, + unsigned int& offset); + +void VerifyTimelineEntityBinaryPacket(Optional guid, + const unsigned char* readableData, + unsigned int& offset); + +void VerifyTimelineEventBinaryPacket(Optional timestamp, + Optional threadId, + Optional eventGuid, + const unsigned char* readableData, + unsigned int& offset); + +void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId); + +namespace armnn +{ + +namespace profiling +{ + +class ProfilingServiceRuntimeHelper : public ProfilingService +{ +public: + ProfilingServiceRuntimeHelper() = default; + ~ProfilingServiceRuntimeHelper() = default; + + BufferManager& GetProfilingBufferManager() + { + return GetBufferManager(ProfilingService::Instance()); + } +}; + +} // namespace profiling + +} // namespace armnn + -- cgit v1.2.1