aboutsummaryrefslogtreecommitdiff
path: root/tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.hpp')
-rw-r--r--tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.hpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.hpp b/tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.hpp
new file mode 100644
index 0000000000..7f46d8e102
--- /dev/null
+++ b/tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.hpp
@@ -0,0 +1,54 @@
+//
+// Copyright © 2019 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+#include "../../armnn/src/profiling/Packet.hpp"
+#include "../../armnn/src/profiling/CommandHandlerFunctor.hpp"
+
+#include <vector>
+
+namespace armnn
+{
+
+namespace gatordmock
+{
+
+struct CounterCaptureValues
+{
+ uint64_t m_Timestamp;
+ std::vector<uint16_t> m_Uids;
+ std::vector<uint32_t> m_Values;
+};
+
+class PeriodicCounterCaptureCommandHandler : public profiling::CommandHandlerFunctor
+{
+
+public:
+ PeriodicCounterCaptureCommandHandler(uint32_t packetId,
+ uint32_t version,
+ bool echoPackets)
+ : CommandHandlerFunctor(packetId, version)
+ , m_EchoPackets(echoPackets)
+ {}
+
+ void operator()(const armnn::profiling::Packet& packet) override;
+
+ CounterCaptureValues m_CounterCaptureValues;
+
+ uint64_t m_CurrentPeriodValue = 0;
+
+private:
+ void ParseData(const armnn::profiling::Packet& packet);
+
+ uint64_t m_FirstTimestamp = 0, m_SecondTimestamp = 0;
+
+ bool m_HeaderPrinted = false;
+ bool m_EchoPackets;
+};
+
+} // namespace gatordmock
+
+} // namespace armnn \ No newline at end of file