aboutsummaryrefslogtreecommitdiff
path: root/tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.cpp
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2020-07-20 16:57:44 +0100
committerJim Flynn <jim.flynn@arm.com>2020-07-29 15:35:15 +0100
commitbbfe603e5ae42317a2b67d713d00882bea341c88 (patch)
tree8d8a78d6836384fb92fb9741c865443624dfec68 /tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.cpp
parenta9c2ce123a6a5a68728d040a0323c482bbe46903 (diff)
downloadarmnn-bbfe603e5ae42317a2b67d713d00882bea341c88.tar.gz
IVGCVSW-5166 Pull out the common and server side code into standalone libraries
Change-Id: I180f84c493a9b2be4b93b25d312ebdd9e71b1735 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.cpp')
-rw-r--r--tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.cpp40
1 files changed, 19 insertions, 21 deletions
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 <ProfilingUtils.hpp>
+#include <common/include/CommonProfilingUtils.hpp>
-#include <boost/numeric/conversion/cast.hpp>
+#include <armnn/utility/NumericCast.hpp>
#include <iostream>
@@ -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<uint16_t> counterIds;
std::vector<uint32_t> counterValues;
- uint32_t sizeOfUint64 = numeric_cast<uint32_t>(sizeof(uint64_t));
- uint32_t sizeOfUint32 = numeric_cast<uint32_t>(sizeof(uint32_t));
- uint32_t sizeOfUint16 = numeric_cast<uint32_t>(sizeof(uint16_t));
+ uint32_t sizeOfUint64 = armnn::numeric_cast<uint32_t>(sizeof(uint64_t));
+ uint32_t sizeOfUint32 = armnn::numeric_cast<uint32_t>(sizeof(uint32_t));
+ uint32_t sizeOfUint16 = armnn::numeric_cast<uint32_t>(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<const unsigned char*>(packet.GetData()), offset);
+ uint64_t timestamp = arm::pipe::ReadUint64(reinterpret_cast<const unsigned char*>(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<const unsigned char*>(packet.GetData()), offset));
+ arm::pipe::ReadUint16(reinterpret_cast<const unsigned char*>(packet.GetData()), offset));
offset += sizeOfUint16;
counterValues.emplace_back(
- profiling::ReadUint32(reinterpret_cast<const unsigned char*>(packet.GetData()), offset));
+ arm::pipe::ReadUint32(reinterpret_cast<const unsigned char*>(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<int>(uidString.size())));
+ header.append(arm::pipe::CentreAlignFormatting("UID's", static_cast<int>(uidString.size())));
header.append(" | ");
- header.append(profiling::CentreAlignFormatting("Values", 10));
+ header.append(arm::pipe::CentreAlignFormatting("Values", 10));
header.append("\n");
std::cout << header;