ArmNN
 22.05
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 IsBatchNormalizationSupported(const TensorInfo& input,
47  const TensorInfo& output,
48  const TensorInfo& mean,
49  const TensorInfo& var,
50  const TensorInfo& beta,
51  const TensorInfo& gamma,
52  const BatchNormalizationDescriptor& descriptor,
54 
55  bool IsBatchToSpaceNdSupported(const TensorInfo& input,
56  const TensorInfo& output,
57  const BatchToSpaceNdDescriptor& descriptor,
59 
60  bool IsCastSupported(const TensorInfo& input,
61  const TensorInfo& output,
63 
64  bool IsChannelShuffleSupported(const TensorInfo& input,
65  const TensorInfo& output,
66  const ChannelShuffleDescriptor& descriptor,
68 
69  bool IsComparisonSupported(const TensorInfo& input0,
70  const TensorInfo& input1,
71  const TensorInfo& output,
72  const ComparisonDescriptor& descriptor,
74 
75  bool IsConcatSupported(const std::vector<const TensorInfo*> inputs,
76  const TensorInfo& output,
77  const OriginsDescriptor& descriptor,
79 
80  bool IsConstantSupported(const TensorInfo& output,
82 
83  bool IsConvertBf16ToFp32Supported(const TensorInfo& input,
84  const TensorInfo& output,
86 
87  bool IsConvertFp32ToBf16Supported(const TensorInfo& input,
88  const TensorInfo& output,
90 
91  bool IsConvertFp16ToFp32Supported(const TensorInfo& input,
92  const TensorInfo& output,
94 
95  bool IsConvertFp32ToFp16Supported(const TensorInfo& input,
96  const TensorInfo& output,
98 
99  bool IsConvolution2dSupported(const TensorInfo& input,
100  const TensorInfo& output,
101  const Convolution2dDescriptor& descriptor,
102  const TensorInfo& weights,
103  const Optional<TensorInfo>& biases,
105 
106  bool IsConvolution3dSupported(const TensorInfo& input,
107  const TensorInfo& output,
108  const Convolution3dDescriptor& descriptor,
109  const TensorInfo& weights,
110  const Optional<TensorInfo>& biases,
112 
113  bool IsDebugSupported(const TensorInfo& input,
114  const TensorInfo& output,
116 
117  bool IsDepthToSpaceSupported(const TensorInfo& input,
118  const TensorInfo& output,
119  const DepthToSpaceDescriptor& descriptor,
121 
123  const TensorInfo& input,
124  const TensorInfo& output,
125  const DepthwiseConvolution2dDescriptor& descriptor,
126  const TensorInfo& weights,
127  const Optional<TensorInfo>& biases,
129 
130  bool IsDequantizeSupported(const TensorInfo& input,
131  const TensorInfo& output,
133 
134  bool IsDetectionPostProcessSupported(const TensorInfo& boxEncodings,
135  const TensorInfo& scores,
136  const TensorInfo& anchors,
137  const TensorInfo& detectionBoxes,
138  const TensorInfo& detectionClasses,
139  const TensorInfo& detectionScores,
140  const TensorInfo& numDetections,
141  const DetectionPostProcessDescriptor& descriptor,
143 
145  const TensorInfo& input,
146  const TensorInfo& output,
147  const DepthwiseConvolution2dDescriptor& descriptor,
148  const TensorInfo& weights,
149  const Optional<TensorInfo>& biases,
151 
152  bool IsDivisionSupported(const TensorInfo& input0,
153  const TensorInfo& input1,
154  const TensorInfo& output,
156 
157  bool IsElementwiseUnarySupported(const TensorInfo& input,
158  const TensorInfo& output,
159  const ElementwiseUnaryDescriptor& descriptor,
161 
162  bool IsFakeQuantizationSupported(const TensorInfo& input,
163  const FakeQuantizationDescriptor& descriptor,
165 
166  bool IsFillSupported(const TensorInfo& input,
167  const TensorInfo& output,
168  const FillDescriptor& descriptor,
170 
171  bool IsFloorSupported(const TensorInfo& input,
172  const TensorInfo& output,
174 
175  bool IsFullyConnectedSupported(const TensorInfo& input,
176  const TensorInfo& output,
177  const TensorInfo& weights,
178  const TensorInfo& biases,
179  const FullyConnectedDescriptor& descriptor,
181 
182  bool IsGatherSupported(const TensorInfo& input0,
183  const TensorInfo& input1,
184  const TensorInfo& output,
185  const GatherDescriptor& descriptor,
187 
188  bool IsGatherNdSupported(const TensorInfo& input0,
189  const TensorInfo& input1,
190  const TensorInfo& output,
192 
193  bool IsInputSupported(const TensorInfo& input,
195 
197  const TensorInfo& input,
198  const TensorInfo& output,
199  const InstanceNormalizationDescriptor& descriptor,
201 
202  bool IsL2NormalizationSupported(const TensorInfo& input,
203  const TensorInfo& output,
204  const L2NormalizationDescriptor& descriptor,
206 
207  bool IsLogicalBinarySupported(const TensorInfo& input0,
208  const TensorInfo& input1,
209  const TensorInfo& output,
210  const LogicalBinaryDescriptor& descriptor,
212 
213  bool IsLogicalUnarySupported(const TensorInfo& input,
214  const TensorInfo& output,
215  const ElementwiseUnaryDescriptor& descriptor,
217 
218  bool IsLogSoftmaxSupported(const TensorInfo& input,
219  const TensorInfo& output,
220  const LogSoftmaxDescriptor& descriptor,
222 
223  bool IsLstmSupported(const TensorInfo& input,
224  const TensorInfo& outputStateIn,
225  const TensorInfo& cellStateIn,
226  const TensorInfo& scratchBuffer,
227  const TensorInfo& outputStateOut,
228  const TensorInfo& cellStateOut,
229  const TensorInfo& output,
230  const LstmDescriptor& descriptor,
233 
234  bool IsMaximumSupported(const TensorInfo& input0,
235  const TensorInfo& input1,
236  const TensorInfo& output,
238 
239  bool IsMeanSupported(const TensorInfo& input,
240  const TensorInfo& output,
241  const MeanDescriptor& descriptor,
243 
244  bool IsMemCopySupported(const TensorInfo& input,
245  const TensorInfo& output,
247 
248  bool IsMemImportSupported(const TensorInfo& input,
249  const TensorInfo& output,
251 
252  bool IsMergeSupported(const TensorInfo& input0,
253  const TensorInfo& input1,
254  const TensorInfo& output,
256 
257  bool IsMinimumSupported(const TensorInfo& input0,
258  const TensorInfo& input1,
259  const TensorInfo& output,
261 
262  bool IsMultiplicationSupported(const TensorInfo& input0,
263  const TensorInfo& input1,
264  const TensorInfo& output,
266 
267  bool IsNormalizationSupported(const TensorInfo& input,
268  const TensorInfo& output,
269  const NormalizationDescriptor& descriptor,
271 
272  bool IsOutputSupported(const TensorInfo& output,
274 
275  bool IsPadSupported(const TensorInfo& input,
276  const TensorInfo& output,
277  const PadDescriptor& descriptor,
279 
280  bool IsPermuteSupported(const TensorInfo& input,
281  const TensorInfo& output,
282  const PermuteDescriptor& descriptor,
284 
285  bool IsPooling2dSupported(const TensorInfo& input,
286  const TensorInfo& output,
287  const Pooling2dDescriptor& descriptor,
289 
290  bool IsPooling3dSupported(const TensorInfo& input,
291  const TensorInfo& output,
292  const Pooling3dDescriptor& descriptor,
294 
295  bool IsPreCompiledSupported(const TensorInfo& input,
296  const PreCompiledDescriptor& descriptor,
298 
299  bool IsPreluSupported(const TensorInfo& input,
300  const TensorInfo& alpha,
301  const TensorInfo& output,
303 
304  bool IsQuantizeSupported(const TensorInfo& input,
305  const TensorInfo& output,
307 
308  bool IsQLstmSupported(const TensorInfo& input,
309  const TensorInfo& previousOutputIn,
310  const TensorInfo& previousCellStateIn,
311  const TensorInfo& outputStateOut,
312  const TensorInfo& cellStateOut,
313  const TensorInfo& output,
314  const QLstmDescriptor& descriptor,
315  const LstmInputParamsInfo& paramsInfo,
317 
318  bool IsQuantizedLstmSupported(const TensorInfo& input,
319  const TensorInfo& previousCellStateIn,
320  const TensorInfo& previousOutputIn,
321  const TensorInfo& cellStateOut,
322  const TensorInfo& output,
323  const QuantizedLstmInputParamsInfo& paramsInfo,
325 
326  bool IsRankSupported(const TensorInfo& input,
327  const TensorInfo& output,
329 
330  bool IsReduceSupported(const TensorInfo& input,
331  const TensorInfo& output,
332  const ReduceDescriptor& descriptor,
334 
335  bool IsReshapeSupported(const TensorInfo& input,
336  const TensorInfo& output,
337  const ReshapeDescriptor& descriptor,
339 
340  bool IsResizeSupported(const TensorInfo& input,
341  const TensorInfo& output,
342  const ResizeDescriptor& descriptor,
344 
345  bool IsShapeSupported(const TensorInfo& input,
346  const TensorInfo& output,
348 
349  bool IsSliceSupported(const TensorInfo& input,
350  const TensorInfo& output,
351  const SliceDescriptor& descriptor,
353 
354  bool IsSoftmaxSupported(const TensorInfo& input,
355  const TensorInfo& output,
356  const SoftmaxDescriptor& descriptor,
358 
359  bool IsSpaceToBatchNdSupported(const TensorInfo& input,
360  const TensorInfo& output,
361  const SpaceToBatchNdDescriptor& descriptor,
363 
364  bool IsSpaceToDepthSupported(const TensorInfo& input,
365  const TensorInfo& output,
366  const SpaceToDepthDescriptor& descriptor,
368 
369  bool IsSplitterSupported(const TensorInfo& input,
370  const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
371  const ViewsDescriptor& descriptor,
373 
374  bool IsStackSupported(const std::vector<const TensorInfo*>& inputs,
375  const TensorInfo& output,
376  const StackDescriptor& descriptor,
378 
379  bool IsStandInSupported(const std::vector<const TensorInfo*>& inputs,
380  const std::vector<const TensorInfo*>& outputs,
381  const StandInDescriptor& descriptor,
383 
384 
385  bool IsStridedSliceSupported(const TensorInfo& input,
386  const TensorInfo& output,
387  const StridedSliceDescriptor& descriptor,
389 
390  bool IsSubtractionSupported(const TensorInfo& input0,
391  const TensorInfo& input1,
392  const TensorInfo& output,
394 
395  bool IsSwitchSupported(const TensorInfo& input0,
396  const TensorInfo& input1,
397  const TensorInfo& output0,
398  const TensorInfo& output1,
400 
402  const TensorInfo& input,
403  const TensorInfo& output,
404  const TransposeConvolution2dDescriptor& descriptor,
405  const TensorInfo& weights,
406  const Optional<TensorInfo>& biases,
408 
409  bool IsTransposeSupported(const TensorInfo& input,
410  const TensorInfo& output,
411  const TransposeDescriptor& descriptor,
413 
414  ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This function has been deprecated, please use function without "
415  "Optional TensorInfos", "23.02")
417  const TensorInfo& input,
418  const TensorInfo& outputStateIn,
419  const TensorInfo& cellStateIn,
420  const TensorInfo& output,
423  const LstmDescriptor& descriptor,
424  const LstmInputParamsInfo& paramsInfo,
426 
428  const TensorInfo& input,
429  const TensorInfo& outputStateIn,
430  const TensorInfo& cellStateIn,
431  const TensorInfo& outputStateOut,
432  const TensorInfo& cellStateOut,
433  const TensorInfo& output,
434  const LstmDescriptor& descriptor,
435  const LstmInputParamsInfo& paramsInfo,
437 
438 private:
439  std::shared_ptr<ILayerSupport> m_LayerSupport;
440  const BackendId m_BackendId;
441 };
442 
443 /// Convenience function to retrieve the ILayerSupportHandle for a backend
445 
446 /// Convenience function to check if a capability exists in a BackendCapabilites struct
447 bool HasCapability(const std::string& name,const BackendCapabilities& capabilities);
448 
449 /// Convenience function to check if a capability exists in a backend
450 bool HasCapability(const std::string& name, const armnn::BackendId& backend);
451 
452 /// Convenience function to check if a given capability matches a capability in a BackendCapabilities struct
453 bool HasCapability(const BackendOptions::BackendOption& capability, const BackendCapabilities& capabilities);
454 
455 /// Convenience function to check if a given capability matches a capability in a backend
456 bool HasCapability(const BackendOptions::BackendOption& backendOption, const armnn::BackendId& backend);
457 
458 /// Returns a BackendCapability if the backend lists the capability
459 /// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
460 /// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
461 Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
462  const BackendCapabilities& capabilities);
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 armnn::BackendId& backend);
469 
470 /// Convenience function to check a capability on a backend
471 ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This function has been deprecated in favour of GetBackendCapability", "22.05")
472 bool IsCapabilitySupported(const armnn::BackendId& backend, armnn::BackendCapability capability);
473 
474 /// Returns the number of cached files if backend supports caching
475 unsigned int GetNumberOfCacheFiles(const armnn::BackendId& backend);
476 
477 }
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 ResizeBilinearDescriptor for the ResizeBilinearLayer.
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.
BackendCapability
BackendCapability class.
Definition: Types.hpp:267
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 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())
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 IsCapabilitySupported(const armnn::BackendId &backend, armnn::BackendCapability capability)
Convenience function to check a capability on a backend.
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())