ArmNN
 20.05
NeonLayerSupport.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "NeonLayerSupport.hpp"
7 #include "NeonBackendId.hpp"
8 
9 #include <armnn/Descriptors.hpp>
10 #include <armnn/Exceptions.hpp>
11 #include <armnn/Tensor.hpp>
12 #include <armnn/Types.hpp>
14 
15 #include <InternalTypes.hpp>
16 #include <LayerSupportCommon.hpp>
18 
19 #if defined(ARMCOMPUTENEON_ENABLED)
67 #endif
68 
69 namespace armnn
70 {
71 
72 namespace
73 {
74 
75 template< typename ... Args>
76 bool IsNeonBackendSupported(Optional<std::string&> reasonIfUnsupported, Args... args)
77 {
78  IgnoreUnused(reasonIfUnsupported, (args)...);
79 #if defined(ARMCOMPUTENEON_ENABLED)
80  return true;
81 #else
82  SetValueChecked(reasonIfUnsupported, "The armnn library has been built without NEON support");
83  return false;
84 #endif
85 }
86 
87 template<typename FloatFunc, typename Uint8Func, typename ... Params>
88 bool IsSupportedForDataTypeNeon(Optional<std::string&> reasonIfUnsupported,
89  DataType dataType,
90  FloatFunc floatFuncPtr,
91  Uint8Func uint8FuncPtr,
92  Params&&... params)
93 {
94  return IsNeonBackendSupported(reasonIfUnsupported) &&
95  IsSupportedForDataTypeGeneric(reasonIfUnsupported,
96  dataType,
97  floatFuncPtr,
98  floatFuncPtr,
99  uint8FuncPtr,
100  &FalseFunc<>,
101  &FalseFunc<>,
102  std::forward<Params>(params)...);
103 }
104 
105 #if defined(ARMCOMPUTENEON_ENABLED)
106 template<class FuncType, class... Args>
107 inline bool IsWorkloadSupported(FuncType& func, Optional<std::string&> reasonIfUnsupported, Args&&... args)
108 {
109  arm_compute::Status aclStatus = func(std::forward<Args>(args)...);
110  const bool supported = (aclStatus.error_code() == arm_compute::ErrorCode::OK);
111  if (!supported && reasonIfUnsupported)
112  {
113  reasonIfUnsupported.value() = aclStatus.error_description();
114  }
115  return supported;
116 }
117 
118 #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \
119  return IsWorkloadSupported(func, reasonIfUnsupported, __VA_ARGS__);
120 #else
121 #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \
122  return IsNeonBackendSupported(reasonIfUnsupported, __VA_ARGS__);
123 #endif
124 } // anonymous namespace
125 
127  const TensorInfo& output,
128  Optional<std::string&> reasonIfUnsupported) const
129 {
131  return IsElementwiseUnarySupported(input, output, descriptor, reasonIfUnsupported);
132 }
133 
135  const TensorInfo& output,
136  const ActivationDescriptor& descriptor,
137  Optional<std::string&> reasonIfUnsupported) const
138 {
139  IgnoreUnused(descriptor);
141  reasonIfUnsupported,
142  input,
143  output,
144  descriptor);
145 }
146 
148  const TensorInfo& input1,
149  const TensorInfo& output,
150  Optional<std::string&> reasonIfUnsupported) const
151 {
153  reasonIfUnsupported,
154  input0,
155  input1,
156  output);
157 }
158 
160  const TensorInfo& output,
161  const ArgMinMaxDescriptor& descriptor,
162  Optional<std::string&> reasonIfUnsupported) const
163 {
165  reasonIfUnsupported,
166  input,
167  output,
168  descriptor);
169 }
170 
172  const TensorInfo& output,
173  const TensorInfo& mean,
174  const TensorInfo& var,
175  const TensorInfo& beta,
176  const TensorInfo& gamma,
177  const BatchNormalizationDescriptor& descriptor,
178  Optional<std::string&> reasonIfUnsupported) const
179 {
181  reasonIfUnsupported,
182  input,
183  output,
184  mean,
185  var,
186  beta,
187  gamma,
188  descriptor);
189 }
190 
192  const TensorInfo& output,
193  const BatchToSpaceNdDescriptor& descriptor,
194  Optional<std::string&> reasonIfUnsupported) const
195 {
197  reasonIfUnsupported,
198  input,
199  output,
200  descriptor);
201 }
202 
204  const TensorInfo& input1,
205  const TensorInfo& output,
206  const ComparisonDescriptor& descriptor,
207  Optional<std::string&> reasonIfUnsupported) const
208 {
209 
211  reasonIfUnsupported,
212  input0,
213  input1,
214  output,
215  descriptor);
216 }
217 
218 bool NeonLayerSupport::IsConcatSupported(const std::vector<const TensorInfo*> inputs,
219  const TensorInfo& output,
220  const ConcatDescriptor& descriptor,
221  Optional<std::string&> reasonIfUnsupported) const
222 {
223  if (descriptor.GetNumDimensions() <= descriptor.GetConcatAxis())
224  {
225  SetValueChecked(reasonIfUnsupported, "Neon Concat: Concat axis > Number of dimensions.");
226  return false;
227  }
228 
229  unsigned int concatInnerAxis = (descriptor.GetNumDimensions() - descriptor.GetConcatAxis()) - 1;
230  if(concatInnerAxis < 3) // Width, height, or channels
231  {
233  reasonIfUnsupported,
234  inputs,
235  output,
236  descriptor);
237  }
238  else if (concatInnerAxis == 3)
239  {
240  for (auto& input : inputs)
241  {
242  if (input && !output.IsTypeSpaceMatch(*input)) // Cannot use sub-tensors if the types are not same space
243  {
244  SetValueChecked(reasonIfUnsupported, "Neon Concat: Types and quantization parameters must match.");
245  return false;
246  }
247  }
248  return true; // Sub-tensors support concat along batch
249  }
250  else // > 4 dimensions not supported.
251  {
252  SetValueChecked(reasonIfUnsupported, "Neon Concat: Maximum of 4 dimensions supported.");
253  return false;
254  }
255 }
256 
258  Optional<std::string&> reasonIfUnsupported) const
259 {
261  reasonIfUnsupported,
262  output);
263 }
264 
266  const TensorInfo& output,
267  Optional<std::string&> reasonIfUnsupported) const
268 {
269  armnn::IgnoreUnused(input);
270  armnn::IgnoreUnused(output);
271  armnn::IgnoreUnused(reasonIfUnsupported);
272  return true;
273 }
274 
276  const TensorInfo& output,
277  Optional<std::string&> reasonIfUnsupported) const
278 {
279  armnn::IgnoreUnused(input);
280  armnn::IgnoreUnused(output);
281  armnn::IgnoreUnused(reasonIfUnsupported);
282  return true;
283 }
284 
286  const TensorInfo& output,
287  Optional<std::string&> reasonIfUnsupported) const
288 {
289  armnn::IgnoreUnused(input);
290  armnn::IgnoreUnused(output);
291  armnn::IgnoreUnused(reasonIfUnsupported);
292  return true;
293 }
294 
296  const TensorInfo& output,
297  Optional<std::string&> reasonIfUnsupported) const
298 {
299  armnn::IgnoreUnused(input);
300  armnn::IgnoreUnused(output);
301  armnn::IgnoreUnused(reasonIfUnsupported);
302  return true;
303 }
304 
306  const TensorInfo& output,
307  const Convolution2dDescriptor& descriptor,
308  const TensorInfo& weights,
309  const Optional<TensorInfo>& biases,
310  Optional<std::string&> reasonIfUnsupported) const
311 {
313  reasonIfUnsupported,
314  input,
315  output,
316  descriptor,
317  weights,
318  biases);
319 }
320 
322  const TensorInfo& output,
323  const DepthToSpaceDescriptor& descriptor,
324  Optional<std::string&> reasonIfUnsupported) const
325 {
327  reasonIfUnsupported,
328  input,
329  output,
330  descriptor);
331 }
332 
334  const TensorInfo& output,
335  const DepthwiseConvolution2dDescriptor& descriptor,
336  const TensorInfo& weights,
337  const Optional<TensorInfo>& biases,
338  Optional<std::string&> reasonIfUnsupported) const
339 {
341  reasonIfUnsupported,
342  input,
343  output,
344  descriptor,
345  weights,
346  biases);
347 }
348 
350  const TensorInfo& output,
351  Optional<std::string&> reasonIfUnsupported) const
352 {
354  reasonIfUnsupported,
355  input,
356  output);
357 }
358 
360  const TensorInfo& output,
361  const DepthwiseConvolution2dDescriptor& descriptor,
362  const TensorInfo& weights,
363  const Optional<TensorInfo>& biases,
364  Optional<std::string&> reasonIfUnsupported) const
365 {
367  reasonIfUnsupported,
368  input,
369  output,
370  descriptor,
371  weights,
372  biases);
373 }
374 
376  const TensorInfo& output,
377  const ElementwiseUnaryDescriptor& descriptor,
378  Optional<std::string&> reasonIfUnsupported) const
379 {
380  switch(descriptor.m_Operation)
381  {
382  case UnaryOperation::Abs:
384  reasonIfUnsupported,
385  input,
386  output);
387  case UnaryOperation::Exp:
389  reasonIfUnsupported,
390  input,
391  output);
392  case UnaryOperation::Neg:
394  reasonIfUnsupported,
395  input,
396  output);
399  reasonIfUnsupported,
400  input,
401  output);
402  default:
403  return false;
404  }
405 }
406 
408  const TensorInfo& output,
409  Optional<std::string&> reasonIfUnsupported) const
410 {
411  armnn::IgnoreUnused(output);
412  return IsNeonBackendSupported(reasonIfUnsupported) &&
413  IsSupportedForDataTypeGeneric(reasonIfUnsupported,
414  input.GetDataType(),
415  &FalseFuncF16<>,
416  &TrueFunc<>,
417  &FalseFuncU8<>,
418  &FalseFuncI32<>,
419  &FalseFuncU8<>);
420 }
421 
423  const TensorInfo& output,
424  const TensorInfo& weights,
425  const TensorInfo& biases,
426  const FullyConnectedDescriptor& descriptor,
427  Optional<std::string&> reasonIfUnsupported) const
428 {
430  reasonIfUnsupported,
431  input,
432  output,
433  weights,
434  biases,
435  descriptor);
436 }
437 
439  const armnn::TensorInfo& input1,
440  const armnn::TensorInfo& output,
441  armnn::Optional<std::string&> reasonIfUnsupported) const
442 {
444  return IsComparisonSupported(input0, input1, output, descriptor, reasonIfUnsupported);
445 }
446 
448  Optional<std::string&> reasonIfUnsupported) const
449 {
450  return IsNeonBackendSupported(reasonIfUnsupported, input);
451 }
452 
454  const TensorInfo& output,
455  const InstanceNormalizationDescriptor& descriptor,
456  Optional<std::string&> reasonIfUnsupported) const
457 {
459  reasonIfUnsupported,
460  input,
461  output,
462  descriptor);
463 }
464 
466  const TensorInfo& output,
467  const L2NormalizationDescriptor& descriptor,
468  Optional<std::string&> reasonIfUnsupported) const
469 {
470  FORWARD_WORKLOAD_VALIDATE_FUNC(NeonL2NormalizationWorkloadValidate, reasonIfUnsupported, input, output, descriptor);
471 }
472 
474  const TensorInfo& outputStateIn,
475  const TensorInfo& cellStateIn,
476  const TensorInfo& scratchBuffer,
477  const TensorInfo& outputStateOut,
478  const TensorInfo& cellStateOut,
479  const TensorInfo& output,
480  const LstmDescriptor& descriptor,
481  const LstmInputParamsInfo& paramsInfo,
482  Optional<std::string&> reasonIfUnsupported) const
483 {
485  reasonIfUnsupported,
486  input,
487  outputStateIn,
488  cellStateIn,
489  scratchBuffer,
490  outputStateOut,
491  cellStateOut,
492  output,
493  descriptor,
494  paramsInfo);
495 }
496 
498  const TensorInfo& input1,
499  const TensorInfo& output,
500  Optional<std::string&> reasonIfUnsupported) const
501 {
503  reasonIfUnsupported,
504  input0,
505  input1,
506  output);
507 }
508 
510  const TensorInfo& output,
511  const MeanDescriptor& descriptor,
512  Optional<std::string&> reasonIfUnsupported) const
513 {
515  reasonIfUnsupported,
516  input,
517  output,
518  descriptor);
519 }
520 
521 bool NeonLayerSupport::IsMergerSupported(const std::vector<const TensorInfo*> inputs,
522  const TensorInfo& output,
523  const MergerDescriptor& descriptor,
524  Optional<std::string&> reasonIfUnsupported) const
525 {
526  return IsConcatSupported(inputs, output, descriptor, reasonIfUnsupported);
527 }
528 
530  const TensorInfo& input1,
531  const TensorInfo& output,
532  Optional<std::string&> reasonIfUnsupported) const
533 {
535  reasonIfUnsupported,
536  input0,
537  input1,
538  output);
539 }
540 
542  const TensorInfo& input1,
543  const TensorInfo& output,
544  Optional<std::string&> reasonIfUnsupported) const
545 {
547  reasonIfUnsupported,
548  input0,
549  input1,
550  output);
551 }
552 
554  const TensorInfo& input1,
555  const TensorInfo& output,
556  Optional<std::string&> reasonIfUnsupported) const
557 {
559  reasonIfUnsupported,
560  input0,
561  input1,
562  output);
563 }
564 
566  const TensorInfo& output,
567  const NormalizationDescriptor& descriptor,
568  Optional<std::string&> reasonIfUnsupported) const
569 {
571  reasonIfUnsupported,
572  input,
573  output,
574  descriptor);
575 }
576 
578  Optional<std::string&> reasonIfUnsupported) const
579 {
580  return IsNeonBackendSupported(reasonIfUnsupported, output);
581 }
582 
584  const TensorInfo& output,
585  const PadDescriptor& descriptor,
586  Optional<std::string&> reasonIfUnsupported) const
587 {
589  reasonIfUnsupported,
590  input,
591  output,
592  descriptor);
593 }
594 
596  const TensorInfo& output,
597  const PermuteDescriptor& descriptor,
598  Optional<std::string&> reasonIfUnsupported) const
599 {
600  FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPermuteWorkloadValidate, reasonIfUnsupported, input, output, descriptor);
601 }
602 
604  const TensorInfo& output,
605  const Pooling2dDescriptor& descriptor,
606  Optional<std::string&> reasonIfUnsupported) const
607 {
608  FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPooling2dWorkloadValidate, reasonIfUnsupported, input, output, descriptor);
609 }
610 
612  const armnn::TensorInfo &alpha,
613  const armnn::TensorInfo &output,
614  armnn::Optional<std::string &> reasonIfUnsupported) const
615 {
616  FORWARD_WORKLOAD_VALIDATE_FUNC(NeonPreluWorkloadValidate, reasonIfUnsupported, input, alpha, output);
617 }
618 
620  const TensorInfo& previousOutputIn,
621  const TensorInfo& previousCellStateIn,
622  const TensorInfo& outputStateOut,
623  const TensorInfo& cellStateOut,
624  const TensorInfo& output,
625  const QLstmDescriptor& descriptor,
626  const LstmInputParamsInfo& paramsInfo,
627  Optional<std::string&> reasonIfUnsupported) const
628 {
629  // Check required here in order to pass IsLayerSupported for datatypes tests
630  if (input.GetDataType() == armnn::DataType::QAsymmS8 &&
631  previousOutputIn.GetDataType() == armnn::DataType::QAsymmS8 &&
632  previousCellStateIn.GetDataType() == armnn::DataType::QSymmS16 &&
633  outputStateOut.GetDataType() == armnn::DataType::QAsymmS8 &&
634  cellStateOut.GetDataType() == armnn::DataType::QSymmS16 &&
636  {
638  reasonIfUnsupported,
639  input,
640  previousCellStateIn,
641  previousOutputIn,
642  cellStateOut,
643  outputStateOut,
644  output,
645  descriptor,
646  paramsInfo);
647  }
648  else
649  {
650  return false;
651  }
652 }
653 
655  const TensorInfo& output,
656  Optional<std::string&> reasonIfUnsupported) const
657 {
659  reasonIfUnsupported,
660  input,
661  output);
662 }
663 
665  const TensorInfo& cellStateIn,
666  const TensorInfo& outputStateIn,
667  const TensorInfo& cellStateOut,
668  const TensorInfo& outputStateOut,
669  const QuantizedLstmInputParamsInfo& paramsInfo,
670  Optional<std::string&> reasonIfUnsupported) const
671 {
673  reasonIfUnsupported,
674  input,
675  cellStateIn,
676  outputStateIn,
677  cellStateOut,
678  outputStateOut,
679  paramsInfo);
680 }
681 
683  const TensorInfo& output,
684  const ReshapeDescriptor& descriptor,
685  Optional<std::string&> reasonIfUnsupported) const
686 {
687  armnn::IgnoreUnused(descriptor);
689  reasonIfUnsupported,
690  input,
691  output);
692 }
693 
695  const TensorInfo& output,
696  const ResizeDescriptor& descriptor,
697  Optional<std::string&> reasonIfUnsupported) const
698 {
700  reasonIfUnsupported,
701  input,
702  output,
703  descriptor);
704 }
705 
707  const TensorInfo& output,
708  Optional<std::string&> reasonIfUnsupported) const
709 {
710  ResizeDescriptor descriptor;
711  descriptor.m_Method = ResizeMethod::Bilinear;
712  descriptor.m_DataLayout = DataLayout::NCHW;
713 
714  const TensorShape& outputShape = output.GetShape();
715  descriptor.m_TargetHeight = outputShape[2];
716  descriptor.m_TargetWidth = outputShape[3];
717 
718  return IsResizeSupported(input, output, descriptor, reasonIfUnsupported);
719 }
720 
722  const TensorInfo& output,
723  Optional<std::string&> reasonIfUnsupported) const
724 {
726  return IsElementwiseUnarySupported(input, output, descriptor, reasonIfUnsupported);
727 }
728 
730  const TensorInfo& output,
731  const SliceDescriptor& descriptor,
732  Optional<std::string&> reasonIfUnsupported) const
733 {
735  reasonIfUnsupported,
736  input,
737  output,
738  descriptor);
739 }
740 
742  const TensorInfo& output,
743  const SoftmaxDescriptor& descriptor,
744  Optional<std::string&> reasonIfUnsupported) const
745 {
746  FORWARD_WORKLOAD_VALIDATE_FUNC(NeonSoftmaxWorkloadValidate, reasonIfUnsupported, input, output, descriptor);
747 }
748 
750  const TensorInfo& output,
751  const SpaceToBatchNdDescriptor& descriptor,
752  Optional<std::string&> reasonIfUnsupported) const
753 {
755  reasonIfUnsupported,
756  input,
757  output,
758  descriptor);
759 }
760 
762  const TensorInfo& output,
763  const SpaceToDepthDescriptor& descriptor,
764  Optional<std::string&> reasonIfUnsupported) const
765 {
767  reasonIfUnsupported,
768  input,
769  output,
770  descriptor);
771 }
772 
774  const ViewsDescriptor& descriptor,
775  Optional<std::string&> reasonIfUnsupported) const
776 {
777  armnn::IgnoreUnused(descriptor);
778  return IsSupportedForDataTypeNeon(reasonIfUnsupported,
779  input.GetDataType(),
780  &TrueFunc<>,
781  &TrueFunc<>);
782 }
783 
785  const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
786  const ViewsDescriptor& descriptor,
787  Optional<std::string&> reasonIfUnsupported) const
788 {
789 #if defined(ARMCOMPUTENEON_ENABLED)
790  // Split along the last dimension, cannot use sub-tensors
791  // as width and height of the sub-tensors do not match
792  // the width and height of the parent tensor
793  // in case of input with more than 2D.
794  std::set<unsigned int> splitAxis = ComputeSplitAxis(descriptor, input.GetShape());
795  if (descriptor.GetNumDimensions() > 2 && splitAxis.size() == 1 &&
796  *splitAxis.begin() == descriptor.GetNumDimensions() - 1 )
797  {
799  reasonIfUnsupported,
800  input,
801  outputs,
802  *splitAxis.begin());
803  }
804 #endif
805  IgnoreUnused(descriptor);
806  for (auto output : outputs)
807  {
808  if (!input.IsTypeSpaceMatch(output)) // Cannot use sub-tensors if the types are not same space
809  {
810  SetValueChecked(reasonIfUnsupported, "Neon Splitter: Types and quantization parameters must match.");
811  return false;
812  }
813  }
814  return true;
815 }
816 
817 bool NeonLayerSupport::IsStackSupported(const std::vector<const TensorInfo*>& inputs,
818  const TensorInfo& output,
819  const StackDescriptor& descriptor,
820  Optional<std::string&> reasonIfUnsupported) const
821 {
823  reasonIfUnsupported,
824  inputs,
825  output,
826  descriptor);
827 }
828 
830  const TensorInfo& output,
831  const StridedSliceDescriptor& descriptor,
832  Optional<std::string&> reasonIfUnsupported) const
833 {
835  reasonIfUnsupported,
836  input,
837  output,
838  descriptor);
839 }
840 
842  const TensorInfo& input1,
843  const TensorInfo& output,
844  Optional<std::string&> reasonIfUnsupported) const
845 {
847  reasonIfUnsupported,
848  input0,
849  input1,
850  output);
851 }
852 
854  const TensorInfo& output,
855  const TransposeConvolution2dDescriptor& descriptor,
856  const TensorInfo& weights,
857  const Optional<TensorInfo>& biases,
858  Optional<std::string&> reasonIfUnsupported) const
859 {
861  reasonIfUnsupported,
862  input,
863  output,
864  descriptor,
865  weights,
866  biases);
867 }
868 
870  const TensorInfo& output,
871  const TransposeDescriptor& descriptor,
872  Optional<std::string&> reasonIfUnsupported) const
873 {
874  FORWARD_WORKLOAD_VALIDATE_FUNC(NeonTransposeWorkloadValidate, reasonIfUnsupported, input, output, descriptor);
875 }
876 
877 } // namespace armnn
arm_compute::Status NeonNegWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
UnaryOperation m_Operation
Specifies the elementwiseUnary operation to execute.
bool IsSliceSupported(const TensorInfo &input, const TensorInfo &output, const SliceDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsSoftmaxSupported(const TensorInfo &input, const TensorInfo &output, const SoftmaxDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsConvolution2dSupported(const TensorInfo &input, const TensorInfo &output, const Convolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
A ViewsDescriptor for the SplitterLayer.
bool IsTypeSpaceMatch(const TensorInfo &other) const
Check that the types are the same and, if quantize, that the quantization parameters are the same...
Definition: Tensor.cpp:219
bool IsConvertFp32ToFp16Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
arm_compute::Status NeonSpaceToDepthWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const SpaceToDepthDescriptor &descriptor)
arm_compute::Status NeonSplitterWorkloadValidate(const TensorInfo &input, const std::vector< std::reference_wrapper< TensorInfo >> &outputs, unsigned int splitAxis)
arm_compute::Status NeonMultiplicationWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
const TensorShape & GetShape() const
Definition: Tensor.hpp:88
A ReshapeDescriptor for the ReshapeLayer.
bool IsDilatedDepthwiseConvolutionSupported(const TensorInfo &input, const TensorInfo &output, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string &> reason=EmptyOptional()) const override
bool IsQuantizedLstmSupported(const TensorInfo &input, const TensorInfo &cellStateIn, const TensorInfo &outputStateIn, const TensorInfo &cellStateOut, const TensorInfo &outputStateOut, const QuantizedLstmInputParamsInfo &paramsInfo, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
uint32_t GetNumDimensions() const
Get the number of dimensions.
arm_compute::Status NeonBatchNormalizationValidate(const TensorInfo &input, const TensorInfo &output, const TensorInfo &mean, const TensorInfo &var, const TensorInfo &beta, const TensorInfo &gamma, const BatchNormalizationDescriptor &descriptor)
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:70
bool IsDepthToSpaceSupported(const TensorInfo &input, const TensorInfo &output, const DepthToSpaceDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsL2NormalizationSupported(const TensorInfo &input, const TensorInfo &output, const L2NormalizationDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsStridedSliceSupported(const TensorInfo &input, const TensorInfo &output, const StridedSliceDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsConvertFp32ToBf16Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
ISubgraphViewConverter supported
bool IsAdditionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
A Convolution2dDescriptor for the Convolution2dLayer.
bool IsConcatSupported(const std::vector< const TensorInfo *> inputs, const TensorInfo &output, const ConcatDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsSplitterSupported(const TensorInfo &input, const ViewsDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
arm_compute::Status NeonMeanWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const MeanDescriptor &desc)
arm_compute::Status NeonAdditionWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)
ResizeMethod m_Method
The Interpolation method to use (Bilinear, NearestNeighbor).
arm_compute::Status NeonActivationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const ActivationDescriptor &descriptor)
arm_compute::Status NeonMinimumWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)
Validate function for validating the inputs and output.
arm_compute::Status NeonStridedSliceWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const StridedSliceDescriptor &descriptor)
arm_compute::Status NeonTransposeConvolution2dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TransposeConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases)
bool IsGreaterSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
arm_compute::Status NeonLstmFloatWorkloadValidate(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)
arm_compute::Status NeonQLstmWorkloadValidate(const TensorInfo &input, const TensorInfo &cellStateIn, const TensorInfo &outputStateIn, const TensorInfo &cellStateOut, const TensorInfo &outputStateOut, const TensorInfo &output, const QLstmDescriptor &descriptor, const LstmInputParamsInfo &paramsInfo)
bool IsResizeBilinearSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
arm_compute::Status NeonSliceWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const SliceDescriptor &descriptor)
bool IsConstantSupported(const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
Copyright (c) 2020 ARM Limited.
arm_compute::Status NeonQuantizeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
bool IsPadSupported(const TensorInfo &input, const TensorInfo &output, const PadDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
void IgnoreUnused(Ts &&...)
std::set< unsigned int > ComputeSplitAxis(const armnn::SplitterDescriptor &desc, const TensorShape &input)
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
arm_compute::Status NeonInstanceNormalizationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const InstanceNormalizationDescriptor &descriptor)
bool IsPooling2dSupported(const TensorInfo &input, const TensorInfo &output, const Pooling2dDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
bool IsActivationSupported(const TensorInfo &input, const TensorInfo &output, const ActivationDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsMultiplicationSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsComparisonSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ComparisonDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
A ResizeDescriptor for the ResizeLayer.
arm_compute::Status NeonL2NormalizationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const L2NormalizationDescriptor &descriptor)
arm_compute::Status NeonAbsWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
A StackDescriptor for the StackLayer.
arm_compute::Status NeonQuantizedLstmWorkloadValidate(const TensorInfo &input, const TensorInfo &cellStateIn, const TensorInfo &outputStateIn, const TensorInfo &cellStateOut, const TensorInfo &outputStateOut, const QuantizedLstmInputParamsInfo &paramsInfo)
arm_compute::Status NeonStackWorkloadValidate(const std::vector< const TensorInfo *> &inputs, const TensorInfo &output, const StackDescriptor &descriptor)
arm_compute::Status NeonSpaceToBatchNdWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const SpaceToBatchNdDescriptor &descriptor)
A PadDescriptor for the PadLayer.
bool IsAbsSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
DataType
Definition: Types.hpp:32
An LstmDescriptor for the LstmLayer.
arm_compute::Status NeonExpWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
arm_compute::Status NeonReshapeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
bool IsInputSupported(const TensorInfo &input, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsStackSupported(const std::vector< const TensorInfo *> &inputs, const TensorInfo &output, const StackDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
A L2NormalizationDescriptor for the L2NormalizationLayer.
bool IsMinimumSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsPreluSupported(const TensorInfo &input, const TensorInfo &alpha, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsOutputSupported(const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:51
bool IsInstanceNormalizationSupported(const TensorInfo &input, const TensorInfo &output, const InstanceNormalizationDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
DataType GetDataType() const
Definition: Tensor.hpp:95
An OriginsDescriptor for the ConcatLayer.
A FullyConnectedDescriptor for the FullyConnectedLayer.
bool IsMergerSupported(const std::vector< const TensorInfo *> inputs, const TensorInfo &output, const MergerDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsNormalizationSupported(const TensorInfo &input, const TensorInfo &output, const NormalizationDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsElementwiseUnarySupported(const TensorInfo &input, const TensorInfo &output, const ElementwiseUnaryDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
uint32_t m_TargetWidth
Target width value.
Status
enumeration
Definition: Types.hpp:26
arm_compute::Status NeonComparisonWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ComparisonDescriptor &descriptor)
bool IsDivisionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
arm_compute::Status NeonFullyConnectedWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TensorInfo &weights, const TensorInfo &biases, const FullyConnectedDescriptor &descriptor)
arm_compute::Status NeonConcatWorkloadValidate(const std::vector< const TensorInfo *> &inputs, const TensorInfo &output, const OriginsDescriptor &descriptor)
arm_compute::Status NeonPermuteWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const PermuteDescriptor &descriptor)
bool IsFloorSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
A QLstmDescriptor for the QLstmLayer.
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:20
bool IsResizeSupported(const TensorInfo &input, const TensorInfo &output, const ResizeDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
arm_compute::Status NeonConvolution2dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const Convolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases)
bool IsTransposeConvolution2dSupported(const TensorInfo &input, const TensorInfo &output, const TransposeConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
uint32_t m_TargetHeight
Target height value.
A SliceDescriptor for the SliceLayer.
arm_compute::Status NeonDequantizeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
bool IsReshapeSupported(const TensorInfo &input, const TensorInfo &output, const ReshapeDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
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()) const override
arm_compute::Status NeonDepthwiseConvolutionWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases)
void SetValueChecked(Optional< T &> optionalRef, V &&val)
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
arm_compute::Status NeonNormalizationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const NormalizationDescriptor &descriptor)
arm_compute::Status NeonBatchToSpaceNdWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const BatchToSpaceNdDescriptor &desc)
bool IsQuantizeSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
arm_compute::Status NeonRsqrtWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
bool IsConvertFp16ToFp32Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
arm_compute::Status NeonPadWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const PadDescriptor &descriptor)
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
Definition: Descriptors.hpp:90
bool IsSubtractionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
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()) const override
arm_compute::Status NeonArgMinMaxWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const ArgMinMaxDescriptor &descriptor)
arm_compute::Status NeonSoftmaxWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const SoftmaxDescriptor &descriptor)
bool IsSpaceToBatchNdSupported(const TensorInfo &input, const TensorInfo &output, const SpaceToBatchNdDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
arm_compute::Status NeonTransposeWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TransposeDescriptor &descriptor)
uint32_t GetNumDimensions() const
Get the number of dimensions.
A MeanDescriptor for the MeanLayer.
bool IsDepthwiseConvolutionSupported(const TensorInfo &input, const TensorInfo &output, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
arm_compute::Status NeonMaximumWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)
bool IsArgMinMaxSupported(const TensorInfo &input, const TensorInfo &output, const ArgMinMaxDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsSpaceToDepthSupported(const TensorInfo &input, const TensorInfo &output, const SpaceToDepthDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
arm_compute::Status NeonSubtractionWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)
A TransposeDescriptor for the TransposeLayer.
A StridedSliceDescriptor for the StridedSliceLayer.
bool IsTransposeSupported(const TensorInfo &input, const TensorInfo &output, const TransposeDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsMaximumSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
arm_compute::Status NeonConstantWorkloadValidate(const TensorInfo &output)
bool IsFullyConnectedSupported(const TensorInfo &input, const TensorInfo &output, const TensorInfo &weights, const TensorInfo &biases, const FullyConnectedDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsMeanSupported(const TensorInfo &input, const TensorInfo &output, const MeanDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
bool IsBatchToSpaceNdSupported(const TensorInfo &input, const TensorInfo &output, const BatchToSpaceNdDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
arm_compute::Status NeonPreluWorkloadValidate(const TensorInfo &input, const TensorInfo &alpha, const TensorInfo &output)
#define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported,...)
arm_compute::Status NeonDepthToSpaceWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const DepthToSpaceDescriptor &descriptor)
A Pooling2dDescriptor for the Pooling2dLayer.
arm_compute::Status NeonResizeWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const ResizeDescriptor &descriptor)
A NormalizationDescriptor for the NormalizationLayer.
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()) const override
bool IsConvertBf16ToFp32Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
unsigned int GetConcatAxis() const
Get the concatenation axis value.
bool IsSupportedForDataTypeGeneric(Optional< std::string &> reasonIfUnsupported, DataType dataType, Float16Func float16FuncPtr, Float32Func float32FuncPtr, Uint8Func uint8FuncPtr, Int32Func int32FuncPtr, BooleanFunc booleanFuncPtr, Params &&... params)
A SoftmaxDescriptor for the SoftmaxLayer.
arm_compute::Status NeonDivisionWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)
arm_compute::Status NeonPooling2dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const Pooling2dDescriptor &descriptor)
bool IsDequantizeSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
bool IsRsqrtSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
A PermuteDescriptor for the PermuteLayer.
bool IsPermuteSupported(const TensorInfo &input, const TensorInfo &output, const PermuteDescriptor &descriptor, Optional< std::string &> reasonIfUnsupported=EmptyOptional()) const override