From bbfe603e5ae42317a2b67d713d00882bea341c88 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Mon, 20 Jul 2020 16:57:44 +0100 Subject: IVGCVSW-5166 Pull out the common and server side code into standalone libraries Change-Id: I180f84c493a9b2be4b93b25d312ebdd9e71b1735 Signed-off-by: Jim Flynn --- .../PeriodicCounterCaptureCommandHandler.cpp | 40 ++++++++++------------ 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.cpp') diff --git a/tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.cpp b/tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.cpp index 9dd7064c90..fac813979d 100644 --- a/tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.cpp +++ b/tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.cpp @@ -1,13 +1,13 @@ // -// Copyright © 2019 Arm Ltd. All rights reserved. +// Copyright © 2019 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #include "PeriodicCounterCaptureCommandHandler.hpp" -#include +#include -#include +#include #include @@ -17,16 +17,14 @@ namespace armnn namespace gatordmock { -using boost::numeric_cast; - -void PeriodicCounterCaptureCommandHandler::ParseData(const armnn::profiling::Packet& packet) +void PeriodicCounterCaptureCommandHandler::ParseData(const arm::pipe::Packet& packet) { std::vector counterIds; std::vector counterValues; - uint32_t sizeOfUint64 = numeric_cast(sizeof(uint64_t)); - uint32_t sizeOfUint32 = numeric_cast(sizeof(uint32_t)); - uint32_t sizeOfUint16 = numeric_cast(sizeof(uint16_t)); + uint32_t sizeOfUint64 = armnn::numeric_cast(sizeof(uint64_t)); + uint32_t sizeOfUint32 = armnn::numeric_cast(sizeof(uint32_t)); + uint32_t sizeOfUint16 = armnn::numeric_cast(sizeof(uint16_t)); uint32_t offset = 0; @@ -34,7 +32,7 @@ void PeriodicCounterCaptureCommandHandler::ParseData(const armnn::profiling::Pac { offset = 0; - uint64_t timestamp = profiling::ReadUint64(reinterpret_cast(packet.GetData()), offset); + uint64_t timestamp = arm::pipe::ReadUint64(reinterpret_cast(packet.GetData()), offset); if (m_FirstTimestamp == 0) // detect the first timestamp we receive. { @@ -59,11 +57,11 @@ void PeriodicCounterCaptureCommandHandler::ParseData(const armnn::profiling::Pac for (unsigned int pos = 0; pos < counters; ++pos) { counterIds.emplace_back( - profiling::ReadUint16(reinterpret_cast(packet.GetData()), offset)); + arm::pipe::ReadUint16(reinterpret_cast(packet.GetData()), offset)); offset += sizeOfUint16; counterValues.emplace_back( - profiling::ReadUint32(reinterpret_cast(packet.GetData()), offset)); + arm::pipe::ReadUint32(reinterpret_cast(packet.GetData()), offset)); offset += sizeOfUint32; } } @@ -74,7 +72,7 @@ void PeriodicCounterCaptureCommandHandler::ParseData(const armnn::profiling::Pac } } -void PeriodicCounterCaptureCommandHandler::operator()(const profiling::Packet& packet) +void PeriodicCounterCaptureCommandHandler::operator()(const arm::pipe::Packet& packet) { ParseData(packet); if (!m_QuietOperation) // Are we supposed to print to stdout? @@ -93,24 +91,24 @@ void PeriodicCounterCaptureCommandHandler::operator()(const profiling::Packet& p valueString.append(", "); } - body.append(profiling::CentreAlignFormatting(std::to_string(m_CounterCaptureValues.m_Timestamp), 10)); + body.append(arm::pipe::CentreAlignFormatting(std::to_string(m_CounterCaptureValues.m_Timestamp), 10)); body.append(" | "); - body.append(profiling::CentreAlignFormatting(std::to_string(m_CurrentPeriodValue), 13)); + body.append(arm::pipe::CentreAlignFormatting(std::to_string(m_CurrentPeriodValue), 13)); body.append(" | "); - body.append(profiling::CentreAlignFormatting(uidString, 10)); + body.append(arm::pipe::CentreAlignFormatting(uidString, 10)); body.append(" | "); - body.append(profiling::CentreAlignFormatting(valueString, 10)); + body.append(arm::pipe::CentreAlignFormatting(valueString, 10)); body.append("\n"); if (!m_HeaderPrinted) { - header.append(profiling::CentreAlignFormatting(" Timestamp", 11)); + header.append(arm::pipe::CentreAlignFormatting(" Timestamp", 11)); header.append(" | "); - header.append(profiling::CentreAlignFormatting("Period (us)", 13)); + header.append(arm::pipe::CentreAlignFormatting("Period (us)", 13)); header.append(" | "); - header.append(profiling::CentreAlignFormatting("UID's", static_cast(uidString.size()))); + header.append(arm::pipe::CentreAlignFormatting("UID's", static_cast(uidString.size()))); header.append(" | "); - header.append(profiling::CentreAlignFormatting("Values", 10)); + header.append(arm::pipe::CentreAlignFormatting("Values", 10)); header.append("\n"); std::cout << header; -- cgit v1.2.1