aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/PeriodicCounterCapture.hpp
diff options
context:
space:
mode:
authorFrancis Murtagh <francis.murtagh@arm.com>2019-09-20 15:40:09 +0100
committerFrancis Murtagh <francis.murtagh@arm.com>2019-09-20 15:30:54 +0000
commitfcb8ef6b36873d06ddae7553aad28e726aa5be33 (patch)
tree4c1cf74a38ebfcf8c134bdb1b25568c04ca90e09 /src/profiling/PeriodicCounterCapture.hpp
parentda9d2d34ae57e18f631d4b42ad694a1d48270fe7 (diff)
downloadarmnn-fcb8ef6b36873d06ddae7553aad28e726aa5be33.tar.gz
IVGCVSW-3433 Create the Periodic Counter Capture Thread
* Add Periodic counter thread object * Add Unit test for thread * Move MockBuffer to header file to allow reuse Change-Id: Id2a8ea636723ab35e8a50efc200c8c76059bba02 Signed-off-by: Ferran Balaguer <ferran.balaguer@arm.com> Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
Diffstat (limited to 'src/profiling/PeriodicCounterCapture.hpp')
-rw-r--r--src/profiling/PeriodicCounterCapture.hpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/profiling/PeriodicCounterCapture.hpp b/src/profiling/PeriodicCounterCapture.hpp
new file mode 100644
index 0000000000..8a7ff37bf9
--- /dev/null
+++ b/src/profiling/PeriodicCounterCapture.hpp
@@ -0,0 +1,48 @@
+//
+// Copyright © 2019 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+#include "Holder.hpp"
+#include "IPeriodicCounterCapture.hpp"
+#include "Packet.hpp"
+#include "IReadCounterValue.hpp"
+#include "SendCounterPacket.hpp"
+
+#include "WallClockTimer.hpp"
+
+#include <atomic>
+#include <chrono>
+#include <mutex>
+#include <thread>
+
+namespace armnn
+{
+
+namespace profiling
+{
+
+class PeriodicCounterCapture final : public IPeriodicCounterCapture
+{
+public:
+ PeriodicCounterCapture(const Holder& data, ISendCounterPacket& packet, const IReadCounterValue& readCounterValue);
+
+ void Start() override;
+ void Join();
+
+private:
+ CaptureData ReadCaptureData();
+ void Functionality(const IReadCounterValue& readCounterValue);
+
+ const Holder& m_CaptureDataHolder;
+ std::atomic<bool> m_IsRunning;
+ std::thread m_PeriodCaptureThread;
+ const IReadCounterValue& m_ReadCounterValue;
+ ISendCounterPacket& m_SendCounterPacket;
+};
+
+} // namespace profiling
+
+} // namespace armnn