diff options
author | Francis Murtagh <francis.murtagh@arm.com> | 2019-09-20 15:40:09 +0100 |
---|---|---|
committer | Francis Murtagh <francis.murtagh@arm.com> | 2019-09-20 15:30:54 +0000 |
commit | fcb8ef6b36873d06ddae7553aad28e726aa5be33 (patch) | |
tree | 4c1cf74a38ebfcf8c134bdb1b25568c04ca90e09 /src/profiling/PeriodicCounterCapture.hpp | |
parent | da9d2d34ae57e18f631d4b42ad694a1d48270fe7 (diff) | |
download | armnn-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.hpp | 48 |
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 |