telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 1 | // |
Matthew Sloyan | 2d213a7 | 2022-06-30 17:13:04 +0100 | [diff] [blame] | 2 | // Copyright © 2022 Arm Ltd and Contributors. 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 | |
| 6 | #pragma once |
| 7 | |
Matteo Martincigh | a65b7ae | 2018-11-14 12:39:55 +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" |
Colm Donelan | 0c47974 | 2021-12-10 12:43:54 +0000 | [diff] [blame] | 11 | #include <armnn/backends/WorkloadData.hpp> |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 12 | |
| 13 | namespace armnn |
| 14 | { |
| 15 | |
Finn Williams | 73c547d | 2022-02-15 20:47:34 +0000 | [diff] [blame] | 16 | class RefLstmWorkload : public RefBaseWorkload<LstmQueueDescriptor> |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 17 | { |
| 18 | public: |
Nattapat Chaimanowong | eb2b329 | 2019-05-07 12:02:30 +0100 | [diff] [blame] | 19 | explicit RefLstmWorkload(const LstmQueueDescriptor& descriptor, const WorkloadInfo& info); |
Matteo Martincigh | a65b7ae | 2018-11-14 12:39:55 +0000 | [diff] [blame] | 20 | |
Finn Williams | b8181f7 | 2021-04-07 10:23:21 +0100 | [diff] [blame] | 21 | void Execute() const override; |
Matthew Sloyan | 2d213a7 | 2022-06-30 17:13:04 +0100 | [diff] [blame] | 22 | void ExecuteAsync(ExecutionData& executionData) override; |
Matteo Martincigh | a65b7ae | 2018-11-14 12:39:55 +0000 | [diff] [blame] | 23 | |
| 24 | private: |
Finn Williams | b8181f7 | 2021-04-07 10:23:21 +0100 | [diff] [blame] | 25 | void Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const; |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 26 | std::unique_ptr<ScopedTensorHandle> m_InputToInputWeightsTensor; |
| 27 | std::unique_ptr<ScopedTensorHandle> m_InputToForgetWeightsTensor; |
| 28 | std::unique_ptr<ScopedTensorHandle> m_InputToCellWeightsTensor; |
| 29 | std::unique_ptr<ScopedTensorHandle> m_InputToOutputWeightsTensor; |
| 30 | std::unique_ptr<ScopedTensorHandle> m_RecurrentToInputWeightsTensor; |
| 31 | std::unique_ptr<ScopedTensorHandle> m_RecurrentToForgetWeightsTensor; |
| 32 | std::unique_ptr<ScopedTensorHandle> m_RecurrentToCellWeightsTensor; |
| 33 | std::unique_ptr<ScopedTensorHandle> m_RecurrentToOutputWeightsTensor; |
| 34 | std::unique_ptr<ScopedTensorHandle> m_CellToInputWeightsTensor; |
| 35 | std::unique_ptr<ScopedTensorHandle> m_CellToForgetWeightsTensor; |
| 36 | std::unique_ptr<ScopedTensorHandle> m_CellToOutputWeightsTensor; |
| 37 | std::unique_ptr<ScopedTensorHandle> m_InputGateBiasTensor; |
| 38 | std::unique_ptr<ScopedTensorHandle> m_ForgetGateBiasTensor; |
| 39 | std::unique_ptr<ScopedTensorHandle> m_CellBiasTensor; |
| 40 | std::unique_ptr<ScopedTensorHandle> m_OutputGateBiasTensor; |
| 41 | std::unique_ptr<ScopedTensorHandle> m_ProjectionWeightsTensor; |
| 42 | std::unique_ptr<ScopedTensorHandle> m_ProjectionBiasTensor; |
| 43 | std::unique_ptr<ScopedTensorHandle> m_InputLayerNormWeights; |
| 44 | std::unique_ptr<ScopedTensorHandle> m_ForgetLayerNormWeights; |
| 45 | std::unique_ptr<ScopedTensorHandle> m_CellLayerNormWeights; |
| 46 | std::unique_ptr<ScopedTensorHandle> m_OutputLayerNormWeights; |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 47 | |
| 48 | float m_LayerNormEpsilon = static_cast<float>(1e-8); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | } //namespace armnn |