From 7cbe78140a274cec783049051df7c7298b974f13 Mon Sep 17 00:00:00 2001 From: Mike Kelly Date: Tue, 25 Jul 2023 17:37:33 +0100 Subject: MLCE-1092 Add Names to Workloads * Added names to Workloads. * Workloads will be given the name of the Layer that created them. * Added new profiling macros to CL Neon and Ref that add the workload name to the event label * Updated workloads to use new macros. * Added missing profiling to Rank Workloads. * Fixed issue where ClConvolution2dWorkload was being reported as Undefined rather than GpuAcc. Signed-off-by: Mike Kelly Change-Id: I0a55eab6c2f455b73943aca8e99a247c3cb2a906 --- include/armnn/backends/IWorkload.hpp | 5 ++++- include/armnn/backends/Workload.hpp | 11 +++++++++-- include/armnn/backends/WorkloadInfo.hpp | 3 ++- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/armnn/backends/IWorkload.hpp b/include/armnn/backends/IWorkload.hpp index 78c0756945..7ffba5b327 100644 --- a/include/armnn/backends/IWorkload.hpp +++ b/include/armnn/backends/IWorkload.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once @@ -41,6 +41,9 @@ public: // Replace input tensor handle with the given TensorHandle virtual void ReplaceInputTensorHandle(ITensorHandle* /*input*/, unsigned int /*slot*/) = 0; + // Returns the name of the workload + virtual const std::string& GetName() const = 0; + // Replace output tensor handle with the given TensorHandle virtual void ReplaceOutputTensorHandle(ITensorHandle* /*output*/, unsigned int /*slot*/) = 0; diff --git a/include/armnn/backends/Workload.hpp b/include/armnn/backends/Workload.hpp index 9f7aad0b55..9d5fec98cd 100644 --- a/include/armnn/backends/Workload.hpp +++ b/include/armnn/backends/Workload.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2021-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once @@ -36,11 +36,17 @@ public: BaseWorkload(const QueueDescriptor& descriptor, const WorkloadInfo& info) : m_Data(descriptor), - m_Guid(arm::pipe::IProfilingService::GetNextGuid()) + m_Guid(arm::pipe::IProfilingService::GetNextGuid()), + m_Name(info.m_Name) { m_Data.Validate(info); } + virtual const std::string& GetName() const override + { + return m_Name; + } + void ExecuteAsync(ExecutionData& executionData) override { ARMNN_LOG(info) << "Using default async workload execution, this will network affect performance"; @@ -82,6 +88,7 @@ public: protected: QueueDescriptor m_Data; const arm::pipe::ProfilingGuid m_Guid; + const std::string m_Name; private: #if !defined(ARMNN_DISABLE_THREADS) diff --git a/include/armnn/backends/WorkloadInfo.hpp b/include/armnn/backends/WorkloadInfo.hpp index a7a1e1e81a..23a5172d83 100644 --- a/include/armnn/backends/WorkloadInfo.hpp +++ b/include/armnn/backends/WorkloadInfo.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once @@ -20,6 +20,7 @@ struct WorkloadInfo Optional m_WeightsTensorInfo = EmptyOptional(); Optional m_BiasTensorInfo = EmptyOptional(); Optional m_ConvolutionMethod = EmptyOptional(); + std::string m_Name; }; struct MemoryInfo -- cgit v1.2.1