narpra01 | db2b160 | 2019-01-23 15:23:11 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include <backendsCommon/Workload.hpp> |
| 9 | #include <backendsCommon/WorkloadData.hpp> |
| 10 | |
| 11 | #include <armnn/Types.hpp> |
| 12 | |
| 13 | namespace armnn |
| 14 | { |
| 15 | |
| 16 | // Base class template providing an implementation of the Constant layer common to all data types. |
| 17 | template <armnn::DataType DataType> |
| 18 | class RefConstantWorkload : public TypedWorkload<ConstantQueueDescriptor, DataType> |
| 19 | { |
| 20 | public: |
| 21 | RefConstantWorkload(const ConstantQueueDescriptor& descriptor, const WorkloadInfo& info) |
| 22 | : TypedWorkload<ConstantQueueDescriptor, DataType>(descriptor, info) |
| 23 | , m_RanOnce(false) |
| 24 | { |
| 25 | } |
| 26 | |
| 27 | using TypedWorkload<ConstantQueueDescriptor, DataType>::m_Data; |
| 28 | using TypedWorkload<ConstantQueueDescriptor, DataType>::TypedWorkload; |
| 29 | |
| 30 | virtual void Execute() const override; |
| 31 | |
| 32 | private: |
| 33 | mutable bool m_RanOnce; |
| 34 | }; |
| 35 | |
| 36 | using RefConstantFloat32Workload = RefConstantWorkload<DataType::Float32>; |
| 37 | using RefConstantUint8Workload = RefConstantWorkload<DataType::QuantisedAsymm8>; |
| 38 | using RefConstantInt32Workload = RefConstantWorkload<DataType::Signed32>; |
| 39 | |
| 40 | } //namespace armnn |