ArmNN
 21.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,
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 IsPreCompiledSupported(const TensorInfo& input,
286  const PreCompiledDescriptor& descriptor,
287  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
288 
289  bool IsPreluSupported(const TensorInfo& input,
290  const TensorInfo& alpha,
291  const TensorInfo& output,
292  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
293 
294  bool IsQuantizeSupported(const TensorInfo& input,
295  const TensorInfo& output,
296  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
297 
298  bool IsQLstmSupported(const TensorInfo& input,
299  const TensorInfo& previousOutputIn,
300  const TensorInfo& previousCellStateIn,
301  const TensorInfo& outputStateOut,
302  const TensorInfo& cellStateOut,
303  const TensorInfo& output,
304  const QLstmDescriptor& descriptor,
305  const LstmInputParamsInfo& paramsInfo,
306  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
307 
308  bool IsQuantizedLstmSupported(const TensorInfo& input,
309  const TensorInfo& previousCellStateIn,
310  const TensorInfo& previousOutputIn,
311  const TensorInfo& cellStateOut,
312  const TensorInfo& output,
313  const QuantizedLstmInputParamsInfo& paramsInfo,
314  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
315 
316  bool IsRankSupported(const TensorInfo& input,
317  const TensorInfo& output,
318  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
319 
320  bool IsReduceSupported(const TensorInfo& input,
321  const TensorInfo& output,
322  const ReduceDescriptor& descriptor,
323  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
324 
325  bool IsReshapeSupported(const TensorInfo& input,
326  const TensorInfo& output,
327  const ReshapeDescriptor& descriptor,
328  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
329 
330  bool IsResizeSupported(const TensorInfo& input,
331  const TensorInfo& output,
332  const ResizeDescriptor& descriptor,
333  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
334 
335  bool IsShapeSupported(const TensorInfo& input,
336  const TensorInfo& output,
337  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
338 
339  bool IsSliceSupported(const TensorInfo& input,
340  const TensorInfo& output,
341  const SliceDescriptor& descriptor,
342  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
343 
344  bool IsSoftmaxSupported(const TensorInfo& input,
345  const TensorInfo& output,
346  const SoftmaxDescriptor& descriptor,
347  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
348 
349  bool IsSpaceToBatchNdSupported(const TensorInfo& input,
350  const TensorInfo& output,
351  const SpaceToBatchNdDescriptor& descriptor,
352  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
353 
354  bool IsSpaceToDepthSupported(const TensorInfo& input,
355  const TensorInfo& output,
356  const SpaceToDepthDescriptor& descriptor,
357  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
358 
359  bool IsSplitterSupported(const TensorInfo& input,
360  const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
361  const ViewsDescriptor& descriptor,
362  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
363 
364  bool IsStackSupported(const std::vector<const TensorInfo*>& inputs,
365  const TensorInfo& output,
366  const StackDescriptor& descriptor,
367  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
368 
369  bool IsStandInSupported(const std::vector<const TensorInfo*>& inputs,
370  const std::vector<const TensorInfo*>& outputs,
371  const StandInDescriptor& descriptor,
372  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
373 
374 
375  bool IsStridedSliceSupported(const TensorInfo& input,
376  const TensorInfo& output,
377  const StridedSliceDescriptor& descriptor,
378  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
379 
380  bool IsSubtractionSupported(const TensorInfo& input0,
381  const TensorInfo& input1,
382  const TensorInfo& output,
383  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
384 
385  bool IsSwitchSupported(const TensorInfo& input0,
386  const TensorInfo& input1,
387  const TensorInfo& output0,
388  const TensorInfo& output1,
389  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
390 
392  const TensorInfo& input,
393  const TensorInfo& output,
394  const TransposeConvolution2dDescriptor& descriptor,
395  const TensorInfo& weights,
396  const Optional<TensorInfo>& biases,
397  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
398 
399  bool IsTransposeSupported(const TensorInfo& input,
400  const TensorInfo& output,
401  const TransposeDescriptor& descriptor,
402  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
403 
405  const TensorInfo& input,
406  const TensorInfo& outputStateIn,
407  const TensorInfo& cellStateIn,
408  const TensorInfo& output,
409  const Optional<TensorInfo>& hiddenStateOutput,
410  const Optional<TensorInfo>& cellStateOutput,
411  const LstmDescriptor& descriptor,
412  const LstmInputParamsInfo& paramsInfo,
413  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
414 
415 private:
416  std::shared_ptr<ILayerSupport> m_LayerSupport;
417  const BackendId m_BackendId;
418 };
419 
420 /// Convenience function to retrieve the ILayerSupportHandle for a backend
422 
423 /// Convenience function to check if a capability exists in a BackendCapabilites struct
424 bool HasCapability(const std::string& name,const BackendCapabilities& capabilities);
425 
426 /// Convenience function to check if a capability exists in a backend
427 bool HasCapability(const std::string& name, const armnn::BackendId& backend);
428 
429 /// Convenience function to check if a given capability matches a capability in a BackendCapabilities struct
430 bool HasCapability(const BackendOptions::BackendOption& capability, const BackendCapabilities& capabilities);
431 
432 /// Convenience function to check if a given capability matches a capability in a backend
433 bool HasCapability(const BackendOptions::BackendOption& backendOption, const armnn::BackendId& backend);
434 
435 /// Returns a BackendCapability if the backend lists the capability
436 /// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
437 /// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
438 Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
439  const BackendCapabilities& capabilities);
440 
441 /// Returns a BackendCapability if the backend lists the capability
442 /// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
443 /// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
444 Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
445  const armnn::BackendId& backend);
446 
447 /// Convenience function to check a capability on a backend
448 ARMNN_DEPRECATED_MSG_REMOVAL_DATE("This function has been deprecated in favour of GetBackendCapability", "22.05")
449 bool IsCapabilitySupported(const armnn::BackendId& backend, armnn::BackendCapability capability);
450 
451 /// Returns the number of cached files if backend supports caching
452 unsigned int GetNumberOfCacheFiles(const armnn::BackendId& backend);
453 
454 }
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:78
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())
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:56
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.
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())
class ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use ABI stable IStrategy instead.", "22.05") ILayerVisitor
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:25
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())
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.
Definition: Descriptors.hpp:98
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())