aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/ProfilingUtils.hpp
diff options
context:
space:
mode:
authorNarumol Prangnawarat <narumol.prangnawarat@arm.com>2019-09-24 17:23:16 +0100
committerNarumol Prangnawarat <narumol.prangnawarat@arm.com>2019-09-26 22:52:32 +0100
commit404b27569523f4cdd49752e7ae1633e359ba2190 (patch)
treeb2acd65aae6b285cbacfafe7a83b8873a1a5e79e /src/profiling/ProfilingUtils.hpp
parente4ffe399de3445a1ecaf0ea8da7ff4f06ec878d3 (diff)
downloadarmnn-404b27569523f4cdd49752e7ae1633e359ba2190.tar.gz
IVGCVSW-3902 Create IReadOnlyPacketBuffer, IPacketBuffer and IBufferManager interfaces
* Create IReadOnlyPacketBuffer, IPacketBuffer and IBufferManager interfaces * Add Read and Write util functions that use IPacketBuffer * Add MockBufferManager using IBufferManager for testing * Modify SendCounterPacket to use IBufferManager * Modify MockStreamCounterBuffer to use IBufferManager * Remove IBufferWrapper and MockBuffer * Add MockPacketBuffer for testing * Modify unit tests to use the new interfaces Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: Ib86768187e032f07169aa39367a418b7665c9f03
Diffstat (limited to 'src/profiling/ProfilingUtils.hpp')
-rw-r--r--src/profiling/ProfilingUtils.hpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/profiling/ProfilingUtils.hpp b/src/profiling/ProfilingUtils.hpp
index fa96eea6e2..09b04f186f 100644
--- a/src/profiling/ProfilingUtils.hpp
+++ b/src/profiling/ProfilingUtils.hpp
@@ -7,12 +7,15 @@
#include <armnn/Exceptions.hpp>
+#include "IPacketBuffer.hpp"
+
#include <boost/numeric/conversion/cast.hpp>
-#include <string>
-#include <vector>
#include <algorithm>
#include <cstring>
+#include <memory>
+#include <string>
+#include <vector>
namespace armnn
{
@@ -80,19 +83,33 @@ uint16_t GetNextUid(bool peekOnly = false);
std::vector<uint16_t> GetNextCounterUids(uint16_t cores);
+void WriteUint64(const std::unique_ptr<IPacketBuffer>& packetBuffer, unsigned int offset, uint64_t value);
+
+void WriteUint32(const std::unique_ptr<IPacketBuffer>& packetBuffer, unsigned int offset, uint32_t value);
+
+void WriteUint16(const std::unique_ptr<IPacketBuffer>& packetBuffer, unsigned int offset, uint16_t value);
+
void WriteUint64(unsigned char* buffer, unsigned int offset, uint64_t value);
void WriteUint32(unsigned char* buffer, unsigned int offset, uint32_t value);
void WriteUint16(unsigned char* buffer, unsigned int offset, uint16_t value);
-uint64_t ReadUint64(const unsigned char* buffer, unsigned int offset);
+uint64_t ReadUint64(const std::unique_ptr<IPacketBuffer>& packetBuffer, unsigned int offset);
+
+uint32_t ReadUint32(const std::unique_ptr<IPacketBuffer>& packetBuffer, unsigned int offset);
+
+uint16_t ReadUint16(const std::unique_ptr<IPacketBuffer>& packetBuffer, unsigned int offset);
+
+uint8_t ReadUint8(const std::unique_ptr<IPacketBuffer>& packetBuffer, unsigned int offset);
+
+uint64_t ReadUint64(unsigned const char* buffer, unsigned int offset);
-uint32_t ReadUint32(const unsigned char* buffer, unsigned int offset);
+uint32_t ReadUint32(unsigned const char* buffer, unsigned int offset);
-uint16_t ReadUint16(const unsigned char* buffer, unsigned int offset);
+uint16_t ReadUint16(unsigned const char* buffer, unsigned int offset);
-uint8_t ReadUint8(const unsigned char* buffer, unsigned int offset);
+uint8_t ReadUint8(unsigned const char* buffer, unsigned int offset);
std::string GetSoftwareInfo();