ArmNN
 22.11
BackendHelper.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <armnn/BackendId.hpp>
11 #include <armnn/Types.hpp>
12 
13 namespace armnn
14 {
15 
16 // This handle calls its own IsXXXLayerSupported() functions which then call the polymorphic
17 // ILayerSupport::IsXXXLayerSupported() at the framework level so there is no risk of VTable misalignment.
18 // This is to make ILayerSupport in its abstract form a solely Backend interface alongside a
19 // separate ABI stable frontend class free of virtual functions via an added layer of indirection.
21 {
22 public:
23  explicit LayerSupportHandle(std::shared_ptr<ILayerSupport> layerSupport)
24  : m_LayerSupport(std::move(layerSupport)), m_BackendId(Compute::Undefined) {};
25 
26  explicit LayerSupportHandle(std::shared_ptr<ILayerSupport> layerSupport, const BackendId& backendId)
27  : m_LayerSupport(std::move(layerSupport)), m_BackendId(backendId) {};
28 
29  bool IsBackendRegistered() const;
30 
31  bool IsActivationSupported(const TensorInfo& input,
32  const TensorInfo& output,
35 
36  bool IsAdditionSupported(const TensorInfo& input0,
37  const TensorInfo& input1,
38  const TensorInfo& output,
40 
41  bool IsArgMinMaxSupported(const TensorInfo& input,
42  const TensorInfo& output,
43  const ArgMinMaxDescriptor& descriptor,
45 
46  bool IsBatchMatMulSupported(const TensorInfo& input0,
47  const TensorInfo& input1,
48  const TensorInfo& output,
49  const BatchMatMulDescriptor& descriptor,
51 
52  bool IsBatchNormalizationSupported(const TensorInfo& input,
53  const TensorInfo& output,
54  const TensorInfo& mean,
55  const TensorInfo& var,
56  const TensorInfo& beta,
57  const TensorInfo& gamma,
58  const BatchNormalizationDescriptor& descriptor,
60 
61  bool IsBatchToSpaceNdSupported(const TensorInfo& input,
62  const TensorInfo& output,
63  const BatchToSpaceNdDescriptor& descriptor,
65 
66  bool IsCastSupported(const TensorInfo& input,
67  const TensorInfo& output,
69 
70  bool IsChannelShuffleSupported(const TensorInfo& input,
71  const TensorInfo& output,
72  const ChannelShuffleDescriptor& descriptor,
74 
75  bool IsComparisonSupported(const TensorInfo& input0,
76  const TensorInfo& input1,
77  const TensorInfo& output,
78  const ComparisonDescriptor& descriptor,
80 
81  bool IsConcatSupported(const std::vector<const TensorInfo*> inputs,
82  const TensorInfo& output,
83  const OriginsDescriptor& descriptor,
85 
86  bool IsConstantSupported(const TensorInfo& output,
88 
89  bool IsConvertBf16ToFp32Supported(const TensorInfo& input,
90  const TensorInfo& output,
92 
93  bool IsConvertFp32ToBf16Supported(const TensorInfo& input,
94  const TensorInfo& output,
96 
97  bool IsConvertFp16ToFp32Supported(const TensorInfo& input,
98  const TensorInfo& output,
100 
101  bool IsConvertFp32ToFp16Supported(const TensorInfo& input,
102  const TensorInfo& output,
104 
105  bool IsConvolution2dSupported(const TensorInfo& input,
106  const TensorInfo& output,
107  const Convolution2dDescriptor& descriptor,
108  const TensorInfo& weights,
109  const Optional<TensorInfo>& biases,
111 
112  bool IsConvolution3dSupported(const TensorInfo& input,
113  const TensorInfo& output,
114  const Convolution3dDescriptor& descriptor,
115  const TensorInfo& weights,
116  const Optional<TensorInfo>& biases,
118 
119  bool IsDebugSupported(const TensorInfo& input,
120  const TensorInfo& output,
122 
123  bool IsDepthToSpaceSupported(const TensorInfo& input,
124  const TensorInfo& output,
125  const DepthToSpaceDescriptor& descriptor,
127 
129  const TensorInfo& input,
130  const TensorInfo& output,
131  const DepthwiseConvolution2dDescriptor& descriptor,
132  const TensorInfo& weights,
133  const Optional<TensorInfo>& biases,
135 
136  bool IsDequantizeSupported(const TensorInfo& input,
137  const TensorInfo& output,
139 
140  bool IsDetectionPostProcessSupported(const TensorInfo& boxEncodings,
141  const TensorInfo& scores,
142  const TensorInfo& anchors,
143  const TensorInfo& detectionBoxes,
144  const TensorInfo& detectionClasses,
145  const TensorInfo& detectionScores,
146  const TensorInfo& numDetections,
147  const DetectionPostProcessDescriptor& descriptor,
149 
151  const TensorInfo& input,
152  const TensorInfo& output,
153  const DepthwiseConvolution2dDescriptor& descriptor,
154  const TensorInfo& weights,
155  const Optional<TensorInfo>& biases,
157 
158  bool IsDivisionSupported(const TensorInfo& input0,
159  const TensorInfo& input1,
160  const TensorInfo& output,
162 
163  bool IsElementwiseUnarySupported(const TensorInfo& input,
164  const TensorInfo& output,
165  const ElementwiseUnaryDescriptor& descriptor,
167 
168  bool IsFakeQuantizationSupported(const TensorInfo& input,
169  const FakeQuantizationDescriptor& descriptor,
171 
172  bool IsFillSupported(const TensorInfo& input,
173  const TensorInfo& output,
174  const FillDescriptor& descriptor,
176 
177  bool IsFloorSupported(const TensorInfo& input,
178  const TensorInfo& output,
180 
181  bool IsFullyConnectedSupported(const TensorInfo& input,
182  const TensorInfo& output,
183  const TensorInfo& weights,
184  const TensorInfo& biases,
185  const FullyConnectedDescriptor& descriptor,
187 
188  bool IsGatherSupported(const TensorInfo& input0,
189  const TensorInfo& input1,
190  const TensorInfo& output,
191  const GatherDescriptor& descriptor,
193 
194  bool IsGatherNdSupported(const TensorInfo& input0,
195  const TensorInfo& input1,
196  const TensorInfo& output,
198 
199  bool IsInputSupported(const TensorInfo& input,
201 
203  const TensorInfo& input,
204  const TensorInfo& output,
205  const InstanceNormalizationDescriptor& descriptor,
207 
208  bool IsL2NormalizationSupported(const TensorInfo& input,
209  const TensorInfo& output,
210  const L2NormalizationDescriptor& descriptor,
212 
213  bool IsLogicalBinarySupported(const TensorInfo& input0,
214  const TensorInfo& input1,
215  const TensorInfo& output,
216  const LogicalBinaryDescriptor& descriptor,
218 
219  bool IsLogicalUnarySupported(const TensorInfo& input,
220  const TensorInfo& output,
221  const ElementwiseUnaryDescriptor& descriptor,
223 
224  bool IsLogSoftmaxSupported(const TensorInfo& input,
225  const TensorInfo& output,
226  const LogSoftmaxDescriptor& descriptor,
228 
229  bool IsLstmSupported(const TensorInfo& input,
230  const TensorInfo& outputStateIn,
231  const TensorInfo& cellStateIn,
232  const TensorInfo& scratchBuffer,
233  const TensorInfo& outputStateOut,
234  const TensorInfo& cellStateOut,
235  const TensorInfo& output,
236  const LstmDescriptor& descriptor,
239 
240  bool IsMaximumSupported(const TensorInfo& input0,
241  const TensorInfo& input1,
242  const TensorInfo& output,
244 
245  bool IsMeanSupported(const TensorInfo& input,
246  const TensorInfo& output,
247  const MeanDescriptor& descriptor,
249 
250  bool IsMemCopySupported(const TensorInfo& input,
251  const TensorInfo& output,
253 
254  bool IsMemImportSupported(const TensorInfo& input,
255  const TensorInfo& output,
257 
258  bool IsMergeSupported(const TensorInfo& input0,
259  const TensorInfo& input1,
260  const TensorInfo& output,
262 
263  bool IsMinimumSupported(const TensorInfo& input0,
264  const TensorInfo& input1,
265  const TensorInfo& output,
267 
268  bool IsMultiplicationSupported(const TensorInfo& input0,
269  const TensorInfo& input1,
270  const TensorInfo& output,
272 
273  bool IsNormalizationSupported(const TensorInfo& input,
274  const TensorInfo& output,
275  const NormalizationDescriptor& descriptor,
277 
278  bool IsOutputSupported(const TensorInfo& output,
280 
281  bool IsPadSupported(const TensorInfo& input,
282  const TensorInfo& output,
283  const PadDescriptor& descriptor,
285 
286  bool IsPermuteSupported(const TensorInfo& input,
287  const TensorInfo& output,
288  const PermuteDescriptor& descriptor,
290 
291  bool IsPooling2dSupported(const TensorInfo& input,
292  const TensorInfo& output,
293  const Pooling2dDescriptor& descriptor,
295 
296  bool IsPooling3dSupported(const TensorInfo& input,
297  const TensorInfo& output,
298  const Pooling3dDescriptor& descriptor,
300 
301  bool IsPreCompiledSupported(const TensorInfo& input,
302  const PreCompiledDescriptor& descriptor,
304 
305  bool IsPreluSupported(const TensorInfo& input,
306  const TensorInfo& alpha,
307  const TensorInfo& output,
309 
310  bool IsQuantizeSupported(const TensorInfo& input,
311  const TensorInfo& output,
313 
314  bool IsQLstmSupported(const TensorInfo& input,
315  const TensorInfo& previousOutputIn,
316  const TensorInfo& previousCellStateIn,
317  const TensorInfo& outputStateOut,
318  const TensorInfo& cellStateOut,
319  const TensorInfo& output,
320  const QLstmDescriptor& descriptor,
321  const LstmInputParamsInfo& paramsInfo,
323 
324  bool IsQuantizedLstmSupported(const TensorInfo& input,
325  const TensorInfo& previousCellStateIn,
326  const TensorInfo& previousOutputIn,
327  const TensorInfo& cellStateOut,
328  const TensorInfo& output,
329  const QuantizedLstmInputParamsInfo& paramsInfo,
331 
332  bool IsRankSupported(const TensorInfo& input,
333  const TensorInfo& output,
335 
336  bool IsReduceSupported(const TensorInfo& input,
337  const TensorInfo& output,
338  const ReduceDescriptor& descriptor,
340 
341  bool IsReshapeSupported(const TensorInfo& input,
342  const TensorInfo& output,
343  const ReshapeDescriptor& descriptor,
345 
346  bool IsResizeSupported(const TensorInfo& input,
347  const TensorInfo& output,
348  const ResizeDescriptor& descriptor,
350 
351  bool IsShapeSupported(const TensorInfo& input,
352  const TensorInfo& output,
354 
355  bool IsSliceSupported(const TensorInfo& input,
356  const TensorInfo& output,
357  const SliceDescriptor& descriptor,
359 
360  bool IsSoftmaxSupported(const TensorInfo& input,
361  const TensorInfo& output,
362  const SoftmaxDescriptor& descriptor,
364 
365  bool IsSpaceToBatchNdSupported(const TensorInfo& input,
366  const TensorInfo& output,
367  const SpaceToBatchNdDescriptor& descriptor,
369 
370  bool IsSpaceToDepthSupported(const TensorInfo& input,
371  const TensorInfo& output,
372  const SpaceToDepthDescriptor& descriptor,
374 
375  bool IsSplitterSupported(const TensorInfo& input,
376  const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
377  const ViewsDescriptor& descriptor,
379 
380  bool IsStackSupported(const std::vector<const TensorInfo*>& inputs,
381  const TensorInfo& output,
382  const StackDescriptor& descriptor,
384 
385  bool IsStandInSupported(const std::vector<const TensorInfo*>& inputs,
386  const std::vector<const TensorInfo*>& outputs,
387  const StandInDescriptor& descriptor,
389 
390 
391  bool IsStridedSliceSupported(const TensorInfo& input,
392  const TensorInfo& output,
393  const StridedSliceDescriptor& descriptor,
395 
396  bool IsSubtractionSupported(const TensorInfo& input0,
397  const TensorInfo& input1,
398  const TensorInfo& output,
400 
401  bool IsSwitchSupported(const TensorInfo& input0,
402  const TensorInfo& input1,
403  const TensorInfo& output0,
404  const TensorInfo& output1,
406 
408  const TensorInfo& input,
409  const TensorInfo& output,
410  const TransposeConvolution2dDescriptor& descriptor,
411  const TensorInfo& weights,
412  const Optional<TensorInfo>& biases,
414 
415  bool IsTransposeSupported(const TensorInfo& input,
416  const TensorInfo& output,
417  const TransposeDescriptor& descriptor,
419 
420  ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This function has been deprecated, please use function without "
421  "Optional TensorInfos", "23.02")
423  const TensorInfo& input,
424  const TensorInfo& outputStateIn,
425  const TensorInfo& cellStateIn,
426  const TensorInfo& output,
429  const LstmDescriptor& descriptor,
430  const LstmInputParamsInfo& paramsInfo,
432 
434  const TensorInfo& input,
435  const TensorInfo& outputStateIn,
436  const TensorInfo& cellStateIn,
437  const TensorInfo& outputStateOut,
438  const TensorInfo& cellStateOut,
439  const TensorInfo& output,
440  const LstmDescriptor& descriptor,
441  const LstmInputParamsInfo& paramsInfo,
443 
444 private:
445  std::shared_ptr<ILayerSupport> m_LayerSupport;
446  const BackendId m_BackendId;
447 };
448 
449 /// Convenience function to retrieve the ILayerSupportHandle for a backend
451 
452 /// Convenience function to check if a capability exists in a BackendCapabilites struct
453 bool HasCapability(const std::string& name,const BackendCapabilities& capabilities);
454 
455 /// Convenience function to check if a capability exists in a backend
456 bool HasCapability(const std::string& name, const armnn::BackendId& backend);
457 
458 /// Convenience function to check if a given capability matches a capability in a BackendCapabilities struct
459 bool HasCapability(const BackendOptions::BackendOption& capability, const BackendCapabilities& capabilities);
460 
461 /// Convenience function to check if a given capability matches a capability in a backend
462 bool HasCapability(const BackendOptions::BackendOption& backendOption, const armnn::BackendId& backend);
463 
464 /// Returns a BackendCapability if the backend lists the capability
465 /// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
466 /// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
467 Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
468  const BackendCapabilities& capabilities);
469 
470 /// Returns a BackendCapability if the backend lists the capability
471 /// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
472 /// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
473 Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
474  const armnn::BackendId& backend);
475 
476 /// Returns the number of cached files if backend supports caching
477 unsigned int GetNumberOfCacheFiles(const armnn::BackendId& backend);
478 
479 }
bool IsDepthwiseConvolutionSupported(const TensorInfo &input, const TensorInfo &output, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsL2NormalizationSupported(const TensorInfo &input, const TensorInfo &output, const L2NormalizationDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsLstmSupported(const TensorInfo &input, const TensorInfo &outputStateIn, const TensorInfo &cellStateIn, const TensorInfo &scratchBuffer, const TensorInfo &outputStateOut, const TensorInfo &cellStateOut, const TensorInfo &output, const LstmDescriptor &descriptor, const LstmInputParamsInfo &paramsInfo, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsStridedSliceSupported(const TensorInfo &input, const TensorInfo &output, const StridedSliceDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool HasCapability(const std::string &name, const BackendCapabilities &capabilities)
Convenience function to check if a capability exists in a BackendCapabilites struct.
bool IsSpaceToDepthSupported(const TensorInfo &input, const TensorInfo &output, const SpaceToDepthDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A ViewsDescriptor for the SplitterLayer.
bool IsDetectionPostProcessSupported(const TensorInfo &boxEncodings, const TensorInfo &scores, const TensorInfo &anchors, const TensorInfo &detectionBoxes, const TensorInfo &detectionClasses, const TensorInfo &detectionScores, const TensorInfo &numDetections, const DetectionPostProcessDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsElementwiseUnarySupported(const TensorInfo &input, const TensorInfo &output, const ElementwiseUnaryDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
bool IsComparisonSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ComparisonDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A ReshapeDescriptor for the ReshapeLayer.
bool IsPreluSupported(const TensorInfo &input, const TensorInfo &alpha, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsPadSupported(const TensorInfo &input, const TensorInfo &output, const PadDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:89
bool IsAdditionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
Optional< const BackendOptions::BackendOption > GetCapability(const std::string &backendCapabilityName, const BackendCapabilities &capabilities)
Returns a BackendCapability if the backend lists the capability The BackendCapability must then be in...
bool IsLogicalBinarySupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const LogicalBinaryDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsDebugSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsPooling2dSupported(const TensorInfo &input, const TensorInfo &output, const Pooling2dDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A Convolution2dDescriptor for the Convolution2dLayer.
bool IsReduceSupported(const TensorInfo &input, const TensorInfo &output, const ReduceDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsInstanceNormalizationSupported(const TensorInfo &input, const TensorInfo &output, const InstanceNormalizationDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsConvolution2dSupported(const TensorInfo &input, const TensorInfo &output, const Convolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsLogicalUnarySupported(const TensorInfo &input, const TensorInfo &output, const ElementwiseUnaryDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsMemImportSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsMultiplicationSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsArgMinMaxSupported(const TensorInfo &input, const TensorInfo &output, const ArgMinMaxDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsPooling3dSupported(const TensorInfo &input, const TensorInfo &output, const Pooling3dDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
LayerSupportHandle(std::shared_ptr< ILayerSupport > layerSupport, const BackendId &backendId)
bool IsSplitterSupported(const TensorInfo &input, const std::vector< std::reference_wrapper< TensorInfo >> &outputs, const ViewsDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsInputSupported(const TensorInfo &input, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsSubtractionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsConvertFp16ToFp32Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsSoftmaxSupported(const TensorInfo &input, const TensorInfo &output, const SoftmaxDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
Copyright (c) 2021 ARM Limited and Contributors.
bool IsLogSoftmaxSupported(const TensorInfo &input, const TensorInfo &output, const LogSoftmaxDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
const TensorInfo const TensorInfo & cellStateIn
bool IsFakeQuantizationSupported(const TensorInfo &input, const FakeQuantizationDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
bool IsMergeSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsRankSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
const TensorInfo const TensorInfo const TensorInfo const Optional< TensorInfo > const Optional< TensorInfo > const LstmDescriptor & descriptor
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
const TensorInfo const TensorInfo const TensorInfo & output
const TensorInfo const TensorInfo const TensorInfo const Optional< TensorInfo > const Optional< TensorInfo > & cellStateOutput
bool IsGatherNdSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsConvertFp32ToFp16Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A ResizeDescriptor for the ResizeLayer.
bool IsResizeSupported(const TensorInfo &input, const TensorInfo &output, const ResizeDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsDepthToSpaceSupported(const TensorInfo &input, const TensorInfo &output, const DepthToSpaceDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A StackDescriptor for the StackLayer.
const TensorInfo const TensorInfo const TensorInfo const Optional< TensorInfo > const Optional< TensorInfo > const LstmDescriptor const LstmInputParamsInfo Optional< std::string & > reasonIfUnsupported
bool IsQuantizedLstmSupported(const TensorInfo &input, const TensorInfo &previousCellStateIn, const TensorInfo &previousOutputIn, const TensorInfo &cellStateOut, const TensorInfo &output, const QuantizedLstmInputParamsInfo &paramsInfo, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A PadDescriptor for the PadLayer.
bool IsFullyConnectedSupported(const TensorInfo &input, const TensorInfo &output, const TensorInfo &weights, const TensorInfo &biases, const FullyConnectedDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsStackSupported(const std::vector< const TensorInfo *> &inputs, const TensorInfo &output, const StackDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsSpaceToBatchNdSupported(const TensorInfo &input, const TensorInfo &output, const SpaceToBatchNdDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
unsigned int GetNumberOfCacheFiles(const armnn::BackendId &backend)
Returns the number of cached files if backend supports caching.
Compute
The Compute enum is now deprecated and it is now being replaced by BackendId.
Definition: BackendId.hpp:21
bool IsMinimumSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsPermuteSupported(const TensorInfo &input, const TensorInfo &output, const PermuteDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsQuantizeSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
An LstmDescriptor for the LstmLayer.
A L2NormalizationDescriptor for the L2NormalizationLayer.
bool IsFillSupported(const TensorInfo &input, const TensorInfo &output, const FillDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:67
bool IsUnidirectionalSequenceLstmSupported(const TensorInfo &input, const TensorInfo &outputStateIn, const TensorInfo &cellStateIn, const TensorInfo &outputStateOut, const TensorInfo &cellStateOut, const TensorInfo &output, const LstmDescriptor &descriptor, const LstmInputParamsInfo &paramsInfo, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
An OriginsDescriptor for the ConcatLayer.
A ReduceDescriptor for the REDUCE operators.
A FullyConnectedDescriptor for the FullyConnectedLayer.
bool IsSliceSupported(const TensorInfo &input, const TensorInfo &output, const SliceDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A FakeQuantizationDescriptor for the FakeQuantizationLayer.
bool IsTransposeConvolution2dSupported(const TensorInfo &input, const TensorInfo &output, const TransposeConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A GatherDescriptor for the GatherLayer.
bool IsBatchNormalizationSupported(const TensorInfo &input, const TensorInfo &output, const TensorInfo &mean, const TensorInfo &var, const TensorInfo &beta, const TensorInfo &gamma, const BatchNormalizationDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsBatchMatMulSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const BatchMatMulDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsConcatSupported(const std::vector< const TensorInfo *> inputs, const TensorInfo &output, const OriginsDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A StandInDescriptor for the StandIn layer.
const TensorInfo & outputStateIn
LayerSupportHandle(std::shared_ptr< ILayerSupport > layerSupport)
A QLstmDescriptor for the QLstmLayer.
bool IsConstantSupported(const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsBatchToSpaceNdSupported(const TensorInfo &input, const TensorInfo &output, const BatchToSpaceNdDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
const TensorInfo const TensorInfo const TensorInfo const Optional< TensorInfo > & hiddenStateOutput
bool IsChannelShuffleSupported(const TensorInfo &input, const TensorInfo &output, const ChannelShuffleDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsCastSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:36
bool IsReshapeSupported(const TensorInfo &input, const TensorInfo &output, const ReshapeDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A SliceDescriptor for the SliceLayer.
A Convolution3dDescriptor for the Convolution3dLayer.
bool IsOutputSupported(const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsMemCopySupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A BatchMatMulDescriptor for the BatchMatMul operator.
bool IsPreCompiledSupported(const TensorInfo &input, const PreCompiledDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A Pooling3dDescriptor for the Pooling3dLayer.
bool IsDivisionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
Struct for the users to pass backend specific options.
bool IsStandInSupported(const std::vector< const TensorInfo *> &inputs, const std::vector< const TensorInfo *> &outputs, const StandInDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsNormalizationSupported(const TensorInfo &input, const TensorInfo &output, const NormalizationDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsGatherSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const GatherDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
Definition: Optional.hpp:32
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
bool IsTransposeSupported(const TensorInfo &input, const TensorInfo &output, const TransposeDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsShapeSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsConvertFp32ToBf16Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsQLstmSupported(const TensorInfo &input, const TensorInfo &previousOutputIn, const TensorInfo &previousCellStateIn, const TensorInfo &outputStateOut, const TensorInfo &cellStateOut, const TensorInfo &output, const QLstmDescriptor &descriptor, const LstmInputParamsInfo &paramsInfo, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsConvolution3dSupported(const TensorInfo &input, const TensorInfo &output, const Convolution3dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsSwitchSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output0, const TensorInfo &output1, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This function has been deprecated, please use function without " "Optional TensorInfos", "23.02") bool IsUnidirectionalSequenceLstmSupported(const TensorInfo &input
A MeanDescriptor for the MeanLayer.
A TransposeDescriptor for the TransposeLayer.
A StridedSliceDescriptor for the StridedSliceLayer.
bool IsConvertBf16ToFp32Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsMaximumSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A PreCompiledDescriptor for the PreCompiledLayer.
bool IsMeanSupported(const TensorInfo &input, const TensorInfo &output, const MeanDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A Pooling2dDescriptor for the Pooling2dLayer.
LayerSupportHandle GetILayerSupportByBackendId(const armnn::BackendId &backend)
Convenience function to retrieve the ILayerSupportHandle for a backend.
A NormalizationDescriptor for the NormalizationLayer.
bool IsDequantizeSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
A ChannelShuffleDescriptor for the ChannelShuffle operator.
bool IsActivationSupported(const TensorInfo &input, const TensorInfo &output, const ActivationDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A SoftmaxDescriptor for the SoftmaxLayer.
const TensorInfo const TensorInfo const TensorInfo const Optional< TensorInfo > const Optional< TensorInfo > const LstmDescriptor const LstmInputParamsInfo & paramsInfo
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A FillDescriptor for the FillLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
A PermuteDescriptor for the PermuteLayer.
bool IsDilatedDepthwiseConvolutionSupported(const TensorInfo &input, const TensorInfo &output, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsFloorSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())