• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright © 2020 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include "ProfilingService.hpp"
9 #include <armnn/backends/profiling/IBackendProfiling.hpp>
10 
11 namespace armnn
12 {
13 
14 namespace profiling
15 {
16 
17 class BackendProfiling : public IBackendProfiling
18 {
19 public:
BackendProfiling(const IRuntime::CreationOptions & options,ProfilingService & profilingService,const BackendId & backendId)20     BackendProfiling(const IRuntime::CreationOptions& options,
21                      ProfilingService& profilingService,
22                      const BackendId& backendId)
23             : m_Options(options),
24               m_ProfilingService(profilingService),
25               m_BackendId(backendId) {}
26 
~BackendProfiling()27     ~BackendProfiling()
28     {}
29 
30     std::unique_ptr<IRegisterBackendCounters>
31             GetCounterRegistrationInterface(uint16_t currentMaxGlobalCounterID) override;
32 
33     std::unique_ptr<ISendTimelinePacket> GetSendTimelinePacket() override;
34 
35     IProfilingGuidGenerator& GetProfilingGuidGenerator() override;
36 
37     void ReportCounters(const std::vector<Timestamp>&) override;
38 
39     CounterStatus GetCounterStatus(uint16_t backendCounterId) override;
40 
41     std::vector<CounterStatus> GetActiveCounters() override;
42 
43     bool IsProfilingEnabled() const override;
44 
45 private:
46     IRuntime::CreationOptions m_Options;
47     ProfilingService& m_ProfilingService;
48     BackendId m_BackendId;
49 };
50 }    // namespace profiling
51 }    // namespace armnn