Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 1 | // |
| 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 | |
| 40 | using RefDebugFloat32Workload = RefDebugWorkload<DataType::Float32>; |
Narumol Prangnawarat | 47cfee9 | 2019-07-04 10:29:00 +0100 | [diff] [blame] | 41 | using RefDebugQAsymm8Workload = RefDebugWorkload<DataType::QuantisedAsymm8>; |
| 42 | using RefDebugQSymm16Workload = RefDebugWorkload<DataType::QuantisedSymm16>; |
Nattapat Chaimanowong | cfdcadf | 2018-12-06 11:54:33 +0000 | [diff] [blame] | 43 | |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 44 | } // namespace armnn |