blob: 82678a162fbb34665cb5595554eb6c8de2fabc1e [file] [log] [blame]
Colm Donelan1aff3932020-02-05 17:48:59 +00001//
2// Copyright © 2020 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
James Conroy2dcd3fe2020-02-06 18:34:52 +00006#pragma once
7
Sadik Armagan3184c902020-03-18 10:57:30 +00008#include "ProfilingService.hpp"
Colm Donelan1aff3932020-02-05 17:48:59 +00009#include <armnn/backends/profiling/IBackendProfiling.hpp>
10
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000011namespace arm
Colm Donelan1aff3932020-02-05 17:48:59 +000012{
13
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000014namespace pipe
Colm Donelan1aff3932020-02-05 17:48:59 +000015{
16
17class BackendProfiling : public IBackendProfiling
18{
19public:
Jim Flynn4c9ed1d2022-01-23 23:57:20 +000020 BackendProfiling(const ProfilingOptions& options,
Sadik Armagan3184c902020-03-18 10:57:30 +000021 ProfilingService& profilingService,
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000022 const armnn::BackendId& backendId)
James Conroy2dcd3fe2020-02-06 18:34:52 +000023 : m_Options(options),
24 m_ProfilingService(profilingService),
25 m_BackendId(backendId) {}
Colm Donelan1aff3932020-02-05 17:48:59 +000026
27 ~BackendProfiling()
28 {}
29
30 std::unique_ptr<IRegisterBackendCounters>
James Conroy2dcd3fe2020-02-06 18:34:52 +000031 GetCounterRegistrationInterface(uint16_t currentMaxGlobalCounterID) override;
Colm Donelan1aff3932020-02-05 17:48:59 +000032
33 std::unique_ptr<ISendTimelinePacket> GetSendTimelinePacket() override;
34
35 IProfilingGuidGenerator& GetProfilingGuidGenerator() override;
36
Jim Flynn64063552020-02-14 10:18:08 +000037 void ReportCounters(const std::vector<Timestamp>&) override;
Colm Donelan1aff3932020-02-05 17:48:59 +000038
39 CounterStatus GetCounterStatus(uint16_t backendCounterId) override;
40
41 std::vector<CounterStatus> GetActiveCounters() override;
42
43 bool IsProfilingEnabled() const override;
44
45private:
Jim Flynn4c9ed1d2022-01-23 23:57:20 +000046 ProfilingOptions m_Options;
Sadik Armagan3184c902020-03-18 10:57:30 +000047 ProfilingService& m_ProfilingService;
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000048 armnn::BackendId m_BackendId;
Colm Donelan1aff3932020-02-05 17:48:59 +000049};
Cathal Corbett5aa9fd72022-02-25 15:33:28 +000050
51} // namespace pipe
52
53} // namespace arm