Laurent Carlier | 749294b | 2020-06-01 09:03:17 +0100 | [diff] [blame] | 1 | // |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 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 | |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 10 | #include <backendsCommon/Workload.hpp> |
| 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; |
Nattapat Chaimanowong | 317cae5 | 2019-03-28 10:29:12 +0000 | [diff] [blame] | 33 | |
| 34 | void RegisterDebugCallback(const DebugCallbackFunction& func) override; |
| 35 | |
| 36 | private: |
| 37 | DebugCallbackFunction m_Callback; |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 38 | }; |
| 39 | |
Narumol Prangnawarat | 403a185 | 2020-03-12 14:24:13 +0000 | [diff] [blame] | 40 | using RefDebugBFloat16Workload = RefDebugWorkload<DataType::BFloat16>; |
Keith Davis | 0c2eeac | 2020-02-11 16:51:50 +0000 | [diff] [blame] | 41 | using RefDebugFloat16Workload = RefDebugWorkload<DataType::Float16>; |
| 42 | using RefDebugFloat32Workload = RefDebugWorkload<DataType::Float32>; |
| 43 | using RefDebugQAsymmU8Workload = RefDebugWorkload<DataType::QAsymmU8>; |
Keith Davis | 67e6c54 | 2020-02-19 10:08:33 +0000 | [diff] [blame] | 44 | using RefDebugQAsymmS8Workload = RefDebugWorkload<DataType::QAsymmS8>; |
Keith Davis | 0c2eeac | 2020-02-11 16:51:50 +0000 | [diff] [blame] | 45 | using RefDebugQSymmS16Workload = RefDebugWorkload<DataType::QSymmS16>; |
| 46 | using RefDebugQSymmS8Workload = RefDebugWorkload<DataType::QSymmS8>; |
| 47 | using RefDebugSigned32Workload = RefDebugWorkload<DataType::Signed32>; |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 48 | |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 49 | } // namespace armnn |