aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/Holder.cpp
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.cpp
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.cpp')
-rw-r--r--src/profiling/Holder.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/profiling/Holder.cpp b/src/profiling/Holder.cpp
new file mode 100644
index 0000000000..9def49d22e
--- /dev/null
+++ b/src/profiling/Holder.cpp
@@ -0,0 +1,57 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#include "Holder.hpp"
+
+namespace armnn
+{
+
+namespace profiling
+{
+
+CaptureData& CaptureData::operator= (const CaptureData& captureData)
+{
+ m_CapturePeriod = captureData.m_CapturePeriod;
+ m_CounterIds = captureData.m_CounterIds;
+
+ return *this;
+}
+
+void CaptureData::SetCapturePeriod(uint32_t capturePeriod)
+{
+ m_CapturePeriod = capturePeriod;
+}
+
+void CaptureData::SetCounterIds(std::vector<uint16_t>& counterIds)
+{
+ m_CounterIds = counterIds;
+}
+
+std::uint32_t CaptureData::GetCapturePeriod() const
+{
+ return m_CapturePeriod;
+}
+
+std::vector<uint16_t> CaptureData::GetCounterIds() const
+{
+ return m_CounterIds;
+}
+
+CaptureData Holder::GetCaptureData() const
+{
+ std::lock_guard<std::mutex> lockGuard(m_CaptureThreadMutex);
+ return m_CaptureData;
+}
+
+void Holder::SetCaptureData(uint32_t capturePeriod, std::vector<uint16_t>& counterIds)
+{
+ std::lock_guard<std::mutex> lockGuard(m_CaptureThreadMutex);
+ m_CaptureData.SetCapturePeriod(capturePeriod);
+ m_CaptureData.SetCounterIds(counterIds);
+}
+
+} // namespace profiling
+
+} // namespace armnn \ No newline at end of file