aboutsummaryrefslogtreecommitdiff
path: root/profiling/client/src/RegisterBackendCounters.hpp
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2022-03-23 23:01:26 +0000
committerJim Flynn <jim.flynn@arm.com>2022-03-23 23:43:35 +0000
commit3e9bc19ad523361e6b18057849e30c0c48183915 (patch)
treeb7b012a9734ce39d054fc5d92302780fd838e5c8 /profiling/client/src/RegisterBackendCounters.hpp
parent277618302d0f131eac0b6ac2015dd3eb09aa6ff9 (diff)
downloadarmnn-3e9bc19ad523361e6b18057849e30c0c48183915.tar.gz
IVGCVSW-6706 Create the libpipeClient library
Change-Id: I2368aade38ad3808fab55d8a86cd659d4e95d91e Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'profiling/client/src/RegisterBackendCounters.hpp')
-rw-r--r--profiling/client/src/RegisterBackendCounters.hpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/profiling/client/src/RegisterBackendCounters.hpp b/profiling/client/src/RegisterBackendCounters.hpp
new file mode 100644
index 0000000000..f48f1ca8f0
--- /dev/null
+++ b/profiling/client/src/RegisterBackendCounters.hpp
@@ -0,0 +1,67 @@
+//
+// Copyright © 2020 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+#include <client/include/CounterIdMap.hpp>
+#include <client/include/IProfilingService.hpp>
+
+#include <client/include/backends/IBackendProfiling.hpp>
+
+#include <common/include/CounterDirectory.hpp>
+
+namespace arm
+{
+
+namespace pipe
+{
+
+class RegisterBackendCounters : public IRegisterBackendCounters
+{
+public:
+
+ RegisterBackendCounters(
+ uint16_t currentMaxGlobalCounterID, const std::string& backendId, IProfilingService& profilingService)
+ : m_CurrentMaxGlobalCounterID(currentMaxGlobalCounterID),
+ m_BackendId(backendId),
+ m_ProfilingService(profilingService),
+ m_CounterDirectory(m_ProfilingService.GetCounterRegistry()) {}
+
+ ~RegisterBackendCounters() = default;
+
+ void RegisterCategory(const std::string& categoryName) override;
+
+ uint16_t RegisterDevice(const std::string& deviceName,
+ uint16_t cores = 0,
+ const arm::pipe::Optional<std::string>& parentCategoryName =
+ arm::pipe::EmptyOptional()) override;
+
+ uint16_t RegisterCounterSet(const std::string& counterSetName,
+ uint16_t count = 0,
+ const arm::pipe::Optional<std::string>& parentCategoryName
+ = arm::pipe::EmptyOptional()) override;
+
+ uint16_t RegisterCounter(const uint16_t uid,
+ const std::string& parentCategoryName,
+ uint16_t counterClass,
+ uint16_t interpolation,
+ double multiplier,
+ const std::string& name,
+ const std::string& description,
+ const arm::pipe::Optional<std::string>& units = arm::pipe::EmptyOptional(),
+ const arm::pipe::Optional<uint16_t>& numberOfCores = arm::pipe::EmptyOptional(),
+ const arm::pipe::Optional<uint16_t>& deviceUid = arm::pipe::EmptyOptional(),
+ const arm::pipe::Optional<uint16_t>& counterSetUid = arm::pipe::EmptyOptional()) override;
+
+private:
+ uint16_t m_CurrentMaxGlobalCounterID;
+ const std::string& m_BackendId;
+ IProfilingService& m_ProfilingService;
+ ICounterRegistry& m_CounterDirectory;
+};
+
+} // namespace pipe
+
+} // namespace arm