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 | |
Cathal Corbett | 5aa9fd7 | 2022-02-25 15:33:28 +0000 | [diff] [blame] | 11 | namespace arm |
Colm Donelan | 1aff393 | 2020-02-05 17:48:59 +0000 | [diff] [blame] | 12 | { |
| 13 | |
Cathal Corbett | 5aa9fd7 | 2022-02-25 15:33:28 +0000 | [diff] [blame] | 14 | namespace pipe |
Colm Donelan | 1aff393 | 2020-02-05 17:48:59 +0000 | [diff] [blame] | 15 | { |
| 16 | |
| 17 | class BackendProfiling : public IBackendProfiling |
| 18 | { |
| 19 | public: |
Jim Flynn | 4c9ed1d | 2022-01-23 23:57:20 +0000 | [diff] [blame] | 20 | BackendProfiling(const ProfilingOptions& options, |
Jim Flynn | af94772 | 2022-03-02 11:04:47 +0000 | [diff] [blame] | 21 | IProfilingService& profilingService, |
Cathal Corbett | 5aa9fd7 | 2022-02-25 15:33:28 +0000 | [diff] [blame] | 22 | const armnn::BackendId& backendId) |
James Conroy | 2dcd3fe | 2020-02-06 18:34:52 +0000 | [diff] [blame] | 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: |
Jim Flynn | 4c9ed1d | 2022-01-23 23:57:20 +0000 | [diff] [blame] | 46 | ProfilingOptions m_Options; |
Jim Flynn | af94772 | 2022-03-02 11:04:47 +0000 | [diff] [blame] | 47 | IProfilingService& m_ProfilingService; |
Cathal Corbett | 5aa9fd7 | 2022-02-25 15:33:28 +0000 | [diff] [blame] | 48 | armnn::BackendId m_BackendId; |
Colm Donelan | 1aff393 | 2020-02-05 17:48:59 +0000 | [diff] [blame] | 49 | }; |
Cathal Corbett | 5aa9fd7 | 2022-02-25 15:33:28 +0000 | [diff] [blame] | 50 | |
| 51 | } // namespace pipe |
| 52 | |
| 53 | } // namespace arm |