Laurent Carlier | 749294b | 2020-06-01 09:03:17 +0100 | [diff] [blame] | 1 | // |
Matthew Sloyan | 21a6a1a | 2022-06-30 17:13:04 +0100 | [diff] [blame] | 2 | // Copyright © 2022 Arm Ltd and Contributors. All rights reserved. |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 5 | |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 6 | #pragma once |
| 7 | |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 8 | #include <armnn/TypesUtils.hpp> |
| 9 | |
Finn Williams | 73c547d | 2022-02-15 20:47:34 +0000 | [diff] [blame] | 10 | #include "RefBaseWorkload.hpp" |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 11 | |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 12 | namespace armnn |
| 13 | { |
| 14 | |
| 15 | template <armnn::DataType DataType> |
| 16 | class RefDebugWorkload : public TypedWorkload<DebugQueueDescriptor, DataType> |
| 17 | { |
| 18 | public: |
Nattapat Chaimanowong | 317cae5 | 2019-03-28 10:29:12 +0000 | [diff] [blame] | 19 | RefDebugWorkload(const DebugQueueDescriptor& descriptor, const WorkloadInfo& info) |
| 20 | : TypedWorkload<DebugQueueDescriptor, DataType>(descriptor, info) |
| 21 | , m_Callback(nullptr) {} |
| 22 | |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 23 | static const std::string& GetName() |
| 24 | { |
| 25 | static const std::string name = std::string("RefDebug") + GetDataTypeName(DataType) + "Workload"; |
| 26 | return name; |
| 27 | } |
| 28 | |
| 29 | using TypedWorkload<DebugQueueDescriptor, DataType>::m_Data; |
| 30 | using TypedWorkload<DebugQueueDescriptor, DataType>::TypedWorkload; |
| 31 | |
| 32 | void Execute() const override; |
Matthew Sloyan | 21a6a1a | 2022-06-30 17:13:04 +0100 | [diff] [blame] | 33 | void ExecuteAsync(ExecutionData& executionData) override; |
Nattapat Chaimanowong | 317cae5 | 2019-03-28 10:29:12 +0000 | [diff] [blame] | 34 | |
| 35 | void RegisterDebugCallback(const DebugCallbackFunction& func) override; |
| 36 | |
| 37 | private: |
Finn Williams | b8181f7 | 2021-04-07 10:23:21 +0100 | [diff] [blame] | 38 | void Execute(std::vector<ITensorHandle*> inputs) const; |
Nattapat Chaimanowong | 317cae5 | 2019-03-28 10:29:12 +0000 | [diff] [blame] | 39 | DebugCallbackFunction m_Callback; |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 40 | }; |
| 41 | |
Narumol Prangnawarat | 403a185 | 2020-03-12 14:24:13 +0000 | [diff] [blame] | 42 | using RefDebugBFloat16Workload = RefDebugWorkload<DataType::BFloat16>; |
Keith Davis | 0c2eeac | 2020-02-11 16:51:50 +0000 | [diff] [blame] | 43 | using RefDebugFloat16Workload = RefDebugWorkload<DataType::Float16>; |
| 44 | using RefDebugFloat32Workload = RefDebugWorkload<DataType::Float32>; |
| 45 | using RefDebugQAsymmU8Workload = RefDebugWorkload<DataType::QAsymmU8>; |
Keith Davis | 67e6c54 | 2020-02-19 10:08:33 +0000 | [diff] [blame] | 46 | using RefDebugQAsymmS8Workload = RefDebugWorkload<DataType::QAsymmS8>; |
Keith Davis | 0c2eeac | 2020-02-11 16:51:50 +0000 | [diff] [blame] | 47 | using RefDebugQSymmS16Workload = RefDebugWorkload<DataType::QSymmS16>; |
| 48 | using RefDebugQSymmS8Workload = RefDebugWorkload<DataType::QSymmS8>; |
| 49 | using RefDebugSigned32Workload = RefDebugWorkload<DataType::Signed32>; |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 50 | |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 51 | } // namespace armnn |