ArmNN
 21.08
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  ARMNN_DEPRECATED_MSG("Use IsElementwiseUnarySupported instead")
32  bool IsAbsSupported(const TensorInfo& input,
33  const TensorInfo& output,
34  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
35 
36  bool IsActivationSupported(const TensorInfo& input,
37  const TensorInfo& output,
38  const ActivationDescriptor& descriptor,
39  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
40 
41  bool IsAdditionSupported(const TensorInfo& input0,
42  const TensorInfo& input1,
43  const TensorInfo& output,
44  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
45 
46  bool IsArgMinMaxSupported(const TensorInfo& input,
47  const TensorInfo& output,
48  const ArgMinMaxDescriptor& descriptor,
49  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
50 
51  bool IsBatchNormalizationSupported(const TensorInfo& input,
52  const TensorInfo& output,
53  const TensorInfo& mean,
54  const TensorInfo& var,
55  const TensorInfo& beta,
56  const TensorInfo& gamma,
57  const BatchNormalizationDescriptor& descriptor,
58  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
59 
60  bool IsBatchToSpaceNdSupported(const TensorInfo& input,
61  const TensorInfo& output,
62  const BatchToSpaceNdDescriptor& descriptor,
63  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
64 
65  bool IsCastSupported(const TensorInfo& input,
66  const TensorInfo& output,
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 IsDebugSupported(const TensorInfo& input,
107  const TensorInfo& output,
108  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
109 
110  bool IsDepthToSpaceSupported(const TensorInfo& input,
111  const TensorInfo& output,
112  const DepthToSpaceDescriptor& descriptor,
113  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
114 
116  const TensorInfo& input,
117  const TensorInfo& output,
118  const DepthwiseConvolution2dDescriptor& descriptor,
119  const TensorInfo& weights,
120  const Optional<TensorInfo>& biases,
121  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
122 
123  bool IsDequantizeSupported(const TensorInfo& input,
124  const TensorInfo& output,
125  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
126 
127  bool IsDetectionPostProcessSupported(const TensorInfo& boxEncodings,
128  const TensorInfo& scores,
129  const TensorInfo& anchors,
130  const TensorInfo& detectionBoxes,
131  const TensorInfo& detectionClasses,
132  const TensorInfo& detectionScores,
133  const TensorInfo& numDetections,
134  const DetectionPostProcessDescriptor& descriptor,
135  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
136 
138  const TensorInfo& input,
139  const TensorInfo& output,
140  const DepthwiseConvolution2dDescriptor& descriptor,
141  const TensorInfo& weights,
142  const Optional<TensorInfo>& biases,
143  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
144 
145  bool IsDivisionSupported(const TensorInfo& input0,
146  const TensorInfo& input1,
147  const TensorInfo& output,
148  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
149 
150  bool IsElementwiseUnarySupported(const TensorInfo& input,
151  const TensorInfo& output,
152  const ElementwiseUnaryDescriptor& descriptor,
153  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
154 
155  ARMNN_DEPRECATED_MSG("Use IsComparisonSupported instead")
156  bool IsEqualSupported(const TensorInfo& input0,
157  const TensorInfo& input1,
158  const TensorInfo& output,
159  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
160 
161  bool IsFakeQuantizationSupported(const TensorInfo& input,
162  const FakeQuantizationDescriptor& descriptor,
163  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
164 
165  bool IsFillSupported(const TensorInfo& input,
166  const TensorInfo& output,
167  const FillDescriptor& descriptor,
168  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
169 
170  bool IsFloorSupported(const TensorInfo& input,
171  const TensorInfo& output,
172  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
173 
174  bool IsFullyConnectedSupported(const TensorInfo& input,
175  const TensorInfo& output,
176  const TensorInfo& weights,
177  const TensorInfo& biases,
178  const FullyConnectedDescriptor& descriptor,
179  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
180 
181  ARMNN_DEPRECATED_MSG("Use IsGatherSupported with descriptor instead")
182  bool IsGatherSupported(const TensorInfo& input0,
183  const TensorInfo& input1,
184  const TensorInfo& output,
185  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
186 
187  bool IsGatherSupported(const TensorInfo& input0,
188  const TensorInfo& input1,
189  const TensorInfo& output,
190  const GatherDescriptor& descriptor,
191  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
192 
193  ARMNN_DEPRECATED_MSG("Use IsComparisonSupported instead")
194  bool IsGreaterSupported(const TensorInfo& input0,
195  const TensorInfo& input1,
196  const TensorInfo& ouput,
197  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
198 
199  bool IsInputSupported(const TensorInfo& input,
200  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
201 
203  const TensorInfo& input,
204  const TensorInfo& output,
205  const InstanceNormalizationDescriptor& descriptor,
206  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
207 
208  bool IsL2NormalizationSupported(const TensorInfo& input,
209  const TensorInfo& output,
210  const L2NormalizationDescriptor& descriptor,
211  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
212 
213  bool IsLogicalBinarySupported(const TensorInfo& input0,
214  const TensorInfo& input1,
215  const TensorInfo& output,
216  const LogicalBinaryDescriptor& descriptor,
217  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
218 
219  bool IsLogicalUnarySupported(const TensorInfo& input,
220  const TensorInfo& output,
221  const ElementwiseUnaryDescriptor& descriptor,
222  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
223 
224  bool IsLogSoftmaxSupported(const TensorInfo& input,
225  const TensorInfo& output,
226  const LogSoftmaxDescriptor& descriptor,
227  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
228 
229  bool IsLstmSupported(const TensorInfo& input,
230  const TensorInfo& outputStateIn,
231  const TensorInfo& cellStateIn,
232  const TensorInfo& scratchBuffer,
233  const TensorInfo& outputStateOut,
234  const TensorInfo& cellStateOut,
235  const TensorInfo& output,
236  const LstmDescriptor& descriptor,
237  const LstmInputParamsInfo& paramsInfo,
238  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
239 
240  bool IsMaximumSupported(const TensorInfo& input0,
241  const TensorInfo& input1,
242  const TensorInfo& output,
243  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
244 
245  bool IsMeanSupported(const TensorInfo& input,
246  const TensorInfo& output,
247  const MeanDescriptor& descriptor,
248  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
249 
250  bool IsMemCopySupported(const TensorInfo& input,
251  const TensorInfo& output,
252  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
253 
254  bool IsMemImportSupported(const TensorInfo& input,
255  const TensorInfo& output,
256  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
257 
258  bool IsMergeSupported(const TensorInfo& input0,
259  const TensorInfo& input1,
260  const TensorInfo& output,
261  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
262 
263  ARMNN_DEPRECATED_MSG("Use IsConcatSupported instead")
264  bool IsMergerSupported(const std::vector<const TensorInfo*> inputs,
265  const TensorInfo& output,
266  const OriginsDescriptor& descriptor,
267  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
268 
269  bool IsMinimumSupported(const TensorInfo& input0,
270  const TensorInfo& input1,
271  const TensorInfo& output,
272  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
273 
274  bool IsMultiplicationSupported(const TensorInfo& input0,
275  const TensorInfo& input1,
276  const TensorInfo& output,
277  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
278 
279  bool IsNormalizationSupported(const TensorInfo& input,
280  const TensorInfo& output,
281  const NormalizationDescriptor& descriptor,
282  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
283 
284  bool IsOutputSupported(const TensorInfo& output,
285  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
286 
287  bool IsPadSupported(const TensorInfo& input,
288  const TensorInfo& output,
289  const PadDescriptor& descriptor,
290  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
291 
292  bool IsPermuteSupported(const TensorInfo& input,
293  const TensorInfo& output,
294  const PermuteDescriptor& descriptor,
295  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
296 
297  bool IsPooling2dSupported(const TensorInfo& input,
298  const TensorInfo& output,
299  const Pooling2dDescriptor& descriptor,
300  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
301 
302  bool IsPreCompiledSupported(const TensorInfo& input,
303  const PreCompiledDescriptor& descriptor,
304  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
305 
306  bool IsPreluSupported(const TensorInfo& input,
307  const TensorInfo& alpha,
308  const TensorInfo& output,
309  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
310 
311  bool IsQuantizeSupported(const TensorInfo& input,
312  const TensorInfo& output,
313  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
314 
315  bool IsQLstmSupported(const TensorInfo& input,
316  const TensorInfo& previousOutputIn,
317  const TensorInfo& previousCellStateIn,
318  const TensorInfo& outputStateOut,
319  const TensorInfo& cellStateOut,
320  const TensorInfo& output,
321  const QLstmDescriptor& descriptor,
322  const LstmInputParamsInfo& paramsInfo,
323  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
324 
325  bool IsQuantizedLstmSupported(const TensorInfo& input,
326  const TensorInfo& previousCellStateIn,
327  const TensorInfo& previousOutputIn,
328  const TensorInfo& cellStateOut,
329  const TensorInfo& output,
330  const QuantizedLstmInputParamsInfo& paramsInfo,
331  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
332 
333  bool IsRankSupported(const TensorInfo& input,
334  const TensorInfo& output,
335  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
336 
337  bool IsReduceSupported(const TensorInfo& input,
338  const TensorInfo& output,
339  const ReduceDescriptor& descriptor,
340  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
341 
342  bool IsReshapeSupported(const TensorInfo& input,
343  const TensorInfo& output,
344  const ReshapeDescriptor& descriptor,
345  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
346 
347  ARMNN_DEPRECATED_MSG("Use IsResizeSupported instead")
348  bool IsResizeBilinearSupported(const TensorInfo& input,
349  const TensorInfo& output,
350  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
351 
352  bool IsResizeSupported(const TensorInfo& input,
353  const TensorInfo& output,
354  const ResizeDescriptor& descriptor,
355  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
356 
357  ARMNN_DEPRECATED_MSG("Use IsElementwiseUnarySupported instead")
358  bool IsRsqrtSupported(const TensorInfo& input,
359  const TensorInfo& output,
360  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
361 
362  bool IsShapeSupported(const TensorInfo& input,
363  const TensorInfo& output,
364  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
365 
366  bool IsSliceSupported(const TensorInfo& input,
367  const TensorInfo& output,
368  const SliceDescriptor& descriptor,
369  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
370 
371  bool IsSoftmaxSupported(const TensorInfo& input,
372  const TensorInfo& output,
373  const SoftmaxDescriptor& descriptor,
374  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
375 
376  bool IsSpaceToBatchNdSupported(const TensorInfo& input,
377  const TensorInfo& output,
378  const SpaceToBatchNdDescriptor& descriptor,
379  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
380 
381  bool IsSpaceToDepthSupported(const TensorInfo& input,
382  const TensorInfo& output,
383  const SpaceToDepthDescriptor& descriptor,
384  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
385 
386  ARMNN_DEPRECATED_MSG("Use IsSplitterSupported with outputs instead")
387  bool IsSplitterSupported(const TensorInfo& input,
388  const ViewsDescriptor& descriptor,
389  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
390 
391  bool IsSplitterSupported(const TensorInfo& input,
392  const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
393  const ViewsDescriptor& descriptor,
394  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
395 
396  bool IsStackSupported(const std::vector<const TensorInfo*>& inputs,
397  const TensorInfo& output,
398  const StackDescriptor& descriptor,
399  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
400 
401  bool IsStandInSupported(const std::vector<const TensorInfo*>& inputs,
402  const std::vector<const TensorInfo*>& outputs,
403  const StandInDescriptor& descriptor,
404  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
405 
406 
407  bool IsStridedSliceSupported(const TensorInfo& input,
408  const TensorInfo& output,
409  const StridedSliceDescriptor& descriptor,
410  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
411 
412  bool IsSubtractionSupported(const TensorInfo& input0,
413  const TensorInfo& input1,
414  const TensorInfo& output,
415  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
416 
417  bool IsSwitchSupported(const TensorInfo& input0,
418  const TensorInfo& input1,
419  const TensorInfo& output0,
420  const TensorInfo& output1,
421  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
422 
424  const TensorInfo& input,
425  const TensorInfo& output,
426  const TransposeConvolution2dDescriptor& descriptor,
427  const TensorInfo& weights,
428  const Optional<TensorInfo>& biases,
429  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
430 
431  bool IsTransposeSupported(const TensorInfo& input,
432  const TensorInfo& output,
433  const TransposeDescriptor& descriptor,
434  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
435 
437  const TensorInfo& input,
438  const TensorInfo& outputStateIn,
439  const TensorInfo& cellStateIn,
440  const TensorInfo& output,
441  const Optional<TensorInfo>& hiddenStateOutput,
442  const Optional<TensorInfo>& cellStateOutput,
443  const LstmDescriptor& descriptor,
444  const LstmInputParamsInfo& paramsInfo,
445  Optional<std::string&> reasonIfUnsupported = EmptyOptional());
446 
447 private:
448  std::shared_ptr<ILayerSupport> m_LayerSupport;
449  const BackendId m_BackendId;
450 };
451 
452 /// Convenience function to retrieve the ILayerSupportHandle for a backend
454 
455 /// Convenience function to check if a capability exists in a BackendCapabilites struct
456 bool HasCapability(const std::string& name,const BackendCapabilities& capabilities);
457 
458 /// Convenience function to check if a capability exists in a backend
459 bool HasCapability(const std::string& name, const armnn::BackendId& backend);
460 
461 /// Convenience function to check if a given capability matches a capability in a BackendCapabilities struct
462 bool HasCapability(const BackendOptions::BackendOption& capability, const BackendCapabilities& capabilities);
463 
464 /// Convenience function to check if a given capability matches a capability in a backend
465 bool HasCapability(const BackendOptions::BackendOption& backendOption, const armnn::BackendId& backend);
466 
467 /// Returns a BackendCapability if the backend lists the capability
468 /// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
469 /// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
470 Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
471  const BackendCapabilities& capabilities);
472 
473 /// Returns a BackendCapability if the backend lists the capability
474 /// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported
475 /// Otherwise returns an EmptyOptional if the BackendCapability is unlisted
476 Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName,
477  const armnn::BackendId& backend);
478 
479 /// Convenience function to check a capability on a backend
480 ARMNN_DEPRECATED_MSG("This function has been deprecated in favour of GetBackendCapability")
481 bool IsCapabilitySupported(const armnn::BackendId& backend, armnn::BackendCapability capability);
482 
483 }
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 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())
bool IsMergerSupported(const std::vector< const TensorInfo *> inputs, const TensorInfo &output, const OriginsDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
bool IsAbsSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsEqualSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsConvertFp32ToFp16Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A ResizeDescriptor for the ResizeLayer.
bool IsResizeSupported(const TensorInfo &input, const TensorInfo &output, const ResizeDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsDepthToSpaceSupported(const TensorInfo &input, const TensorInfo &output, const DepthToSpaceDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
A StackDescriptor for the StackLayer.
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())
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:221
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())
bool IsGatherSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, 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.
bool IsOutputSupported(const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsMemCopySupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsResizeBilinearSupported(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())
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 IsRsqrtSupported(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())
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 IsSplitterSupported(const TensorInfo &input, const ViewsDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
#define ARMNN_DEPRECATED_MSG(message)
Definition: Deprecated.hpp:43
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.
bool IsActivationSupported(const TensorInfo &input, const TensorInfo &output, const ActivationDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional())
bool IsGreaterSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &ouput, 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())