ArmNN
 25.11
Loading...
Searching...
No Matches
ClQLstmWorkload.hpp
Go to the documentation of this file.
1//
2// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
10#include "ClBaseWorkload.hpp"
12
13#include "arm_compute/graph/Tensor.h"
14#include "arm_compute/runtime/CL/functions/CLQLSTMLayer.h"
15
16namespace armnn
17{
18
19class ClQLstmWorkload : public ClBaseWorkload<QLstmQueueDescriptor>
20{
21public:
22 ClQLstmWorkload(const QLstmQueueDescriptor& descriptor,
23 const WorkloadInfo& info,
24 const arm_compute::CLCompileContext& clCompileContext);
25 virtual void Execute() const override;
26
27private:
28 mutable arm_compute::CLQLSTMLayer m_QLstmLayer;
29
30 std::unique_ptr<arm_compute::CLTensor> m_InputToInputWeightsTensor;
31 std::unique_ptr<arm_compute::CLTensor> m_InputToForgetWeightsTensor;
32 std::unique_ptr<arm_compute::CLTensor> m_InputToCellWeightsTensor;
33 std::unique_ptr<arm_compute::CLTensor> m_InputToOutputWeightsTensor;
34
35 std::unique_ptr<arm_compute::CLTensor> m_RecurrentToInputWeightsTensor;
36 std::unique_ptr<arm_compute::CLTensor> m_RecurrentToForgetWeightsTensor;
37 std::unique_ptr<arm_compute::CLTensor> m_RecurrentToCellWeightsTensor;
38 std::unique_ptr<arm_compute::CLTensor> m_RecurrentToOutputWeightsTensor;
39
40 std::unique_ptr<arm_compute::CLTensor> m_CellToInputWeightsTensor;
41 std::unique_ptr<arm_compute::CLTensor> m_CellToForgetWeightsTensor;
42 std::unique_ptr<arm_compute::CLTensor> m_CellToOutputWeightsTensor;
43
44 std::unique_ptr<arm_compute::CLTensor> m_InputGateBiasTensor;
45 std::unique_ptr<arm_compute::CLTensor> m_ForgetGateBiasTensor;
46 std::unique_ptr<arm_compute::CLTensor> m_CellBiasTensor;
47 std::unique_ptr<arm_compute::CLTensor> m_OutputGateBiasTensor;
48
49 std::unique_ptr<arm_compute::CLTensor> m_ProjectionWeightsTensor;
50 std::unique_ptr<arm_compute::CLTensor> m_ProjectionBiasTensor;
51
52 std::unique_ptr<arm_compute::CLTensor> m_InputLayerNormWeightsTensor;
53 std::unique_ptr<arm_compute::CLTensor> m_ForgetLayerNormWeightsTensor;
54 std::unique_ptr<arm_compute::CLTensor> m_CellLayerNormWeightsTensor;
55 std::unique_ptr<arm_compute::CLTensor> m_OutputLayerNormWeightsTensor;
56
57 void FreeUnusedTensors();
58};
59
60arm_compute::Status ClQLstmWorkloadValidate(const TensorInfo& input,
61 const TensorInfo& cellStateIn,
62 const TensorInfo& outputStateIn,
63 const TensorInfo& cellStateOut,
64 const TensorInfo& outputStateOut,
65 const TensorInfo& output,
66 const QLstmDescriptor& descriptor,
67 const LstmInputParamsInfo& paramsInfo);
68} //namespace armnn
ClBaseWorkload(const QLstmQueueDescriptor &descriptor, const WorkloadInfo &info)
ClQLstmWorkload(const QLstmQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
virtual void Execute() const override
Copyright (c) 2021 ARM Limited and Contributors.
arm_compute::Status ClQLstmWorkloadValidate(const TensorInfo &input, const TensorInfo &cellStateIn, const TensorInfo &outputStateIn, const TensorInfo &cellStateOut, const TensorInfo &outputStateOut, const TensorInfo &output, const QLstmDescriptor &descriptor, const LstmInputParamsInfo &paramsInfo)
A QLstmDescriptor for the QLstmLayer.
Contains information about TensorInfos of a layer.