ArmNN
 22.02
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,
33  const ActivationDescriptor& descriptor,
34  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
35 
36  bool IsAdditionSupported(const TensorInfo& input0,
37  const TensorInfo& input1,
38  const TensorInfo& output,
39  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
40 
41  bool IsArgMinMaxSupported(const TensorInfo& input,
42  const TensorInfo& output,
43  const ArgMinMaxDescriptor& descriptor,
44  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
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,
53  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
54 
55  bool IsBatchToSpaceNdSupported(const TensorInfo& input,
56  const TensorInfo& output,
57  const BatchToSpaceNdDescriptor& descriptor,
58  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
59 
60  bool IsCastSupported(const TensorInfo& input,
61  const TensorInfo& output,
62  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
63 
64  bool IsChannelShuffleSupported(const TensorInfo& input,
65  const TensorInfo& output,
66  const ChannelShuffleDescriptor& descriptor,
67  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
68 
69  bool IsComparisonSupported(const TensorInfo& input0,
70  const TensorInfo& input1,
71  const TensorInfo& output,
72  const ComparisonDescriptor& descriptor,
73  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
74 
75  bool IsConcatSupported(const std::vector<const TensorInfo*> inputs,
76  const TensorInfo& output,
77  const OriginsDescriptor& descriptor,
78  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
79 
80  bool IsConstantSupported(const TensorInfo& output,
81  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
82 
83  bool IsConvertBf16ToFp32Supported(const TensorInfo& input,
84  const TensorInfo& output,
85  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
86 
87  bool IsConvertFp32ToBf16Supported(const TensorInfo& input,
88  const TensorInfo& output,
89  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
90 
91  bool IsConvertFp16ToFp32Supported(const TensorInfo& input,
92  const TensorInfo& output,
93  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
94 
95  bool IsConvertFp32ToFp16Supported(const TensorInfo& input,
96  const TensorInfo& output,
97  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
98 
99  bool IsConvolution2dSupported(const TensorInfo& input,
100  const TensorInfo& output,
101  const Convolution2dDescriptor& descriptor,
102  const TensorInfo& weights,
103  const Optional<TensorInfo>& biases,
104  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
105 
106  bool IsConvolution3dSupported(const TensorInfo& input,
107  const TensorInfo& output,
108  const Convolution3dDescriptor& descriptor,
109  const TensorInfo& weights,
110  const Optional<TensorInfo>& biases,
111  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
112 
113  bool IsDebugSupported(const TensorInfo& input,
114  const TensorInfo& output,
115  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
116 
117  bool IsDepthToSpaceSupported(const TensorInfo& input,
118  const TensorInfo& output,
119  const DepthToSpaceDescriptor& descriptor,
120  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
121 
123  const TensorInfo& input,
124  const TensorInfo& output,
125  const DepthwiseConvolution2dDescriptor& descriptor,
126  const TensorInfo& weights,
127  const Optional<TensorInfo>& biases,
128  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
129 
130  bool IsDequantizeSupported(const TensorInfo& input,
131  const TensorInfo& output,
132  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
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,
142  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
143 
145  const TensorInfo& input,
146  const TensorInfo& output,
147  const DepthwiseConvolution2dDescriptor& descriptor,
148  const TensorInfo& weights,
149  const Optional<TensorInfo>& biases,
150  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
151 
152  bool IsDivisionSupported(const TensorInfo& input0,
153  const TensorInfo& input1,
154  const TensorInfo& output,
155  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
156 
157  bool IsElementwiseUnarySupported(const TensorInfo& input,
158  const TensorInfo& output,
159  const ElementwiseUnaryDescriptor& descriptor,
160  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
161 
162  bool IsFakeQuantizationSupported(const TensorInfo& input,
163  const FakeQuantizationDescriptor& descriptor,
164  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
165 
166  bool IsFillSupported(const TensorInfo& input,
167  const TensorInfo& output,
168  const FillDescriptor& descriptor,
169  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
170 
171  bool IsFloorSupported(const TensorInfo& input,
172  const TensorInfo& output,
173  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
174 
175  bool IsFullyConnectedSupported(const TensorInfo& input,
176  const TensorInfo& output,
177  const TensorInfo& weights,
178  const TensorInfo& biases,
179  const FullyConnectedDescriptor& descriptor,
180  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
181 
182  bool IsGatherSupported(const TensorInfo& input0,
183  const TensorInfo& input1,
184  const TensorInfo& output,
185  const GatherDescriptor& descriptor,
186  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
187 
188  bool IsInputSupported(const TensorInfo& input,
189  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
190 
192  const TensorInfo& input,
193  const TensorInfo& output,
194  const InstanceNormalizationDescriptor& descriptor,
195  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
196 
197  bool IsL2NormalizationSupported(const TensorInfo& input,
198  const TensorInfo& output,
199  const L2NormalizationDescriptor& descriptor,
200  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
201 
202  bool IsLogicalBinarySupported(const TensorInfo& input0,
203  const TensorInfo& input1,
204  const TensorInfo& output,
205  const LogicalBinaryDescriptor& descriptor,
206  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
207 
208  bool IsLogicalUnarySupported(const TensorInfo& input,
209  const TensorInfo& output,
210  const ElementwiseUnaryDescriptor& descriptor,
211  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
212 
213  bool IsLogSoftmaxSupported(const TensorInfo& input,
214  const TensorInfo& output,
215  const LogSoftmaxDescriptor& descriptor,
216  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
217 
218  bool IsLstmSupported(const TensorInfo& input,
219  const TensorInfo& outputStateIn,
220  const TensorInfo& cellStateIn,
221  const TensorInfo& scratchBuffer,
222  const TensorInfo& outputStateOut,
223  const TensorInfo& cellStateOut,
224  const TensorInfo& output,
225  const LstmDescriptor& descriptor,
226  const LstmInputParamsInfo& paramsInfo,
227  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
228 
229  bool IsMaximumSupported(const TensorInfo& input0,
230  const TensorInfo& input1,
231  const TensorInfo& output,
232  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
233 
234  bool IsMeanSupported(const TensorInfo& input,
235  const TensorInfo& output,
236  const MeanDescriptor& descriptor,
237  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
238 
239  bool IsMemCopySupported(const TensorInfo& input,
240  const TensorInfo& output,
241  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
242 
243  bool IsMemImportSupported(const TensorInfo& input,
244  const TensorInfo& output,
245  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
246 
247  bool IsMergeSupported(const TensorInfo& input0,
248  const TensorInfo& input1,
249  const TensorInfo& output,
250  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
251 
252  bool IsMinimumSupported(const TensorInfo& input0,
253  const TensorInfo& input1,
254  const TensorInfo& output,
255  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
256 
257  bool IsMultiplicationSupported(const TensorInfo& input0,
258  const TensorInfo& input1,
259  const TensorInfo& output,
260  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
261 
262  bool IsNormalizationSupported(const TensorInfo& input,
263  const TensorInfo& output,
264  const NormalizationDescriptor& descriptor,
265  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
266 
267  bool IsOutputSupported(const TensorInfo& output,
268  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
269 
270  bool IsPadSupported(const TensorInfo& input,
271  const TensorInfo& output,
272  const PadDescriptor& descriptor,
273  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
274 
275  bool IsPermuteSupported(const TensorInfo& input,
276  const TensorInfo& output,
277  const PermuteDescriptor& descriptor,
278  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
279 
280  bool IsPooling2dSupported(const TensorInfo& input,
281  const TensorInfo& output,
282  const Pooling2dDescriptor& descriptor,
283  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
284 
285  bool IsPooling3dSupported(const TensorInfo& input,
286  const TensorInfo& output,
287  const Pooling3dDescriptor& descriptor,
288  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
289 
290  bool IsPreCompiledSupported(const TensorInfo& input,
291  const PreCompiledDescriptor& descriptor,
292  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
293 
294  bool IsPreluSupported(const TensorInfo& input,
295  const TensorInfo& alpha,
296  const TensorInfo& output,
297  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
298 
299  bool IsQuantizeSupported(const TensorInfo& input,
300  const TensorInfo& output,
301  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
302 
303  bool IsQLstmSupported(const TensorInfo& input,
304  const TensorInfo& previousOutputIn,
305  const TensorInfo& previousCellStateIn,
306  const TensorInfo& outputStateOut,
307  const TensorInfo& cellStateOut,
308  const TensorInfo& output,
309  const QLstmDescriptor& descriptor,
310  const LstmInputParamsInfo& paramsInfo,
311  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
312 
313  bool IsQuantizedLstmSupported(const TensorInfo& input,
314  const TensorInfo& previousCellStateIn,
315  const TensorInfo& previousOutputIn,
316  const TensorInfo& cellStateOut,
317  const TensorInfo& output,
318  const QuantizedLstmInputParamsInfo& paramsInfo,
319  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
320 
321  bool IsRankSupported(const TensorInfo& input,
322  const TensorInfo& output,
323  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
324 
325  bool IsReduceSupported(const TensorInfo& input,
326  const TensorInfo& output,
327  const ReduceDescriptor& descriptor,
328  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
329 
330  bool IsReshapeSupported(const TensorInfo& input,
331  const TensorInfo& output,
332  const ReshapeDescriptor& descriptor,
333  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
334 
335  bool IsResizeSupported(const TensorInfo& input,
336  const TensorInfo& output,
337  const ResizeDescriptor& descriptor,
338  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
339 
340  bool IsShapeSupported(const TensorInfo& input,
341  const TensorInfo& output,
342  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
343 
344  bool IsSliceSupported(const TensorInfo& input,
345  const TensorInfo& output,
346  const SliceDescriptor& descriptor,
347  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
348 
349  bool IsSoftmaxSupported(const TensorInfo& input,
350  const TensorInfo& output,
351  const SoftmaxDescriptor& descriptor,
352  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
353 
354  bool IsSpaceToBatchNdSupported(const TensorInfo& input,
355  const TensorInfo& output,
356  const SpaceToBatchNdDescriptor& descriptor,
357  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
358 
359  bool IsSpaceToDepthSupported(const TensorInfo& input,
360  const TensorInfo& output,
361  const SpaceToDepthDescriptor& descriptor,
362  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
363 
364  bool IsSplitterSupported(const TensorInfo& input,
365  const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
366  const ViewsDescriptor& descriptor,
367  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
368 
369  bool IsStackSupported(const std::vector<const TensorInfo*>& inputs,
370  const TensorInfo& output,
371  const StackDescriptor& descriptor,
372  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
373 
374  bool IsStandInSupported(const std::vector<const TensorInfo*>& inputs,
375  const std::vector<const TensorInfo*>& outputs,
376  const StandInDescriptor& descriptor,
377  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
378 
379 
380  bool IsStridedSliceSupported(const TensorInfo& input,
381  const TensorInfo& output,
382  const StridedSliceDescriptor& descriptor,
383  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
384 
385  bool IsSubtractionSupported(const TensorInfo& input0,
386  const TensorInfo& input1,
387  const TensorInfo& output,
388  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
389 
390  bool IsSwitchSupported(const TensorInfo& input0,
391  const TensorInfo& input1,
392  const TensorInfo& output0,
393  const TensorInfo& output1,
394  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
395 
397  const TensorInfo& input,
398  const TensorInfo& output,
399  const TransposeConvolution2dDescriptor& descriptor,
400  const TensorInfo& weights,
401  const Optional<TensorInfo>& biases,
402  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
403 
404  bool IsTransposeSupported(const TensorInfo& input,
405  const TensorInfo& output,
406  const TransposeDescriptor& descriptor,
407  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
408 
410  const TensorInfo& input,
411  const TensorInfo& outputStateIn,
412  const TensorInfo& cellStateIn,
413  const TensorInfo& output,
414  const Optional<TensorInfo>& hiddenStateOutput,
415  const Optional<TensorInfo>& cellStateOutput,
416  const LstmDescriptor& descriptor,
417  const LstmInputParamsInfo& paramsInfo,
418  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
419 
420 private:
421  std::shared_ptr<ILayerSupport> m_LayerSupport;
422  const BackendId m_BackendId;
423 };
424 
425 /// Convenience function to retrieve the ILayerSupportHandle for a backend
427 
428 /// Convenience function to check if a capability exists in a BackendCapabilites struct
429 bool HasCapability(const std::string& name,const BackendCapabilities& capabilities);
430 
431 /// Convenience function to check if a capability exists in a backend
432 bool HasCapability(const std::string& name, const armnn::BackendId& backend);
433 
434 /// Convenience function to check if a given capability matches a capability in a BackendCapabilities struct
435 bool HasCapability(const BackendOptions::BackendOption& capability, const BackendCapabilities& capabilities);
436 
437 /// Convenience function to check if a given capability matches a capability in a backend
438 bool HasCapability(const BackendOptions::BackendOption& backendOption, const armnn::BackendId& backend);
439 
440 /// Returns a BackendCapability if the backend lists the capability
441 /// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
442 /// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
443 Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
444  const BackendCapabilities& capabilities);
445 
446 /// Returns a BackendCapability if the backend lists the capability
447 /// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
448 /// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
449 Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
450  const armnn::BackendId& backend);
451 
452 /// Convenience function to check a capability on a backend
453 ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This function has been deprecated in favour of GetBackendCapability", "22.05")
454 bool IsCapabilitySupported(const armnn::BackendId& backend, armnn::BackendCapability capability);
455 
456 /// Returns the number of cached files if backend supports caching
457 unsigned int GetNumberOfCacheFiles(const armnn::BackendId& backend);
458 
459 }
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())
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())
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
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.
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.
bool IsUnidirectionalSequenceLstmSupported(const TensorInfo &input, const TensorInfo &outputStateIn, const TensorInfo &cellStateIn, const TensorInfo &output, const Optional< TensorInfo > &hiddenStateOutput, const Optional< TensorInfo > &cellStateOutput, const LstmDescriptor &descriptor, const LstmInputParamsInfo &paramsInfo, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A L2NormalizationDescriptor for the L2NormalizationLayer.
BackendCapability
BackendCapability class.
Definition: Types.hpp:254
bool IsFillSupported(const TensorInfo &input, const TensorInfo &output, const FillDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:67
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.
ARMNN_NO_DEPRECATE_WARN_BEGIN struct ARMNN_DEPRECATED_MSG_REMOVAL_DATE("ResizeBilinearQueueDescriptor is deprecated use ResizeQueueDescriptor instead", "22.08") ResizeBilinearQueueDescriptor
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.
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())
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())
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.
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())