aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/ProfilingUtils.cpp
diff options
context:
space:
mode:
authorFrancis Murtagh <francis.murtagh@arm.com>2019-09-04 15:25:02 +0100
committerFrancis Murtagh <francis.murtagh@arm.com>2019-09-05 11:11:20 +0100
commit3a161988ebb9e5406d2bcab6fc3a06f8545eb588 (patch)
treef51f8d18544a20362f671475bd0844d331a2a60e /src/profiling/ProfilingUtils.cpp
parent68f78d8ef0134aaaf10ee4db94e808f68f1ba2a8 (diff)
downloadarmnn-3a161988ebb9e5406d2bcab6fc3a06f8545eb588.tar.gz
IVGCVSW-3692 Implement SendPeriodicCounterCapturePacket() function
Change-Id: Ic976fc36955bec5e7721d1e34e89e7be79e23053 Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
Diffstat (limited to 'src/profiling/ProfilingUtils.cpp')
-rw-r--r--src/profiling/ProfilingUtils.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/profiling/ProfilingUtils.cpp b/src/profiling/ProfilingUtils.cpp
index 4dec7be6f2..b948026f42 100644
--- a/src/profiling/ProfilingUtils.cpp
+++ b/src/profiling/ProfilingUtils.cpp
@@ -13,6 +13,20 @@ namespace armnn
namespace profiling
{
+void WriteUint64(unsigned char* buffer, unsigned int offset, uint64_t value)
+{
+ BOOST_ASSERT(buffer);
+
+ buffer[offset] = static_cast<unsigned char>(value & 0xFF);
+ buffer[offset + 1] = static_cast<unsigned char>((value >> 8) & 0xFF);
+ buffer[offset + 2] = static_cast<unsigned char>((value >> 16) & 0xFF);
+ buffer[offset + 3] = static_cast<unsigned char>((value >> 24) & 0xFF);
+ buffer[offset + 4] = static_cast<unsigned char>((value >> 32) & 0xFF);
+ buffer[offset + 5] = static_cast<unsigned char>((value >> 40) & 0xFF);
+ buffer[offset + 6] = static_cast<unsigned char>((value >> 48) & 0xFF);
+ buffer[offset + 7] = static_cast<unsigned char>((value >> 56) & 0xFF);
+}
+
void WriteUint32(unsigned char* buffer, unsigned int offset, uint32_t value)
{
BOOST_ASSERT(buffer);
@@ -31,6 +45,23 @@ void WriteUint16(unsigned char* buffer, unsigned int offset, uint16_t value)
buffer[offset + 1] = static_cast<unsigned char>((value >> 8) & 0xFF);
}
+uint64_t ReadUint64(const unsigned char* buffer, unsigned int offset)
+{
+ BOOST_ASSERT(buffer);
+
+ uint64_t value = 0;
+ value = static_cast<uint64_t>(buffer[offset]);
+ value |= static_cast<uint64_t>(buffer[offset + 1]) << 8;
+ value |= static_cast<uint64_t>(buffer[offset + 2]) << 16;
+ value |= static_cast<uint64_t>(buffer[offset + 3]) << 24;
+ value |= static_cast<uint64_t>(buffer[offset + 4]) << 32;
+ value |= static_cast<uint64_t>(buffer[offset + 5]) << 40;
+ value |= static_cast<uint64_t>(buffer[offset + 6]) << 48;
+ value |= static_cast<uint64_t>(buffer[offset + 7]) << 56;
+
+ return value;
+}
+
uint32_t ReadUint32(const unsigned char* buffer, unsigned int offset)
{
BOOST_ASSERT(buffer);