telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 4 | // |
| 5 | #pragma once |
| 6 | |
| 7 | #include "NeonTimer.hpp" |
| 8 | #include "WallClockTimer.hpp" |
| 9 | |
| 10 | #include <arm_compute/runtime/IScheduler.h> |
| 11 | #include <arm_compute/runtime/Scheduler.h> |
| 12 | #include <arm_compute/core/CPP/ICPPKernel.h> |
| 13 | |
| 14 | namespace armnn |
| 15 | { |
| 16 | |
| 17 | class NeonInterceptorScheduler : public arm_compute::IScheduler |
| 18 | { |
| 19 | public: |
Derek Lamberti | e4ba53a | 2018-10-01 09:28:57 +0100 | [diff] [blame] | 20 | NeonInterceptorScheduler(arm_compute::IScheduler &realScheduler); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 21 | ~NeonInterceptorScheduler() = default; |
| 22 | |
| 23 | void set_num_threads(unsigned int numThreads) override; |
| 24 | |
| 25 | unsigned int num_threads() const override; |
| 26 | |
| 27 | void schedule(arm_compute::ICPPKernel *kernel, const Hints &hints) override; |
| 28 | |
| 29 | void run_workloads(std::vector<Workload> &workloads) override; |
| 30 | |
saoste01 | 19bd47d | 2019-01-24 12:31:58 +0000 | [diff] [blame] | 31 | void run_tagged_workloads(std::vector<Workload> &workloads, const char *tag) override; |
| 32 | |
Derek Lamberti | e4ba53a | 2018-10-01 09:28:57 +0100 | [diff] [blame] | 33 | void SetKernels(NeonTimer::KernelMeasurements* kernels) { m_Kernels = kernels; } |
| 34 | NeonTimer::KernelMeasurements* GetKernels() { return m_Kernels; } |
David Monahan | 9b14bfc | 2020-06-30 15:57:56 +0100 | [diff] [blame] | 35 | |
| 36 | void schedule_op(arm_compute::ICPPKernel *kernel, |
| 37 | const Hints &hints, |
| 38 | const arm_compute::InputTensorMap &inputs, |
| 39 | const arm_compute::OutputTensorMap &outputs ) override; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 40 | private: |
Derek Lamberti | e4ba53a | 2018-10-01 09:28:57 +0100 | [diff] [blame] | 41 | NeonTimer::KernelMeasurements* m_Kernels; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 42 | arm_compute::IScheduler& m_RealScheduler; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | } // namespace armnn |