From 75c14f4241b0225640ee6011a41ed0102f4e742c Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Thu, 10 Mar 2022 22:05:42 +0000 Subject: IVGCVSW-6841 Replace armnn::numeric_cast with arm::pipe::numeric_cast in profiling code Change-Id: Ib3115694608dee59ced8dc31077e16fe19d0dfea Signed-off-by: Jim Flynn --- src/profiling/ProfilingUtils.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/profiling/ProfilingUtils.cpp') diff --git a/src/profiling/ProfilingUtils.cpp b/src/profiling/ProfilingUtils.cpp index d827500a3c..993585a566 100644 --- a/src/profiling/ProfilingUtils.cpp +++ b/src/profiling/ProfilingUtils.cpp @@ -15,6 +15,8 @@ #include +#include + #include #include #include @@ -288,7 +290,7 @@ TimelinePacketStatus WriteTimelineLabelBinaryPacket(uint64_t profilingGuid, } // Calculate the size of the SWTrace string label (in bytes) - unsigned int swTraceLabelSize = armnn::numeric_cast(swTraceLabel.size()) * uint32_t_size; + unsigned int swTraceLabelSize = arm::pipe::numeric_cast(swTraceLabel.size()) * uint32_t_size; // Calculate the length of the data (in bytes) unsigned int timelineLabelPacketDataLength = uint32_t_size + // decl_Id @@ -491,7 +493,7 @@ TimelinePacketStatus WriteTimelineMessageDirectoryPackage(unsigned char* buffer, uint32_t declId = 0; try { - declId = armnn::numeric_cast(std::stoul(directoryComponent[0])); + declId = arm::pipe::numeric_cast(std::stoul(directoryComponent[0])); } catch (const std::exception&) { @@ -515,7 +517,7 @@ TimelinePacketStatus WriteTimelineMessageDirectoryPackage(unsigned char* buffer, } unsigned int dataLength = 3 * uint8_t_size + // Stream header (3 bytes) - armnn::numeric_cast(swTraceBuffer.size()) * + arm::pipe::numeric_cast(swTraceBuffer.size()) * uint32_t_size; // Trace directory (5 messages) // Calculate the timeline directory binary packet size (in bytes) @@ -529,7 +531,7 @@ TimelinePacketStatus WriteTimelineMessageDirectoryPackage(unsigned char* buffer, } // Create packet header - auto packetHeader = CreateTimelinePacketHeader(1, 0, 0, 0, 0, armnn::numeric_cast(dataLength)); + auto packetHeader = CreateTimelinePacketHeader(1, 0, 0, 0, 0, arm::pipe::numeric_cast(dataLength)); // Initialize the offset for writing in the buffer unsigned int offset = 0; @@ -542,8 +544,8 @@ TimelinePacketStatus WriteTimelineMessageDirectoryPackage(unsigned char* buffer, // Write the stream header uint8_t streamVersion = 4; - uint8_t pointerBytes = armnn::numeric_cast(uint64_t_size); // All GUIDs are uint64_t - uint8_t threadIdBytes = armnn::numeric_cast(ThreadIdSize); + uint8_t pointerBytes = arm::pipe::numeric_cast(uint64_t_size); // All GUIDs are uint64_t + uint8_t threadIdBytes = arm::pipe::numeric_cast(ThreadIdSize); switch (threadIdBytes) { case 4: // Typically Windows and Android @@ -560,7 +562,7 @@ TimelinePacketStatus WriteTimelineMessageDirectoryPackage(unsigned char* buffer, offset += uint8_t_size; // Write the SWTrace directory - uint32_t numberOfDeclarations = armnn::numeric_cast(timelineDirectoryMessages.size()); + uint32_t numberOfDeclarations = arm::pipe::numeric_cast(timelineDirectoryMessages.size()); WriteUint32(buffer, offset, numberOfDeclarations); // Number of declarations offset += uint32_t_size; for (uint32_t i : swTraceBuffer) -- cgit v1.2.1