aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/PacketBuffer.hpp
diff options
context:
space:
mode:
authorNarumol Prangnawarat <narumol.prangnawarat@arm.com>2019-09-27 18:00:11 +0100
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-09-30 14:00:10 +0000
commit7be47efac07b6276f02a17cb486f9061a426a837 (patch)
treeb63cc8dddef79b6540c9b2abae03055bf85bb685 /src/profiling/PacketBuffer.hpp
parentaab82c5ebc5b65f5f5f657d7bee6bd60f106d3b9 (diff)
downloadarmnn-7be47efac07b6276f02a17cb486f9061a426a837.tar.gz
IVGCVSW-3903 Create Counter Stream Buffer
* Add implementation of PacketBuffer * Add implementation of BufferManager * Unit tests Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: Icca3807149ff5a8ed31cc87de73c50b95bca39d4
Diffstat (limited to 'src/profiling/PacketBuffer.hpp')
-rw-r--r--src/profiling/PacketBuffer.hpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/profiling/PacketBuffer.hpp b/src/profiling/PacketBuffer.hpp
new file mode 100644
index 0000000000..a3d95d4108
--- /dev/null
+++ b/src/profiling/PacketBuffer.hpp
@@ -0,0 +1,45 @@
+//
+// Copyright © 2019 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+#include "IPacketBuffer.hpp"
+
+#include <memory>
+
+namespace armnn
+{
+
+namespace profiling
+{
+
+class PacketBuffer : public IPacketBuffer
+{
+public:
+ PacketBuffer(unsigned int maxSize);
+
+ ~PacketBuffer() {}
+
+ const unsigned char* const GetReadableData() const override;
+
+ unsigned int GetSize() const override;
+
+ void MarkRead() override;
+
+ void Commit(unsigned int size) override;
+
+ void Release() override;
+
+ unsigned char* GetWritableData() override;
+
+private:
+ unsigned int m_MaxSize;
+ unsigned int m_Size;
+ std::unique_ptr<unsigned char[]> m_Data;
+};
+
+} // namespace profiling
+
+} // namespace armnn \ No newline at end of file