Laurent Carlier | 749294b | 2020-06-01 09:03:17 +0100 | [diff] [blame] | 1 | // |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | // |
| 5 | #pragma once |
| 6 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 7 | #include <armnn/backends/TensorHandleFwd.hpp> |
Matteo Martincigh | e5b8eb9 | 2019-11-28 15:45:42 +0000 | [diff] [blame] | 8 | #include <armnn/backends/ITensorHandle.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 9 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 10 | #include <InternalTypes.hpp> |
| 11 | |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 12 | #include <armnn/Deprecated.hpp> |
David Beck | 0dbe0ee | 2018-09-24 15:59:27 +0100 | [diff] [blame] | 13 | #include <armnn/Descriptors.hpp> |
| 14 | #include <armnn/Exceptions.hpp> |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 15 | #include <armnn/Types.hpp> |
| 16 | #include <armnn/Tensor.hpp> |
David Beck | 0dbe0ee | 2018-09-24 15:59:27 +0100 | [diff] [blame] | 17 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 18 | #include <backendsCommon/WorkloadInfo.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 19 | |
| 20 | namespace armnn |
| 21 | { |
| 22 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 23 | //A helper function that returns the bias data type required for given input data type. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 24 | DataType GetBiasDataType(DataType inputDataType); |
| 25 | |
| 26 | struct WorkloadInfo; |
| 27 | |
| 28 | struct QueueDescriptor |
| 29 | { |
| 30 | std::vector<ITensorHandle*> m_Inputs; |
| 31 | std::vector<ITensorHandle*> m_Outputs; |
Keith Davis | df04d23 | 2020-10-23 17:20:05 +0100 | [diff] [blame] | 32 | void* m_AdditionalInfoObject; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 33 | |
| 34 | void ValidateInputsOutputs(const std::string& descName, |
Narumol Prangnawarat | 867eba5 | 2020-02-03 12:29:56 +0000 | [diff] [blame] | 35 | unsigned int numExpectedIn, |
| 36 | unsigned int numExpectedOut) const; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 37 | |
Keith Davis | df04d23 | 2020-10-23 17:20:05 +0100 | [diff] [blame] | 38 | template<typename T> |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 39 | const T* GetAdditionalInformation() const |
Keith Davis | df04d23 | 2020-10-23 17:20:05 +0100 | [diff] [blame] | 40 | { |
| 41 | return static_cast<T*>(m_AdditionalInfoObject); |
| 42 | } |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 43 | |
| 44 | protected: |
| 45 | ~QueueDescriptor() = default; |
Keith Davis | df04d23 | 2020-10-23 17:20:05 +0100 | [diff] [blame] | 46 | QueueDescriptor() |
| 47 | : m_AdditionalInfoObject(nullptr) |
| 48 | {} |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 49 | QueueDescriptor(QueueDescriptor const&) = default; |
| 50 | QueueDescriptor& operator=(QueueDescriptor const&) = default; |
| 51 | }; |
| 52 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 53 | // Base class for queue descriptors which contain parameters. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 54 | template <typename LayerDescriptor> |
| 55 | struct QueueDescriptorWithParameters : public QueueDescriptor |
| 56 | { |
| 57 | LayerDescriptor m_Parameters; |
| 58 | |
| 59 | protected: |
| 60 | ~QueueDescriptorWithParameters() = default; |
| 61 | QueueDescriptorWithParameters() = default; |
| 62 | QueueDescriptorWithParameters(QueueDescriptorWithParameters const&) = default; |
| 63 | QueueDescriptorWithParameters& operator=(QueueDescriptorWithParameters const&) = default; |
| 64 | }; |
| 65 | |
Jim Flynn | 68db06f | 2020-10-06 10:14:50 +0100 | [diff] [blame] | 66 | struct MapQueueDescriptor : QueueDescriptor |
| 67 | { |
| 68 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 69 | }; |
| 70 | |
Jim Flynn | 3a40ea5 | 2020-10-08 11:42:30 +0100 | [diff] [blame] | 71 | struct UnmapQueueDescriptor : QueueDescriptor |
| 72 | { |
| 73 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 74 | }; |
| 75 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 76 | struct MemCopyQueueDescriptor : QueueDescriptor |
| 77 | { |
| 78 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 79 | }; |
| 80 | |
| 81 | using InputQueueDescriptor = MemCopyQueueDescriptor; |
| 82 | using OutputQueueDescriptor = MemCopyQueueDescriptor; |
| 83 | |
Derek Lamberti | f674aa0 | 2019-08-01 15:56:25 +0100 | [diff] [blame] | 84 | struct MemImportQueueDescriptor : QueueDescriptor |
| 85 | { |
| 86 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 87 | }; |
| 88 | |
| 89 | struct MemSyncQueueDescriptor : QueueDescriptor |
| 90 | { |
| 91 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 92 | }; |
| 93 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 94 | // Softmax layer workload data. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 95 | struct SoftmaxQueueDescriptor : QueueDescriptorWithParameters<SoftmaxDescriptor> |
| 96 | { |
| 97 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 98 | }; |
| 99 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 100 | // Splitter layer workload data. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 101 | struct SplitterQueueDescriptor : QueueDescriptorWithParameters<ViewsDescriptor> |
| 102 | { |
| 103 | struct ViewOrigin |
| 104 | { |
| 105 | ViewOrigin() {} |
| 106 | ViewOrigin(std::vector<unsigned int> const& origin) : m_Origin(origin) {} |
| 107 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 108 | //View origin (size of the vector is the same as number of dimensions of the view). |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 109 | std::vector<unsigned int> m_Origin; |
| 110 | }; |
| 111 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 112 | //View defines a tensor that will be carved from the input tensor. |
| 113 | //View origins are stored here, the extents are defined by sizes of the output tensors. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 114 | std::vector<ViewOrigin> m_ViewOrigins; |
| 115 | |
| 116 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 117 | }; |
| 118 | |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 119 | // Concat layer workload data. |
| 120 | struct ConcatQueueDescriptor : QueueDescriptorWithParameters<OriginsDescriptor> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 121 | { |
| 122 | struct ViewOrigin |
| 123 | { |
| 124 | ViewOrigin() {} |
| 125 | ViewOrigin(const std::vector<unsigned int>& origin) : m_Origin(origin) {} |
| 126 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 127 | //View origin (size of the vector is the same as number of dimensions of the view). |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 128 | std::vector<unsigned int> m_Origin; |
| 129 | }; |
| 130 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 131 | //View defines a sub-area of the output tensor that will be filled with the corresponding input tensor. |
| 132 | //View origins are stored here, the extents are defined by sizes of the input tensors. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 133 | std::vector<ViewOrigin> m_ViewOrigins; |
| 134 | |
| 135 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 136 | }; |
| 137 | |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame] | 138 | // Deprecated. Use ConcatQueueDescriptor instead |
| 139 | using MergerQueueDescriptor = ConcatQueueDescriptor; |
| 140 | |
Matthew Jackson | 2b8c1da | 2019-07-04 14:59:16 +0100 | [diff] [blame] | 141 | // Stack layer workload data. |
| 142 | struct StackQueueDescriptor : QueueDescriptorWithParameters<StackDescriptor> |
| 143 | { |
| 144 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 145 | }; |
| 146 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 147 | // Activation layer workload data. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 148 | struct ActivationQueueDescriptor : QueueDescriptorWithParameters<ActivationDescriptor> |
| 149 | { |
| 150 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 151 | }; |
| 152 | |
Nikhil Raj | ee391d5 | 2019-09-05 17:50:44 +0100 | [diff] [blame] | 153 | struct ArgMinMaxQueueDescriptor : QueueDescriptorWithParameters<ArgMinMaxDescriptor> |
| 154 | { |
| 155 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 156 | }; |
| 157 | |
mathad01 | b392e98 | 2021-04-07 12:07:30 +0100 | [diff] [blame] | 158 | struct CastQueueDescriptor : QueueDescriptor |
| 159 | { |
| 160 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 161 | }; |
| 162 | |
Ryan OShea | ec6c680 | 2020-06-05 17:17:06 +0100 | [diff] [blame] | 163 | // Fill layer workload data. |
| 164 | struct FillQueueDescriptor : QueueDescriptorWithParameters<FillDescriptor> |
| 165 | { |
Ryan OShea | ec6c680 | 2020-06-05 17:17:06 +0100 | [diff] [blame] | 166 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 167 | }; |
| 168 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 169 | // Fully connected layer workload data. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 170 | struct FullyConnectedQueueDescriptor : QueueDescriptorWithParameters<FullyConnectedDescriptor> |
| 171 | { |
| 172 | FullyConnectedQueueDescriptor() |
| 173 | : m_Weight(nullptr) |
| 174 | , m_Bias(nullptr) |
| 175 | { |
| 176 | } |
| 177 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 178 | const ConstTensorHandle* m_Weight; |
| 179 | const ConstTensorHandle* m_Bias; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 180 | |
| 181 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 182 | }; |
| 183 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 184 | // Permute layer workload data. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 185 | struct PermuteQueueDescriptor : QueueDescriptorWithParameters<PermuteDescriptor> |
| 186 | { |
| 187 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 188 | }; |
| 189 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 190 | // Pooling 2D layer workload data. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 191 | struct Pooling2dQueueDescriptor : QueueDescriptorWithParameters<Pooling2dDescriptor> |
| 192 | { |
| 193 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 194 | }; |
| 195 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 196 | // Convolution 2D layer workload data. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 197 | struct Convolution2dQueueDescriptor : QueueDescriptorWithParameters<Convolution2dDescriptor> |
| 198 | { |
| 199 | Convolution2dQueueDescriptor() |
| 200 | : m_Weight(nullptr) |
| 201 | , m_Bias(nullptr) |
| 202 | { |
| 203 | } |
| 204 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 205 | const ConstTensorHandle* m_Weight; |
| 206 | const ConstTensorHandle* m_Bias; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 207 | |
| 208 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 209 | }; |
| 210 | |
Jan Eilers | 53ef795 | 2021-06-02 12:01:25 +0100 | [diff] [blame] | 211 | /// Depthwise Convolution 2D layer workload data. |
| 212 | /// |
| 213 | /// @note |
| 214 | /// The weights are in the format [1, H, W, I*M]. Where I is the input channel size, M the depthwise mutliplier and |
| 215 | /// H, W is the height and width of the filter kernel. If per channel quantization is applied |
| 216 | /// the weights will be quantized along the last dimension/axis (I*M) which corresponds to the output channel size. |
| 217 | /// If per channel quantization is applied the weights tensor will have I*M scales, one for each dimension |
| 218 | /// of the quantization axis. You have to be aware of this when reshaping the weights tensor. |
| 219 | /// Splitting the I*M axis, e.g. [1, H, W, I*M] --> [H, W, I, M], won't work without taking care of the |
| 220 | /// corresponding quantization scales. |
| 221 | /// If there is no per channel quantization applied reshaping the weights tensor won't cause any issues. There are |
| 222 | /// preconfigured permutation functions available @link WorkloadUtils.hpp here. |
| 223 | /// |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 224 | struct DepthwiseConvolution2dQueueDescriptor : QueueDescriptorWithParameters<DepthwiseConvolution2dDescriptor> |
| 225 | { |
| 226 | DepthwiseConvolution2dQueueDescriptor() |
| 227 | : m_Weight(nullptr) |
| 228 | , m_Bias(nullptr) |
| 229 | { |
| 230 | } |
| 231 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 232 | const ConstTensorHandle* m_Weight; |
| 233 | const ConstTensorHandle* m_Bias; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 234 | |
| 235 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 236 | }; |
| 237 | |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 238 | struct DetectionPostProcessQueueDescriptor : QueueDescriptorWithParameters<DetectionPostProcessDescriptor> |
| 239 | { |
Narumol Prangnawarat | bc67cef | 2019-01-31 15:31:54 +0000 | [diff] [blame] | 240 | DetectionPostProcessQueueDescriptor() |
| 241 | : m_Anchors(nullptr) |
| 242 | { |
| 243 | } |
| 244 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 245 | const ConstTensorHandle* m_Anchors; |
Narumol Prangnawarat | bc67cef | 2019-01-31 15:31:54 +0000 | [diff] [blame] | 246 | |
Narumol Prangnawarat | 94dd5d8 | 2019-01-23 18:06:26 +0000 | [diff] [blame] | 247 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 248 | }; |
| 249 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 250 | // Normalization layer workload data. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 251 | struct NormalizationQueueDescriptor : QueueDescriptorWithParameters<NormalizationDescriptor> |
| 252 | { |
| 253 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 254 | }; |
| 255 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 256 | // Add layer workload data. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 257 | struct AdditionQueueDescriptor : QueueDescriptor |
| 258 | { |
| 259 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 260 | }; |
| 261 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 262 | // Multiplication layer workload data. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 263 | struct MultiplicationQueueDescriptor : QueueDescriptor |
| 264 | { |
| 265 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 266 | }; |
| 267 | |
Francis Murtagh | e7a86a4 | 2018-08-29 12:42:10 +0100 | [diff] [blame] | 268 | // Division layer workload data. |
| 269 | struct DivisionQueueDescriptor : QueueDescriptor |
| 270 | { |
| 271 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 272 | }; |
| 273 | |
David Beck | c2044fe | 2018-09-05 15:00:38 +0100 | [diff] [blame] | 274 | // Subtraction layer workload data. |
| 275 | struct SubtractionQueueDescriptor : QueueDescriptor |
| 276 | { |
| 277 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 278 | }; |
| 279 | |
Nattapat Chaimanowong | 5a4304a | 2018-11-28 10:44:37 +0000 | [diff] [blame] | 280 | // Maximum layer workload data. |
| 281 | struct MaximumQueueDescriptor : QueueDescriptor |
| 282 | { |
| 283 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 284 | }; |
| 285 | |
narpra01 | a6bf912 | 2018-09-10 09:50:09 +0100 | [diff] [blame] | 286 | // Mean layer workload data. |
narpra01 | 32b9046 | 2018-09-13 11:07:48 +0100 | [diff] [blame] | 287 | struct MeanQueueDescriptor : QueueDescriptorWithParameters<MeanDescriptor> |
narpra01 | a6bf912 | 2018-09-10 09:50:09 +0100 | [diff] [blame] | 288 | { |
| 289 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 290 | }; |
| 291 | |
jimfly01 | 2c9322a | 2018-09-19 10:59:49 +0100 | [diff] [blame] | 292 | // Pad layer workload data |
| 293 | struct PadQueueDescriptor : QueueDescriptorWithParameters<PadDescriptor> |
| 294 | { |
| 295 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 296 | }; |
| 297 | |
Derek Lamberti | a9cca6a | 2019-03-25 15:41:58 +0000 | [diff] [blame] | 298 | struct QuantizeQueueDescriptor : QueueDescriptor |
| 299 | { |
| 300 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 301 | }; |
| 302 | |
Teresa Charlin | cedd34f | 2020-03-30 11:17:30 +0100 | [diff] [blame] | 303 | // Deprecated use ComparisonQueueDescriptor instead |
FrancisMurtagh | 2099595 | 2018-12-17 12:11:36 +0000 | [diff] [blame] | 304 | struct EqualQueueDescriptor : QueueDescriptor |
| 305 | { |
| 306 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 307 | }; |
| 308 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 309 | // Batch norm layer workload data. |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 310 | struct BatchNormalizationQueueDescriptor : QueueDescriptorWithParameters<BatchNormalizationDescriptor> |
| 311 | { |
| 312 | BatchNormalizationQueueDescriptor() |
| 313 | : m_Mean(nullptr) |
| 314 | , m_Variance(nullptr) |
| 315 | , m_Beta(nullptr) |
| 316 | , m_Gamma(nullptr) |
| 317 | { |
| 318 | } |
| 319 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 320 | const ConstTensorHandle* m_Mean; |
| 321 | const ConstTensorHandle* m_Variance; |
| 322 | const ConstTensorHandle* m_Beta; |
| 323 | const ConstTensorHandle* m_Gamma; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 324 | |
| 325 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 326 | }; |
| 327 | |
Finn Williams | 2605b23 | 2020-06-10 15:53:46 +0100 | [diff] [blame] | 328 | struct RankQueueDescriptor : QueueDescriptor |
| 329 | { |
| 330 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 331 | }; |
| 332 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 333 | struct ResizeBilinearQueueDescriptor : QueueDescriptorWithParameters<ResizeBilinearDescriptor> |
| 334 | { |
| 335 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 336 | }; |
| 337 | |
Teresa Charlin | a9075df | 2019-06-27 15:41:57 +0100 | [diff] [blame] | 338 | struct ResizeQueueDescriptor : QueueDescriptorWithParameters<ResizeDescriptor> |
| 339 | { |
| 340 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 341 | }; |
| 342 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 343 | struct FakeQuantizationQueueDescriptor : QueueDescriptorWithParameters<FakeQuantizationDescriptor> |
| 344 | { |
| 345 | FakeQuantizationQueueDescriptor() |
| 346 | : m_Min(nullptr) |
| 347 | , m_Max(nullptr) |
| 348 | { |
| 349 | } |
| 350 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 351 | const ConstTensorHandle* m_Min; |
| 352 | const ConstTensorHandle* m_Max; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 353 | |
| 354 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 355 | }; |
| 356 | |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 357 | struct InstanceNormalizationQueueDescriptor : QueueDescriptorWithParameters<InstanceNormalizationDescriptor> |
| 358 | { |
Kevin May | ce5045a | 2019-10-02 14:07:47 +0100 | [diff] [blame] | 359 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 360 | }; |
| 361 | |
Matteo Martincigh | bcd3c85 | 2018-09-28 14:14:12 +0100 | [diff] [blame] | 362 | struct L2NormalizationQueueDescriptor : QueueDescriptorWithParameters<L2NormalizationDescriptor> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 363 | { |
| 364 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 365 | }; |
| 366 | |
Aron Virginas-Tar | f982dea | 2019-10-11 14:07:53 +0100 | [diff] [blame] | 367 | struct LogSoftmaxQueueDescriptor : QueueDescriptorWithParameters<LogSoftmaxDescriptor> |
| 368 | { |
| 369 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 370 | }; |
| 371 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 372 | struct ConstantQueueDescriptor : QueueDescriptor |
| 373 | { |
| 374 | ConstantQueueDescriptor() |
| 375 | : m_LayerOutput(nullptr) |
| 376 | { |
| 377 | } |
| 378 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 379 | const ConstTensorHandle* m_LayerOutput; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 380 | |
| 381 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 382 | }; |
| 383 | |
| 384 | struct ReshapeQueueDescriptor : QueueDescriptorWithParameters<ReshapeDescriptor> |
| 385 | { |
| 386 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 387 | }; |
| 388 | |
Nattapat Chaimanowong | 207ef9a | 2018-11-02 10:57:25 +0000 | [diff] [blame] | 389 | struct SpaceToBatchNdQueueDescriptor : QueueDescriptorWithParameters<SpaceToBatchNdDescriptor> |
| 390 | { |
| 391 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 392 | }; |
| 393 | |
Aron Virginas-Tar | 972af15 | 2019-06-11 14:14:03 +0100 | [diff] [blame] | 394 | struct SpaceToDepthQueueDescriptor : QueueDescriptorWithParameters<SpaceToDepthDescriptor> |
| 395 | { |
| 396 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 397 | }; |
| 398 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 399 | struct FloorQueueDescriptor : QueueDescriptor |
| 400 | { |
| 401 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 402 | }; |
| 403 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 404 | struct LstmQueueDescriptor : QueueDescriptorWithParameters<LstmDescriptor> |
| 405 | { |
| 406 | LstmQueueDescriptor() |
| 407 | : m_InputToInputWeights(nullptr) |
| 408 | , m_InputToForgetWeights(nullptr) |
| 409 | , m_InputToCellWeights(nullptr) |
| 410 | , m_InputToOutputWeights(nullptr) |
| 411 | , m_RecurrentToInputWeights(nullptr) |
| 412 | , m_RecurrentToForgetWeights(nullptr) |
| 413 | , m_RecurrentToCellWeights(nullptr) |
| 414 | , m_RecurrentToOutputWeights(nullptr) |
| 415 | , m_CellToInputWeights(nullptr) |
| 416 | , m_CellToForgetWeights(nullptr) |
| 417 | , m_CellToOutputWeights(nullptr) |
| 418 | , m_InputGateBias(nullptr) |
| 419 | , m_ForgetGateBias(nullptr) |
| 420 | , m_CellBias(nullptr) |
| 421 | , m_OutputGateBias(nullptr) |
| 422 | , m_ProjectionWeights(nullptr) |
| 423 | , m_ProjectionBias(nullptr) |
Jan Eilers | 38e05bd | 2019-06-26 13:10:09 +0100 | [diff] [blame] | 424 | , m_InputLayerNormWeights(nullptr) |
| 425 | , m_ForgetLayerNormWeights(nullptr) |
| 426 | , m_CellLayerNormWeights(nullptr) |
| 427 | , m_OutputLayerNormWeights(nullptr) |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 428 | { |
| 429 | } |
| 430 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 431 | const ConstTensorHandle* m_InputToInputWeights; |
| 432 | const ConstTensorHandle* m_InputToForgetWeights; |
| 433 | const ConstTensorHandle* m_InputToCellWeights; |
| 434 | const ConstTensorHandle* m_InputToOutputWeights; |
| 435 | const ConstTensorHandle* m_RecurrentToInputWeights; |
| 436 | const ConstTensorHandle* m_RecurrentToForgetWeights; |
| 437 | const ConstTensorHandle* m_RecurrentToCellWeights; |
| 438 | const ConstTensorHandle* m_RecurrentToOutputWeights; |
| 439 | const ConstTensorHandle* m_CellToInputWeights; |
| 440 | const ConstTensorHandle* m_CellToForgetWeights; |
| 441 | const ConstTensorHandle* m_CellToOutputWeights; |
| 442 | const ConstTensorHandle* m_InputGateBias; |
| 443 | const ConstTensorHandle* m_ForgetGateBias; |
| 444 | const ConstTensorHandle* m_CellBias; |
| 445 | const ConstTensorHandle* m_OutputGateBias; |
| 446 | const ConstTensorHandle* m_ProjectionWeights; |
| 447 | const ConstTensorHandle* m_ProjectionBias; |
| 448 | const ConstTensorHandle* m_InputLayerNormWeights; |
| 449 | const ConstTensorHandle* m_ForgetLayerNormWeights; |
| 450 | const ConstTensorHandle* m_CellLayerNormWeights; |
| 451 | const ConstTensorHandle* m_OutputLayerNormWeights; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 452 | |
| 453 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 454 | }; |
| 455 | |
Narumol Prangnawarat | 7ddbbae | 2020-03-13 10:26:05 +0000 | [diff] [blame] | 456 | struct ConvertBf16ToFp32QueueDescriptor : QueueDescriptor |
| 457 | { |
| 458 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 459 | }; |
| 460 | |
Narumol Prangnawarat | ea54a01 | 2020-03-16 16:36:10 +0000 | [diff] [blame] | 461 | struct ConvertFp32ToBf16QueueDescriptor : QueueDescriptor |
| 462 | { |
| 463 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 464 | }; |
| 465 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 466 | struct ConvertFp16ToFp32QueueDescriptor : QueueDescriptor |
| 467 | { |
| 468 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 469 | }; |
| 470 | |
| 471 | struct ConvertFp32ToFp16QueueDescriptor : QueueDescriptor |
| 472 | { |
| 473 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 474 | }; |
| 475 | |
Éanna Ó Catháin | 4e1e136 | 2018-11-12 11:36:34 +0000 | [diff] [blame] | 476 | struct BatchToSpaceNdQueueDescriptor : QueueDescriptorWithParameters<BatchToSpaceNdDescriptor> |
| 477 | { |
| 478 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 479 | }; |
Conor Kennedy | 430b5d8 | 2018-11-14 15:28:28 +0000 | [diff] [blame] | 480 | |
| 481 | struct StridedSliceQueueDescriptor : QueueDescriptorWithParameters<StridedSliceDescriptor> |
| 482 | { |
| 483 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 484 | }; |
| 485 | |
Éanna Ó Catháin | 20e5880 | 2018-12-04 10:29:06 +0000 | [diff] [blame] | 486 | // Minimum layer workload data. |
kevmay01 | 9053969 | 2018-11-29 08:40:19 +0000 | [diff] [blame] | 487 | struct MinimumQueueDescriptor : QueueDescriptor |
| 488 | { |
| 489 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 490 | }; |
| 491 | |
Teresa Charlin | 2b030d9 | 2020-03-27 16:40:56 +0000 | [diff] [blame] | 492 | // Deprecated use ComparisonQueueDescriptor instead |
Matteo Martincigh | 59a950c | 2018-12-13 12:48:25 +0000 | [diff] [blame] | 493 | struct GreaterQueueDescriptor : QueueDescriptor |
| 494 | { |
| 495 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 496 | }; |
| 497 | |
Nattapat Chaimanowong | 964e955 | 2019-03-26 11:03:26 +0000 | [diff] [blame] | 498 | struct DebugQueueDescriptor : QueueDescriptor |
Nattapat Chaimanowong | a9a1cf1 | 2018-12-03 16:06:49 +0000 | [diff] [blame] | 499 | { |
janeil01 | 3fec1ea | 2019-11-07 09:47:20 +0000 | [diff] [blame] | 500 | DebugQueueDescriptor() : m_Guid(0) {} |
| 501 | |
Nattapat Chaimanowong | a9a1cf1 | 2018-12-03 16:06:49 +0000 | [diff] [blame] | 502 | void Validate(const WorkloadInfo& workloadInfo) const; |
Nattapat Chaimanowong | 964e955 | 2019-03-26 11:03:26 +0000 | [diff] [blame] | 503 | |
| 504 | LayerGuid m_Guid; |
| 505 | std::string m_LayerName; |
| 506 | unsigned int m_SlotIndex; |
Nattapat Chaimanowong | a9a1cf1 | 2018-12-03 16:06:49 +0000 | [diff] [blame] | 507 | }; |
| 508 | |
Mohamed Nour Abouelseoud | a1d3c6a | 2018-12-27 12:39:16 +0000 | [diff] [blame] | 509 | struct RsqrtQueueDescriptor : QueueDescriptor |
| 510 | { |
| 511 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 512 | }; |
| 513 | |
Teresa Charlin | 5266473 | 2020-06-29 16:27:03 +0100 | [diff] [blame] | 514 | struct GatherQueueDescriptor : QueueDescriptorWithParameters<GatherDescriptor> |
narpra01 | b89b05f | 2019-01-16 09:53:09 +0000 | [diff] [blame] | 515 | { |
| 516 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 517 | }; |
| 518 | |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 519 | struct PreCompiledQueueDescriptor : QueueDescriptorWithParameters<PreCompiledDescriptor> |
| 520 | { |
| 521 | PreCompiledQueueDescriptor() |
| 522 | : m_PreCompiledObject(nullptr) |
| 523 | { |
| 524 | } |
| 525 | |
Matteo Martincigh | 7997a35 | 2019-04-17 15:37:30 +0100 | [diff] [blame] | 526 | void* m_PreCompiledObject; |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 527 | |
| 528 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 529 | }; |
| 530 | |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 531 | struct DequantizeQueueDescriptor : QueueDescriptor |
| 532 | { |
| 533 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 534 | }; |
| 535 | |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 536 | struct MergeQueueDescriptor : QueueDescriptor |
| 537 | { |
| 538 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 539 | }; |
| 540 | |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 541 | struct SwitchQueueDescriptor : QueueDescriptor |
| 542 | { |
| 543 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 544 | }; |
| 545 | |
Matteo Martincigh | 0e406ee | 2019-06-12 15:42:18 +0100 | [diff] [blame] | 546 | struct PreluQueueDescriptor : QueueDescriptor |
| 547 | { |
| 548 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 549 | }; |
| 550 | |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 551 | struct TransposeConvolution2dQueueDescriptor : QueueDescriptorWithParameters<TransposeConvolution2dDescriptor> |
| 552 | { |
| 553 | TransposeConvolution2dQueueDescriptor() : |
| 554 | m_Weight(nullptr), |
| 555 | m_Bias(nullptr) |
| 556 | {} |
| 557 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 558 | const ConstTensorHandle* m_Weight; |
| 559 | const ConstTensorHandle* m_Bias; |
Aron Virginas-Tar | 639fb04 | 2019-06-20 14:28:19 +0100 | [diff] [blame] | 560 | |
| 561 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 562 | }; |
| 563 | |
Mike Kelly | c9ea45a | 2020-02-28 18:11:58 +0000 | [diff] [blame] | 564 | struct TransposeQueueDescriptor : QueueDescriptorWithParameters<TransposeDescriptor> |
| 565 | { |
| 566 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 567 | }; |
| 568 | |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 569 | struct QLstmQueueDescriptor : QueueDescriptorWithParameters<QLstmDescriptor> |
| 570 | { |
| 571 | QLstmQueueDescriptor() |
| 572 | : m_InputToInputWeights(nullptr) |
| 573 | , m_InputToForgetWeights(nullptr) |
| 574 | , m_InputToCellWeights(nullptr) |
| 575 | , m_InputToOutputWeights(nullptr) |
| 576 | , m_RecurrentToInputWeights(nullptr) |
| 577 | , m_RecurrentToForgetWeights(nullptr) |
| 578 | , m_RecurrentToCellWeights(nullptr) |
| 579 | , m_RecurrentToOutputWeights(nullptr) |
| 580 | , m_CellToInputWeights(nullptr) |
| 581 | , m_CellToForgetWeights(nullptr) |
| 582 | , m_CellToOutputWeights(nullptr) |
| 583 | , m_InputGateBias(nullptr) |
| 584 | , m_ForgetGateBias(nullptr) |
| 585 | , m_CellBias(nullptr) |
| 586 | , m_OutputGateBias(nullptr) |
| 587 | , m_ProjectionWeights(nullptr) |
| 588 | , m_ProjectionBias(nullptr) |
| 589 | , m_InputLayerNormWeights(nullptr) |
| 590 | , m_ForgetLayerNormWeights(nullptr) |
| 591 | , m_CellLayerNormWeights(nullptr) |
| 592 | , m_OutputLayerNormWeights(nullptr) |
| 593 | { |
| 594 | } |
| 595 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 596 | const ConstTensorHandle* m_InputToInputWeights; |
| 597 | const ConstTensorHandle* m_InputToForgetWeights; |
| 598 | const ConstTensorHandle* m_InputToCellWeights; |
| 599 | const ConstTensorHandle* m_InputToOutputWeights; |
| 600 | const ConstTensorHandle* m_RecurrentToInputWeights; |
| 601 | const ConstTensorHandle* m_RecurrentToForgetWeights; |
| 602 | const ConstTensorHandle* m_RecurrentToCellWeights; |
| 603 | const ConstTensorHandle* m_RecurrentToOutputWeights; |
| 604 | const ConstTensorHandle* m_CellToInputWeights; |
| 605 | const ConstTensorHandle* m_CellToForgetWeights; |
| 606 | const ConstTensorHandle* m_CellToOutputWeights; |
| 607 | const ConstTensorHandle* m_InputGateBias; |
| 608 | const ConstTensorHandle* m_ForgetGateBias; |
| 609 | const ConstTensorHandle* m_CellBias; |
| 610 | const ConstTensorHandle* m_OutputGateBias; |
| 611 | const ConstTensorHandle* m_ProjectionWeights; |
| 612 | const ConstTensorHandle* m_ProjectionBias; |
| 613 | const ConstTensorHandle* m_InputLayerNormWeights; |
| 614 | const ConstTensorHandle* m_ForgetLayerNormWeights; |
| 615 | const ConstTensorHandle* m_CellLayerNormWeights; |
| 616 | const ConstTensorHandle* m_OutputLayerNormWeights; |
James Conroy | 586a9aa | 2020-03-20 08:49:33 +0000 | [diff] [blame] | 617 | |
| 618 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 619 | }; |
| 620 | |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 621 | struct QuantizedLstmQueueDescriptor : QueueDescriptor |
| 622 | { |
| 623 | QuantizedLstmQueueDescriptor() |
| 624 | : m_InputToInputWeights(nullptr) |
| 625 | , m_InputToForgetWeights(nullptr) |
| 626 | , m_InputToCellWeights(nullptr) |
| 627 | , m_InputToOutputWeights(nullptr) |
| 628 | |
| 629 | , m_RecurrentToInputWeights(nullptr) |
| 630 | , m_RecurrentToForgetWeights(nullptr) |
| 631 | , m_RecurrentToCellWeights(nullptr) |
| 632 | , m_RecurrentToOutputWeights(nullptr) |
| 633 | |
| 634 | , m_InputGateBias(nullptr) |
| 635 | , m_ForgetGateBias(nullptr) |
| 636 | , m_CellBias(nullptr) |
| 637 | , m_OutputGateBias(nullptr) |
| 638 | {} |
| 639 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 640 | const ConstTensorHandle* m_InputToInputWeights; |
| 641 | const ConstTensorHandle* m_InputToForgetWeights; |
| 642 | const ConstTensorHandle* m_InputToCellWeights; |
| 643 | const ConstTensorHandle* m_InputToOutputWeights; |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 644 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 645 | const ConstTensorHandle* m_RecurrentToInputWeights; |
| 646 | const ConstTensorHandle* m_RecurrentToForgetWeights; |
| 647 | const ConstTensorHandle* m_RecurrentToCellWeights; |
| 648 | const ConstTensorHandle* m_RecurrentToOutputWeights; |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 649 | |
James Conroy | 1f58f03 | 2021-04-27 17:13:27 +0100 | [diff] [blame] | 650 | const ConstTensorHandle* m_InputGateBias; |
| 651 | const ConstTensorHandle* m_ForgetGateBias; |
| 652 | const ConstTensorHandle* m_CellBias; |
| 653 | const ConstTensorHandle* m_OutputGateBias; |
James Conroy | ee18dc8 | 2019-07-17 11:27:46 +0100 | [diff] [blame] | 654 | |
| 655 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 656 | }; |
| 657 | |
Kevin May | 868eb14 | 2019-09-04 17:29:31 +0100 | [diff] [blame] | 658 | struct AbsQueueDescriptor : QueueDescriptor |
| 659 | { |
| 660 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 661 | }; |
| 662 | |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 663 | struct SliceQueueDescriptor : QueueDescriptorWithParameters<SliceDescriptor> |
| 664 | { |
| 665 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 666 | }; |
| 667 | |
Aron Virginas-Tar | dd6247f | 2019-09-19 14:31:17 +0100 | [diff] [blame] | 668 | struct DepthToSpaceQueueDescriptor : QueueDescriptorWithParameters<DepthToSpaceDescriptor> |
| 669 | { |
| 670 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 671 | }; |
| 672 | |
Aron Virginas-Tar | 77bfb5e | 2019-10-16 17:45:38 +0100 | [diff] [blame] | 673 | struct ComparisonQueueDescriptor : QueueDescriptorWithParameters<ComparisonDescriptor> |
| 674 | { |
| 675 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 676 | }; |
| 677 | |
josh minor | 4a3c610 | 2020-01-06 16:40:46 -0600 | [diff] [blame] | 678 | struct ElementwiseUnaryQueueDescriptor : QueueDescriptorWithParameters<ElementwiseUnaryDescriptor> |
| 679 | { |
| 680 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 681 | }; |
| 682 | |
James Conroy | aba90cd | 2020-11-06 16:28:18 +0000 | [diff] [blame] | 683 | struct LogicalBinaryQueueDescriptor : QueueDescriptorWithParameters<LogicalBinaryDescriptor> |
| 684 | { |
| 685 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 686 | }; |
| 687 | |
Sadik Armagan | 0c3ea5b | 2021-02-03 09:29:30 +0000 | [diff] [blame] | 688 | struct ReduceQueueDescriptor : QueueDescriptorWithParameters<ReduceDescriptor> |
| 689 | { |
| 690 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 691 | }; |
| 692 | |
Keith Davis | 3ae3f97 | 2021-05-21 16:33:48 +0100 | [diff] [blame] | 693 | struct ShapeQueueDescriptor : QueueDescriptor |
| 694 | { |
| 695 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 696 | }; |
| 697 | |
Narumol Prangnawarat | 8ed39ae | 2021-07-15 16:16:25 +0100 | [diff] [blame] | 698 | struct UnidirectionalSequenceLstmQueueDescriptor : QueueDescriptorWithParameters<LstmDescriptor> |
| 699 | { |
| 700 | UnidirectionalSequenceLstmQueueDescriptor() |
| 701 | : m_InputToInputWeights(nullptr) |
| 702 | , m_InputToForgetWeights(nullptr) |
| 703 | , m_InputToCellWeights(nullptr) |
| 704 | , m_InputToOutputWeights(nullptr) |
| 705 | , m_RecurrentToInputWeights(nullptr) |
| 706 | , m_RecurrentToForgetWeights(nullptr) |
| 707 | , m_RecurrentToCellWeights(nullptr) |
| 708 | , m_RecurrentToOutputWeights(nullptr) |
| 709 | , m_CellToInputWeights(nullptr) |
| 710 | , m_CellToForgetWeights(nullptr) |
| 711 | , m_CellToOutputWeights(nullptr) |
| 712 | , m_InputGateBias(nullptr) |
| 713 | , m_ForgetGateBias(nullptr) |
| 714 | , m_CellBias(nullptr) |
| 715 | , m_OutputGateBias(nullptr) |
| 716 | , m_ProjectionWeights(nullptr) |
| 717 | , m_ProjectionBias(nullptr) |
| 718 | , m_InputLayerNormWeights(nullptr) |
| 719 | , m_ForgetLayerNormWeights(nullptr) |
| 720 | , m_CellLayerNormWeights(nullptr) |
| 721 | , m_OutputLayerNormWeights(nullptr) |
| 722 | { |
| 723 | } |
| 724 | |
| 725 | const ConstTensorHandle* m_InputToInputWeights; |
| 726 | const ConstTensorHandle* m_InputToForgetWeights; |
| 727 | const ConstTensorHandle* m_InputToCellWeights; |
| 728 | const ConstTensorHandle* m_InputToOutputWeights; |
| 729 | const ConstTensorHandle* m_RecurrentToInputWeights; |
| 730 | const ConstTensorHandle* m_RecurrentToForgetWeights; |
| 731 | const ConstTensorHandle* m_RecurrentToCellWeights; |
| 732 | const ConstTensorHandle* m_RecurrentToOutputWeights; |
| 733 | const ConstTensorHandle* m_CellToInputWeights; |
| 734 | const ConstTensorHandle* m_CellToForgetWeights; |
| 735 | const ConstTensorHandle* m_CellToOutputWeights; |
| 736 | const ConstTensorHandle* m_InputGateBias; |
| 737 | const ConstTensorHandle* m_ForgetGateBias; |
| 738 | const ConstTensorHandle* m_CellBias; |
| 739 | const ConstTensorHandle* m_OutputGateBias; |
| 740 | const ConstTensorHandle* m_ProjectionWeights; |
| 741 | const ConstTensorHandle* m_ProjectionBias; |
| 742 | const ConstTensorHandle* m_InputLayerNormWeights; |
| 743 | const ConstTensorHandle* m_ForgetLayerNormWeights; |
| 744 | const ConstTensorHandle* m_CellLayerNormWeights; |
| 745 | const ConstTensorHandle* m_OutputLayerNormWeights; |
| 746 | |
| 747 | void Validate(const WorkloadInfo& workloadInfo) const; |
| 748 | }; |
| 749 | |
Aron Virginas-Tar | 636ab40 | 2019-09-16 14:27:45 +0100 | [diff] [blame] | 750 | } // namespace armnn |