Colm Donelan | 1aff393 | 2020-02-05 17:48:59 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2020 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
James Conroy | 2dcd3fe | 2020-02-06 18:34:52 +0000 | [diff] [blame] | 6 | #pragma once |
| 7 | |
Sadik Armagan | 3184c90 | 2020-03-18 10:57:30 +0000 | [diff] [blame] | 8 | #include "ProfilingService.hpp" |
Colm Donelan | 1aff393 | 2020-02-05 17:48:59 +0000 | [diff] [blame] | 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: |
James Conroy | 2dcd3fe | 2020-02-06 18:34:52 +0000 | [diff] [blame] | 20 | BackendProfiling(const IRuntime::CreationOptions& options, |
Sadik Armagan | 3184c90 | 2020-03-18 10:57:30 +0000 | [diff] [blame] | 21 | ProfilingService& profilingService, |
James Conroy | 2dcd3fe | 2020-02-06 18:34:52 +0000 | [diff] [blame] | 22 | const BackendId& backendId) |
| 23 | : m_Options(options), |
| 24 | m_ProfilingService(profilingService), |
| 25 | m_BackendId(backendId) {} |
Colm Donelan | 1aff393 | 2020-02-05 17:48:59 +0000 | [diff] [blame] | 26 | |
| 27 | ~BackendProfiling() |
| 28 | {} |
| 29 | |
| 30 | std::unique_ptr<IRegisterBackendCounters> |
James Conroy | 2dcd3fe | 2020-02-06 18:34:52 +0000 | [diff] [blame] | 31 | GetCounterRegistrationInterface(uint16_t currentMaxGlobalCounterID) override; |
Colm Donelan | 1aff393 | 2020-02-05 17:48:59 +0000 | [diff] [blame] | 32 | |
| 33 | std::unique_ptr<ISendTimelinePacket> GetSendTimelinePacket() override; |
| 34 | |
| 35 | IProfilingGuidGenerator& GetProfilingGuidGenerator() override; |
| 36 | |
Jim Flynn | 6406355 | 2020-02-14 10:18:08 +0000 | [diff] [blame] | 37 | void ReportCounters(const std::vector<Timestamp>&) override; |
Colm Donelan | 1aff393 | 2020-02-05 17:48:59 +0000 | [diff] [blame] | 38 | |
| 39 | CounterStatus GetCounterStatus(uint16_t backendCounterId) override; |
| 40 | |
| 41 | std::vector<CounterStatus> GetActiveCounters() override; |
| 42 | |
| 43 | bool IsProfilingEnabled() const override; |
| 44 | |
| 45 | private: |
James Conroy | 2dcd3fe | 2020-02-06 18:34:52 +0000 | [diff] [blame] | 46 | IRuntime::CreationOptions m_Options; |
Sadik Armagan | 3184c90 | 2020-03-18 10:57:30 +0000 | [diff] [blame] | 47 | ProfilingService& m_ProfilingService; |
James Conroy | 2dcd3fe | 2020-02-06 18:34:52 +0000 | [diff] [blame] | 48 | BackendId m_BackendId; |
Colm Donelan | 1aff393 | 2020-02-05 17:48:59 +0000 | [diff] [blame] | 49 | }; |
| 50 | } // namespace profiling |
| 51 | } // namespace armnn |