ArmNN
 25.02
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BackendHelper.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017-2019,2021-2024 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <armnn/BackendId.hpp>
10 #include <armnn/Descriptors.hpp>
11 #include <armnn/Optional.hpp>
12 #include <functional>
13 #include <memory>
14 #include <string>
15 #include <utility>
16 #include <vector>
17 
18 namespace armnn
19 {
20 class ILayerSupport;
21 class TensorInfo;
22 struct LstmInputParamsInfo;
23 struct QuantizedLstmInputParamsInfo;
24 
25 // This handle calls its own IsXXXLayerSupported() functions which then call the polymorphic
26 // ILayerSupport::IsXXXLayerSupported() at the framework level so there is no risk of VTable misalignment.
27 // This is to make ILayerSupport in its abstract form a solely Backend interface alongside a
28 // separate ABI stable frontend class free of virtual functions via an added layer of indirection.
30 {
31 public:
32  explicit LayerSupportHandle(std::shared_ptr<ILayerSupport> layerSupport)
33  : m_LayerSupport(std::move(layerSupport)), m_BackendId(Compute::Undefined) {};
34 
35  explicit LayerSupportHandle(std::shared_ptr<ILayerSupport> layerSupport, const BackendId& backendId)
36  : m_LayerSupport(std::move(layerSupport)), m_BackendId(backendId) {};
37 
38  bool IsBackendRegistered() const;
39 
40  bool IsActivationSupported(const TensorInfo& input,
41  const TensorInfo& output,
42  const ActivationDescriptor& descriptor,
43  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
44 
45  ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use IsElementwiseBinarySupported instead", "24.02")
46  bool IsAdditionSupported(const TensorInfo& input0,
47  const TensorInfo& input1,
48  const TensorInfo& output,
49  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
50 
51  bool IsArgMinMaxSupported(const TensorInfo& input,
52  const TensorInfo& output,
53  const ArgMinMaxDescriptor& descriptor,
54  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
55 
56  bool IsBatchMatMulSupported(const TensorInfo& input0,
57  const TensorInfo& input1,
58  const TensorInfo& output,
59  const BatchMatMulDescriptor& descriptor,
60  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
61 
62  bool IsBatchNormalizationSupported(const TensorInfo& input,
63  const TensorInfo& output,
64  const TensorInfo& mean,
65  const TensorInfo& var,
66  const TensorInfo& beta,
67  const TensorInfo& gamma,
68  const BatchNormalizationDescriptor& descriptor,
69  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
70 
71  bool IsBatchToSpaceNdSupported(const TensorInfo& input,
72  const TensorInfo& output,
73  const BatchToSpaceNdDescriptor& descriptor,
74  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
75 
76 
77  bool IsBroadcastToSupported(const TensorInfo& input,
78  const TensorInfo& output,
79  const BroadcastToDescriptor& descriptor,
80  Optional<std::string&> reasonIfUnsupported);
81 
82  bool IsCastSupported(const TensorInfo& input,
83  const TensorInfo& output,
84  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
85 
86  bool IsChannelShuffleSupported(const TensorInfo& input,
87  const TensorInfo& output,
88  const ChannelShuffleDescriptor& descriptor,
89  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
90 
91  bool IsComparisonSupported(const TensorInfo& input0,
92  const TensorInfo& input1,
93  const TensorInfo& output,
94  const ComparisonDescriptor& descriptor,
95  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
96 
97  bool IsConcatSupported(const std::vector<const TensorInfo*> inputs,
98  const TensorInfo& output,
99  const OriginsDescriptor& descriptor,
100  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
101 
102  bool IsConstantSupported(const TensorInfo& output,
103  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
104 
105  bool IsConvertFp16ToFp32Supported(const TensorInfo& input,
106  const TensorInfo& output,
107  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
108 
109  bool IsConvertFp32ToFp16Supported(const TensorInfo& input,
110  const TensorInfo& output,
111  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
112 
113  bool IsConvolution2dSupported(const TensorInfo& input,
114  const TensorInfo& output,
115  const Convolution2dDescriptor& descriptor,
116  const TensorInfo& weights,
117  const Optional<TensorInfo>& biases,
118  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
119 
120  bool IsConvolution3dSupported(const TensorInfo& input,
121  const TensorInfo& output,
122  const Convolution3dDescriptor& descriptor,
123  const TensorInfo& weights,
124  const Optional<TensorInfo>& biases,
125  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
126 
127  bool IsDebugSupported(const TensorInfo& input,
128  const TensorInfo& output,
129  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
130 
131  bool IsDepthToSpaceSupported(const TensorInfo& input,
132  const TensorInfo& output,
133  const DepthToSpaceDescriptor& descriptor,
134  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
135 
137  const TensorInfo& input,
138  const TensorInfo& output,
139  const DepthwiseConvolution2dDescriptor& descriptor,
140  const TensorInfo& weights,
141  const Optional<TensorInfo>& biases,
142  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
143 
144  bool IsDequantizeSupported(const TensorInfo& input,
145  const TensorInfo& output,
146  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
147 
148  bool IsDetectionPostProcessSupported(const TensorInfo& boxEncodings,
149  const TensorInfo& scores,
150  const TensorInfo& anchors,
151  const TensorInfo& detectionBoxes,
152  const TensorInfo& detectionClasses,
153  const TensorInfo& detectionScores,
154  const TensorInfo& numDetections,
155  const DetectionPostProcessDescriptor& descriptor,
156  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
157 
159  const TensorInfo& input,
160  const TensorInfo& output,
161  const DepthwiseConvolution2dDescriptor& descriptor,
162  const TensorInfo& weights,
163  const Optional<TensorInfo>& biases,
164  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
165 
167  bool IsDivisionSupported(const TensorInfo& input0,
168  const TensorInfo& input1,
169  const TensorInfo& output,
170  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
171 
172  bool IsElementwiseBinarySupported(const TensorInfo& input0,
173  const TensorInfo& input1,
174  const TensorInfo& output,
175  const ElementwiseBinaryDescriptor& descriptor,
176  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
177 
178  bool IsElementwiseUnarySupported(const TensorInfo& input,
179  const TensorInfo& output,
180  const ElementwiseUnaryDescriptor& descriptor,
181  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
182 
183  bool IsFakeQuantizationSupported(const TensorInfo& input,
184  const FakeQuantizationDescriptor& descriptor,
185  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
186 
187  bool IsFillSupported(const TensorInfo& input,
188  const TensorInfo& output,
189  const FillDescriptor& descriptor,
190  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
191 
192  bool IsFloorSupported(const TensorInfo& input,
193  const TensorInfo& output,
194  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
195 
196  bool IsFullyConnectedSupported(const TensorInfo& input,
197  const TensorInfo& output,
198  const TensorInfo& weights,
199  const TensorInfo& biases,
200  const FullyConnectedDescriptor& descriptor,
201  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
202 
203  bool IsFusedSupported(const std::vector<std::reference_wrapper<TensorInfo>>& inputs,
204  const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
205  const FusedDescriptor& descriptor,
206  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
207 
208  bool IsGatherSupported(const TensorInfo& input0,
209  const TensorInfo& input1,
210  const TensorInfo& output,
211  const GatherDescriptor& descriptor,
212  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
213 
214  bool IsGatherNdSupported(const TensorInfo& input0,
215  const TensorInfo& input1,
216  const TensorInfo& output,
217  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
218 
219  bool IsInputSupported(const TensorInfo& input,
220  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
221 
223  const TensorInfo& input,
224  const TensorInfo& output,
225  const InstanceNormalizationDescriptor& descriptor,
226  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
227 
228  bool IsL2NormalizationSupported(const TensorInfo& input,
229  const TensorInfo& output,
230  const L2NormalizationDescriptor& descriptor,
231  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
232 
233  bool IsLogicalBinarySupported(const TensorInfo& input0,
234  const TensorInfo& input1,
235  const TensorInfo& output,
236  const LogicalBinaryDescriptor& descriptor,
237  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
238 
239  bool IsLogicalUnarySupported(const TensorInfo& input,
240  const TensorInfo& output,
241  const ElementwiseUnaryDescriptor& descriptor,
242  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
243 
244  bool IsLogSoftmaxSupported(const TensorInfo& input,
245  const TensorInfo& output,
246  const LogSoftmaxDescriptor& descriptor,
247  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
248 
249  bool IsLstmSupported(const TensorInfo& input,
250  const TensorInfo& outputStateIn,
251  const TensorInfo& cellStateIn,
252  const TensorInfo& scratchBuffer,
253  const TensorInfo& outputStateOut,
254  const TensorInfo& cellStateOut,
255  const TensorInfo& output,
256  const LstmDescriptor& descriptor,
257  const LstmInputParamsInfo& paramsInfo,
258  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
259 
261  bool IsMaximumSupported(const TensorInfo& input0,
262  const TensorInfo& input1,
263  const TensorInfo& output,
264  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
265 
266  bool IsMeanSupported(const TensorInfo& input,
267  const TensorInfo& output,
268  const MeanDescriptor& descriptor,
269  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
270 
271  bool IsMemCopySupported(const TensorInfo& input,
272  const TensorInfo& output,
273  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
274 
275  bool IsMemImportSupported(const TensorInfo& input,
276  const TensorInfo& output,
277  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
278 
279  bool IsMergeSupported(const TensorInfo& input0,
280  const TensorInfo& input1,
281  const TensorInfo& output,
282  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
283 
285  bool IsMinimumSupported(const TensorInfo& input0,
286  const TensorInfo& input1,
287  const TensorInfo& output,
288  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
289 
291  bool IsMultiplicationSupported(const TensorInfo& input0,
292  const TensorInfo& input1,
293  const TensorInfo& output,
294  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
295 
296  bool IsNormalizationSupported(const TensorInfo& input,
297  const TensorInfo& output,
298  const NormalizationDescriptor& descriptor,
299  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
300 
301  bool IsOutputSupported(const TensorInfo& output,
302  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
303 
304  bool IsPadSupported(const TensorInfo& input,
305  const TensorInfo& output,
306  const PadDescriptor& descriptor,
307  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
308 
309  bool IsPermuteSupported(const TensorInfo& input,
310  const TensorInfo& output,
311  const PermuteDescriptor& descriptor,
312  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
313 
314  bool IsPooling2dSupported(const TensorInfo& input,
315  const TensorInfo& output,
316  const Pooling2dDescriptor& descriptor,
317  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
318 
319  bool IsPooling3dSupported(const TensorInfo& input,
320  const TensorInfo& output,
321  const Pooling3dDescriptor& descriptor,
322  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
323 
324  bool IsPreCompiledSupported(const TensorInfo& input,
325  const PreCompiledDescriptor& descriptor,
326  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
327 
328  bool IsPreluSupported(const TensorInfo& input,
329  const TensorInfo& alpha,
330  const TensorInfo& output,
331  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
332 
333  bool IsQuantizeSupported(const TensorInfo& input,
334  const TensorInfo& output,
335  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
336 
337  bool IsQLstmSupported(const TensorInfo& input,
338  const TensorInfo& previousOutputIn,
339  const TensorInfo& previousCellStateIn,
340  const TensorInfo& outputStateOut,
341  const TensorInfo& cellStateOut,
342  const TensorInfo& output,
343  const QLstmDescriptor& descriptor,
344  const LstmInputParamsInfo& paramsInfo,
345  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
346 
347  bool IsQuantizedLstmSupported(const TensorInfo& input,
348  const TensorInfo& previousCellStateIn,
349  const TensorInfo& previousOutputIn,
350  const TensorInfo& cellStateOut,
351  const TensorInfo& output,
352  const QuantizedLstmInputParamsInfo& paramsInfo,
353  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
354 
355  bool IsRankSupported(const TensorInfo& input,
356  const TensorInfo& output,
357  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
358 
359  bool IsReduceSupported(const TensorInfo& input,
360  const TensorInfo& output,
361  const ReduceDescriptor& descriptor,
362  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
363 
364  bool IsReshapeSupported(const TensorInfo& input,
365  const TensorInfo& output,
366  const ReshapeDescriptor& descriptor,
367  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
368 
369  bool IsResizeSupported(const TensorInfo& input,
370  const TensorInfo& output,
371  const ResizeDescriptor& descriptor,
372  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
373 
374  bool IsReverseV2Supported(const TensorInfo& input0,
375  const TensorInfo& input1,
376  const TensorInfo& output,
377  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
378 
379  bool IsShapeSupported(const TensorInfo& input,
380  const TensorInfo& output,
381  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
382 
383  bool IsScatterNdSupported(const TensorInfo& input,
384  const TensorInfo& indices,
385  const TensorInfo& updates,
386  const TensorInfo& output,
387  const ScatterNdDescriptor& descriptor,
388  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
389 
390  bool IsSliceSupported(const TensorInfo& input,
391  const TensorInfo& output,
392  const SliceDescriptor& descriptor,
393  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
394 
395  bool IsSoftmaxSupported(const TensorInfo& input,
396  const TensorInfo& output,
397  const SoftmaxDescriptor& descriptor,
398  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
399 
400  bool IsSpaceToBatchNdSupported(const TensorInfo& input,
401  const TensorInfo& output,
402  const SpaceToBatchNdDescriptor& descriptor,
403  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
404 
405  bool IsSpaceToDepthSupported(const TensorInfo& input,
406  const TensorInfo& output,
407  const SpaceToDepthDescriptor& descriptor,
408  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
409 
410  bool IsSplitterSupported(const TensorInfo& input,
411  const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
412  const ViewsDescriptor& descriptor,
413  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
414 
415  bool IsStackSupported(const std::vector<const TensorInfo*>& inputs,
416  const TensorInfo& output,
417  const StackDescriptor& descriptor,
418  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
419 
420  bool IsStandInSupported(const std::vector<const TensorInfo*>& inputs,
421  const std::vector<const TensorInfo*>& outputs,
422  const StandInDescriptor& descriptor,
423  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
424 
425 
426  bool IsStridedSliceSupported(const TensorInfo& input,
427  const TensorInfo& output,
428  const StridedSliceDescriptor& descriptor,
429  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
430 
432  bool IsSubtractionSupported(const TensorInfo& input0,
433  const TensorInfo& input1,
434  const TensorInfo& output,
435  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
436 
437  bool IsSwitchSupported(const TensorInfo& input0,
438  const TensorInfo& input1,
439  const TensorInfo& output0,
440  const TensorInfo& output1,
441  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
442 
443  bool IsTileSupported(const TensorInfo& input,
444  const TensorInfo& output,
445  const TileDescriptor& descriptor,
446  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
447 
449  const TensorInfo& input,
450  const TensorInfo& output,
451  const TransposeConvolution2dDescriptor& descriptor,
452  const TensorInfo& weights,
453  const Optional<TensorInfo>& biases,
454  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
455 
456  bool IsTransposeSupported(const TensorInfo& input,
457  const TensorInfo& output,
458  const TransposeDescriptor& descriptor,
459  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
460 
462  const TensorInfo& input,
463  const TensorInfo& outputStateIn,
464  const TensorInfo& cellStateIn,
465  const TensorInfo& outputStateOut,
466  const TensorInfo& cellStateOut,
467  const TensorInfo& output,
468  const LstmDescriptor& descriptor,
469  const LstmInputParamsInfo& paramsInfo,
470  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
471 
472 private:
473  std::shared_ptr<ILayerSupport> m_LayerSupport;
474  const BackendId m_BackendId;
475 };
476 
477 /// Convenience function to retrieve the ILayerSupportHandle for a backend
479 
480 /// Convenience function to check if a capability exists in a BackendCapabilites struct
481 bool HasCapability(const std::string& name,const BackendCapabilities& capabilities);
482 
483 /// Convenience function to check if a capability exists in a backend
484 bool HasCapability(const std::string& name, const armnn::BackendId& backend);
485 
486 /// Convenience function to check if a given capability matches a capability in a BackendCapabilities struct
488 bool HasCapability(const BackendOptions::BackendOption& capability, const BackendCapabilities& capabilities);
489 
490 /// Convenience function to check if a given capability matches a capability in a backend
492 bool HasCapability(const BackendOptions::BackendOption& backendOption, const armnn::BackendId& backend);
493 
494 /// Convenience function to check if a given capability matches a capability in a BackendCapabilities struct
495 bool HasMatchingCapability(const BackendOptions::BackendOption& capability, const BackendCapabilities& capabilities);
496 
497 /// Convenience function to check if a given capability matches a capability in a backend
498 bool HasMatchingCapability(const BackendOptions::BackendOption& backendOption, const armnn::BackendId& backend);
499 
500 /// Returns a BackendCapability if the backend lists the capability
501 /// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
502 /// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
503 Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
504  const BackendCapabilities& capabilities);
505 
506 /// Returns a BackendCapability if the backend lists the capability
507 /// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
508 /// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
509 Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
510  const armnn::BackendId& backend);
511 
512 /// Returns the number of cached files if backend supports caching
513 unsigned int GetNumberOfCacheFiles(const armnn::BackendId& backend);
514 
515 }
#define ARMNN_DEPRECATED_MSG_REMOVAL_DATE(message, removed_in_release)
Definition: Deprecated.hpp:44
bool IsComparisonSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ComparisonDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsDequantizeSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsStandInSupported(const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const StandInDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsSliceSupported(const TensorInfo &input, const TensorInfo &output, const SliceDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsTileSupported(const TensorInfo &input, const TensorInfo &output, const TileDescriptor &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())
bool IsDepthToSpaceSupported(const TensorInfo &input, const TensorInfo &output, const DepthToSpaceDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsSpaceToDepthSupported(const TensorInfo &input, const TensorInfo &output, const SpaceToDepthDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsGatherNdSupported(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 IsLogicalUnarySupported(const TensorInfo &input, const TensorInfo &output, const ElementwiseUnaryDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
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())
bool IsFakeQuantizationSupported(const TensorInfo &input, const FakeQuantizationDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsMergeSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsBroadcastToSupported(const TensorInfo &input, const TensorInfo &output, const BroadcastToDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported)
LayerSupportHandle(std::shared_ptr< ILayerSupport > layerSupport)
bool IsFullyConnectedSupported(const TensorInfo &input, const TensorInfo &output, const TensorInfo &weights, const TensorInfo &biases, const FullyConnectedDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsActivationSupported(const TensorInfo &input, const TensorInfo &output, const ActivationDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsOutputSupported(const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsNormalizationSupported(const TensorInfo &input, const TensorInfo &output, const NormalizationDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsPooling2dSupported(const TensorInfo &input, const TensorInfo &output, const Pooling2dDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsPreluSupported(const TensorInfo &input, const TensorInfo &alpha, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsAdditionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, 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 IsArgMinMaxSupported(const TensorInfo &input, const TensorInfo &output, const ArgMinMaxDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsDivisionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsStackSupported(const std::vector< const TensorInfo * > &inputs, const TensorInfo &output, const StackDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
LayerSupportHandle(std::shared_ptr< ILayerSupport > layerSupport, const BackendId &backendId)
bool IsReverseV2Supported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsMaximumSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsPadSupported(const TensorInfo &input, const TensorInfo &output, const PadDescriptor &descriptor, 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 IsPreCompiledSupported(const TensorInfo &input, const PreCompiledDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsConstantSupported(const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsStridedSliceSupported(const TensorInfo &input, const TensorInfo &output, const StridedSliceDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsSplitterSupported(const TensorInfo &input, const std::vector< std::reference_wrapper< TensorInfo >> &outputs, const ViewsDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsElementwiseUnarySupported(const TensorInfo &input, const TensorInfo &output, const ElementwiseUnaryDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsTransposeSupported(const TensorInfo &input, const TensorInfo &output, const TransposeDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
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 IsGatherSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const GatherDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsRankSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsQuantizeSupported(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())
bool IsScatterNdSupported(const TensorInfo &input, const TensorInfo &indices, const TensorInfo &updates, const TensorInfo &output, const ScatterNdDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsMemImportSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsSpaceToBatchNdSupported(const TensorInfo &input, const TensorInfo &output, const SpaceToBatchNdDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsTransposeConvolution2dSupported(const TensorInfo &input, const TensorInfo &output, const TransposeConvolution2dDescriptor &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())
bool IsDilatedDepthwiseConvolutionSupported(const TensorInfo &input, const TensorInfo &output, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsCastSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsMinimumSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
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 IsQuantizedLstmSupported(const TensorInfo &input, const TensorInfo &previousCellStateIn, const TensorInfo &previousOutputIn, const TensorInfo &cellStateOut, const TensorInfo &output, const QuantizedLstmInputParamsInfo &paramsInfo, 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 IsConvertFp16ToFp32Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsL2NormalizationSupported(const TensorInfo &input, const TensorInfo &output, const L2NormalizationDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsElementwiseBinarySupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ElementwiseBinaryDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsLogSoftmaxSupported(const TensorInfo &input, const TensorInfo &output, const LogSoftmaxDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsConvertFp32ToFp16Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsSwitchSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output0, const TensorInfo &output1, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsReshapeSupported(const TensorInfo &input, const TensorInfo &output, const ReshapeDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsPooling3dSupported(const TensorInfo &input, const TensorInfo &output, const Pooling3dDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsChannelShuffleSupported(const TensorInfo &input, const TensorInfo &output, const ChannelShuffleDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsMeanSupported(const TensorInfo &input, const TensorInfo &output, const MeanDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsBatchMatMulSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const BatchMatMulDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsMemCopySupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsLogicalBinarySupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const LogicalBinaryDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsShapeSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsFillSupported(const TensorInfo &input, const TensorInfo &output, const FillDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsResizeSupported(const TensorInfo &input, const TensorInfo &output, const ResizeDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsFusedSupported(const std::vector< std::reference_wrapper< TensorInfo >> &inputs, const std::vector< std::reference_wrapper< TensorInfo >> &outputs, const FusedDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsMultiplicationSupported(const TensorInfo &input0, const TensorInfo &input1, 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 IsInputSupported(const TensorInfo &input, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
bool IsDebugSupported(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 IsDepthwiseConvolutionSupported(const TensorInfo &input, const TensorInfo &output, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
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 IsSubtractionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional())
Copyright (c) 2021 ARM Limited and Contributors.
bool HasMatchingCapability(const BackendOptions::BackendOption &capability, const BackendCapabilities &capabilities)
Convenience function to check if a given capability matches a capability in a BackendCapabilities str...
LayerSupportHandle GetILayerSupportByBackendId(const armnn::BackendId &backend)
Convenience function to retrieve the ILayerSupportHandle for a backend.
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 HasCapability(const std::string &name, const BackendCapabilities &capabilities)
Convenience function to check if a capability exists in a BackendCapabilites struct.
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:22
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:37
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:68
Struct for the users to pass backend specific options.
A BatchMatMulDescriptor for the BatchMatMul operator.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
A ChannelShuffleDescriptor for the ChannelShuffle operator.
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:90
A Convolution2dDescriptor for the Convolution2dLayer.
A Convolution3dDescriptor for the Convolution3dLayer.
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A ElementwiseBinaryDescriptor for the ElementwiseBinaryLayer.
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
Definition: Optional.hpp:32
A FakeQuantizationDescriptor for the FakeQuantizationLayer.
A FillDescriptor for the FillLayer.
A FullyConnectedDescriptor for the FullyConnectedLayer.
A FusedDescriptor for the FusedLayer.
A GatherDescriptor for the GatherLayer.
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
A L2NormalizationDescriptor for the L2NormalizationLayer.
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
An LstmDescriptor for the LstmLayer.
A MeanDescriptor for the MeanLayer.
A NormalizationDescriptor for the NormalizationLayer.
An OriginsDescriptor for the ConcatLayer.
A PadDescriptor for the PadLayer.
A PermuteDescriptor for the PermuteLayer.
A Pooling2dDescriptor for the Pooling2dLayer.
A Pooling3dDescriptor for the Pooling3dLayer.
A PreCompiledDescriptor for the PreCompiledLayer.
A QLstmDescriptor for the QLstmLayer.
A ReduceDescriptor for the REDUCE operators.
A ReshapeDescriptor for the ReshapeLayer.
A ResizeDescriptor for the ResizeLayer.
A ScatterNdDescriptor for the ScatterNdLayer.
A SliceDescriptor for the SliceLayer.
A SoftmaxDescriptor for the SoftmaxLayer.
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
A StackDescriptor for the StackLayer.
A StandInDescriptor for the StandIn layer.
A StridedSliceDescriptor for the StridedSliceLayer.
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
A TransposeDescriptor for the TransposeLayer.
A ViewsDescriptor for the SplitterLayer.