blob: 6feffbcb004e1ac1eb4892d6f08ac846c4e5bf70 [file] [log] [blame]
telsoa01c577f2c2018-08-31 09:22:23 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa01c577f2c2018-08-31 09:22:23 +01004//
5
6#pragma once
7
Matteo Martincigha65b7ae2018-11-14 12:39:55 +00008#include <armnn/TypesUtils.hpp>
9
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +000010#include <backendsCommon/Workload.hpp>
11#include <backendsCommon/WorkloadData.hpp>
telsoa01c577f2c2018-08-31 09:22:23 +010012
13namespace armnn
14{
15
Nattapat Chaimanowongeb2b3292019-05-07 12:02:30 +010016class RefLstmWorkload : public BaseWorkload<LstmQueueDescriptor>
telsoa01c577f2c2018-08-31 09:22:23 +010017{
18public:
Nattapat Chaimanowongeb2b3292019-05-07 12:02:30 +010019 explicit RefLstmWorkload(const LstmQueueDescriptor& descriptor, const WorkloadInfo& info);
Matteo Martincigha65b7ae2018-11-14 12:39:55 +000020
Finn Williamsb8181f72021-04-07 10:23:21 +010021 void Execute() const override;
22 void ExecuteAsync(WorkingMemDescriptor& workingMemDescriptor) override;
Matteo Martincigha65b7ae2018-11-14 12:39:55 +000023
24private:
Finn Williamsb8181f72021-04-07 10:23:21 +010025 void Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const;
James Conroy1f58f032021-04-27 17:13:27 +010026 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 Eilers38e05bd2019-06-26 13:10:09 +010047
48 float m_LayerNormEpsilon = static_cast<float>(1e-8);
telsoa01c577f2c2018-08-31 09:22:23 +010049};
50
51} //namespace armnn