aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/Holder.hpp
diff options
context:
space:
mode:
authorFrancis Murtagh <francis.murtagh@arm.com>2019-09-04 16:42:29 +0100
committerFrancis Murtagh <francis.murtagh@arm.com>2019-09-04 16:42:29 +0100
commit68f78d8ef0134aaaf10ee4db94e808f68f1ba2a8 (patch)
tree26da6b0ceb773b9c60a2c7d592d1d63d1b8056eb /src/profiling/Holder.hpp
parent23ae2eae1caefba4948e6afda154a66238b26c2a (diff)
downloadarmnn-68f78d8ef0134aaaf10ee4db94e808f68f1ba2a8.tar.gz
IVGCVSW-3432 Create CaptureData Holder
* Create CaptureData and Holder classes * Add unit test Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com> Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: I9f2766a8a6081ae4f9988904af2ca24cd434ebca
Diffstat (limited to 'src/profiling/Holder.hpp')
-rw-r--r--src/profiling/Holder.hpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/profiling/Holder.hpp b/src/profiling/Holder.hpp
new file mode 100644
index 0000000000..c22c72a929
--- /dev/null
+++ b/src/profiling/Holder.hpp
@@ -0,0 +1,53 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+#pragma once
+
+#include <mutex>
+#include <vector>
+
+namespace armnn
+{
+
+namespace profiling
+{
+
+class CaptureData
+{
+public:
+ CaptureData()
+ : m_CapturePeriod(0), m_CounterIds() {};
+ CaptureData(uint32_t capturePeriod, std::vector<uint16_t>& counterIds)
+ : m_CapturePeriod(capturePeriod), m_CounterIds(counterIds) {};
+ CaptureData(const CaptureData& captureData)
+ : m_CapturePeriod(captureData.m_CapturePeriod), m_CounterIds(captureData.m_CounterIds) {};
+
+ CaptureData& operator= (const CaptureData& captureData);
+
+ void SetCapturePeriod(uint32_t capturePeriod);
+ void SetCounterIds(std::vector<uint16_t>& counterIds);
+ uint32_t GetCapturePeriod() const;
+ std::vector<uint16_t> GetCounterIds() const;
+
+private:
+ uint32_t m_CapturePeriod;
+ std::vector<uint16_t> m_CounterIds;
+};
+
+class Holder
+{
+public:
+ Holder()
+ : m_CaptureData() {};
+ CaptureData GetCaptureData() const;
+ void SetCaptureData(uint32_t capturePeriod, std::vector<uint16_t>& counterIds);
+
+private:
+ mutable std::mutex m_CaptureThreadMutex;
+ CaptureData m_CaptureData;
+};
+
+} // namespace profiling
+
+} // namespace armnn