24.08
|
Go to the documentation of this file.
19 #if defined(ARMCOMPUTENEON_ENABLED)
99 const TensorInfo OverrideDataType(
const TensorInfo& info, Optional<DataType> type)
105 if (
info.HasMultipleQuantizationScales())
107 return TensorInfo(
info.GetShape(),
109 info.GetQuantizationScales(),
110 info.GetQuantizationDim().value(),
115 return TensorInfo(
info.GetShape(),
117 info.GetQuantizationScale(),
118 info.GetQuantizationOffset(),
123 template<
typename ... Args>
124 bool IsNeonBackendSupported(Optional<std::string&> reasonIfUnsupported, Args... args)
127 #if defined(ARMCOMPUTENEON_ENABLED)
130 SetValueChecked(reasonIfUnsupported,
"The armnn library has been built without NEON support");
135 template<
typename FloatFunc,
typename Uint8Func,
typename ... Params>
136 bool IsSupportedForDataTypeNeon(Optional<std::string&> reasonIfUnsupported,
138 FloatFunc floatFuncPtr,
139 Uint8Func uint8FuncPtr,
142 return IsNeonBackendSupported(reasonIfUnsupported) &&
150 std::forward<Params>(params)...);
153 #if defined(ARMCOMPUTENEON_ENABLED)
154 template<
class FuncType,
class... Args>
155 inline bool IsWorkloadSupported(FuncType& func, Optional<std::string&> reasonIfUnsupported, Args&&... args)
158 const bool supported = (aclStatus.error_code() == arm_compute::ErrorCode::OK);
159 if (!supported && reasonIfUnsupported)
161 reasonIfUnsupported.value() = aclStatus.error_description();
166 #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \
167 return IsWorkloadSupported(func, reasonIfUnsupported, __VA_ARGS__);
169 #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \
170 return IsNeonBackendSupported(reasonIfUnsupported, __VA_ARGS__);
175 : m_ModelContextPtr(modelContextPtr)
180 : m_ModelContextPtr(nullptr)
185 const std::vector<TensorInfo>& infos,
197 *(PolymorphicDowncast<const ActivationDescriptor*>(&descriptor)),
198 reasonIfUnsupported);
204 *(PolymorphicDowncast<const ArgMinMaxDescriptor*>(&descriptor)),
205 reasonIfUnsupported);
210 *(PolymorphicDowncast<const BatchMatMulDescriptor*>(&descriptor)),
211 reasonIfUnsupported);
221 reasonIfUnsupported);
227 reasonIfUnsupported);
229 return support.
IsCastSupported(infos[0], infos[1], reasonIfUnsupported);
235 reasonIfUnsupported);
240 *(PolymorphicDowncast<const ComparisonDescriptor*>(&descriptor)),
241 reasonIfUnsupported);
244 std::vector<const TensorInfo*> inputInfos;
245 for (uint32_t i = 0; i < (infos.size() - 1); i++)
247 inputInfos.push_back(&infos[i]);
250 infos[infos.size() - 1],
251 *(PolymorphicDowncast<const OriginsDescriptor*>(&descriptor)),
252 reasonIfUnsupported);
262 if (infos.size() != 4)
265 "TensorInfos should be of format: {input, output, weights, biases}.");
268 auto desc = *(PolymorphicDowncast<const Convolution2dDescriptor*>(&descriptor));
276 reasonIfUnsupported);
285 reasonIfUnsupported);
290 if (infos.size() != 4)
293 "TensorInfos should be of format: {input, output, weights, biases}.");
296 auto desc = *(PolymorphicDowncast<const Convolution3dDescriptor*>(&descriptor));
304 reasonIfUnsupported);
313 reasonIfUnsupported);
319 *(PolymorphicDowncast<const DepthToSpaceDescriptor*>(&descriptor)),
320 reasonIfUnsupported);
323 if (infos.size() != 4)
326 "TensorInfos should be of format: {input, output, weights, biases}.");
329 auto desc = *(PolymorphicDowncast<const DepthwiseConvolution2dDescriptor*>(&descriptor));
337 reasonIfUnsupported);
346 reasonIfUnsupported);
353 auto desc = *(PolymorphicDowncast<const DetectionPostProcessDescriptor*>(&descriptor));
362 reasonIfUnsupported);
368 auto desc = *(PolymorphicDowncast<const ElementwiseBinaryDescriptor *>(&descriptor));
370 switch (desc.m_Operation)
430 reasonIfUnsupported);
434 *(PolymorphicDowncast<const FillDescriptor*>(&descriptor)),
435 reasonIfUnsupported);
445 reasonIfUnsupported);
448 auto fusedDescriptor = *(PolymorphicDowncast<const FusedDescriptor*>(&descriptor));
449 if (fusedDescriptor.m_NumInputSlots + fusedDescriptor.m_NumOutputSlots != infos.size())
454 auto it = infos.begin() + numeric_cast<TensorInfo::DifferenceType>(fusedDescriptor.m_NumInputSlots);
455 std::vector<TensorInfo> inputInfos(infos.begin(), it);
456 std::vector<TensorInfo> outputInfos(it, infos.end());
459 {outputInfos.begin(), outputInfos.end()},
461 reasonIfUnsupported);
467 *(PolymorphicDowncast<const GatherDescriptor*>(&descriptor)),
468 reasonIfUnsupported);
473 reasonIfUnsupported);
481 reasonIfUnsupported);
487 reasonIfUnsupported);
494 reasonIfUnsupported);
498 *(PolymorphicDowncast<const LogSoftmaxDescriptor*>(&descriptor)),
499 reasonIfUnsupported);
508 *(PolymorphicDowncast<const LstmDescriptor*>(&descriptor)),
509 lstmParamsInfo.
value(),
510 reasonIfUnsupported);
518 *(PolymorphicDowncast<const MeanDescriptor*>(&descriptor)),
519 reasonIfUnsupported);
528 reasonIfUnsupported);
538 reasonIfUnsupported);
544 *(PolymorphicDowncast<const PadDescriptor*>(&descriptor)),
545 reasonIfUnsupported);
549 *(PolymorphicDowncast<const PermuteDescriptor*>(&descriptor)),
550 reasonIfUnsupported);
554 *(PolymorphicDowncast<const Pooling2dDescriptor*>(&descriptor)),
555 reasonIfUnsupported);
559 *(PolymorphicDowncast<const Pooling3dDescriptor*>(&descriptor)),
560 reasonIfUnsupported);
562 return support.
IsPreluSupported(infos[0], infos[1], infos[2], reasonIfUnsupported);
570 *(PolymorphicDowncast<const QLstmDescriptor*>(&descriptor)),
571 lstmParamsInfo.
value(),
572 reasonIfUnsupported);
581 quantizedLstmParamsInfo.
value(),
582 reasonIfUnsupported);
588 *(PolymorphicDowncast<const ReshapeDescriptor*>(&descriptor)),
589 reasonIfUnsupported);
593 *(PolymorphicDowncast<const ResizeDescriptor*>(&descriptor)),
594 reasonIfUnsupported);
598 *(PolymorphicDowncast<const ReduceDescriptor*>(&descriptor)),
599 reasonIfUnsupported);
604 reasonIfUnsupported);
608 reasonIfUnsupported);
612 *(PolymorphicDowncast<const SliceDescriptor*>(&descriptor)),
613 reasonIfUnsupported);
617 *(PolymorphicDowncast<const SoftmaxDescriptor*>(&descriptor)),
618 reasonIfUnsupported);
624 reasonIfUnsupported);
628 *(PolymorphicDowncast<const SpaceToDepthDescriptor*>(&descriptor)),
629 reasonIfUnsupported);
632 std::vector<TensorInfo> outputInfos;
633 for (uint32_t i = 1; i < infos.size(); i++)
635 outputInfos.push_back(infos[i]);
638 {outputInfos.begin(), outputInfos.end()},
639 *(PolymorphicDowncast<const ViewsDescriptor*>(&descriptor)),
640 reasonIfUnsupported);
644 std::vector<const TensorInfo*> inputInfos;
645 for (uint32_t i = 0; i < infos.size() - 1; i++)
647 inputInfos.push_back(&infos[i]);
650 infos[infos.size() - 1],
651 *(PolymorphicDowncast<const StackDescriptor*>(&descriptor)),
652 reasonIfUnsupported);
657 *(PolymorphicDowncast<const StridedSliceDescriptor*>(&descriptor)),
658 reasonIfUnsupported);
664 *(PolymorphicDowncast<const TileDescriptor*>(&descriptor)),
665 reasonIfUnsupported);
669 *(PolymorphicDowncast<const TransposeDescriptor*>(&descriptor)),
670 reasonIfUnsupported);
673 if (infos.size() != 4)
676 "TensorInfos should be of format: {input, output, weights, biases}.");
679 auto desc = *(PolymorphicDowncast<const TransposeConvolution2dDescriptor*>(&descriptor));
687 reasonIfUnsupported);
696 reasonIfUnsupported);
701 auto desc = *(PolymorphicDowncast<const UnidirectionalSequenceLstmDescriptor*>(&descriptor));
709 lstmParamsInfo.
value(),
710 reasonIfUnsupported);
723 const std::vector<TensorInfo>& infos,
733 quantizedLstmParamsInfo,
746 std::string checkStr =
"This CPU architecture does not support F16 data type, you need v8.2 or above";
748 && reasonIfUnsupported.
value().find(checkStr) != std::string::npos)
750 std::vector<TensorInfo> newInfos;
751 for (
auto info: infos)
756 std::string tmpString;
761 quantizedLstmParamsInfo,
814 bool isFastMathEnabled =
false;
815 #if defined(ARMCOMPUTENEON_ENABLED)
816 if (m_ModelContextPtr)
818 if (m_ModelContextPtr.get() !=
nullptr)
915 SetValueChecked(reasonIfUnsupported,
"Neon Concat: Concat axis > Number of dimensions.");
920 if(concatInnerAxis < 3)
928 else if (concatInnerAxis == 3)
930 for (
auto& input : inputs)
934 SetValueChecked(reasonIfUnsupported,
"Neon Concat: Types and quantization parameters must match.");
942 SetValueChecked(reasonIfUnsupported,
"Neon Concat: Maximum of 4 dimensions supported.");
982 bool isFastMathEnabled =
false;
983 #if defined(ARMCOMPUTENEON_ENABLED)
984 if (m_ModelContextPtr)
986 if (m_ModelContextPtr.get() !=
nullptr)
1015 bool isFastMathEnabled =
false;
1016 #if defined(ARMCOMPUTENEON_ENABLED)
1017 if (m_ModelContextPtr)
1019 if (m_ModelContextPtr.get() !=
nullptr)
1031 reasonIfUnsupported,
1047 reasonIfUnsupported,
1061 reasonIfUnsupported,
1075 reasonIfUnsupported,
1088 reasonIfUnsupported,
1106 reasonIfUnsupported,
1111 reasonIfUnsupported,
1116 reasonIfUnsupported,
1121 reasonIfUnsupported,
1126 reasonIfUnsupported,
1131 reasonIfUnsupported,
1136 reasonIfUnsupported,
1141 reasonIfUnsupported,
1158 return IsNeonBackendSupported(reasonIfUnsupported);
1166 return IsNeonBackendSupported(reasonIfUnsupported) &&
1184 reasonIfUnsupported,
1194 const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
1199 reasonIfUnsupported,
1213 reasonIfUnsupported,
1226 reasonIfUnsupported,
1235 return IsNeonBackendSupported(reasonIfUnsupported, input);
1244 reasonIfUnsupported,
1268 reasonIfUnsupported,
1274 reasonIfUnsupported,
1303 reasonIfUnsupported,
1321 reasonIfUnsupported,
1333 reasonIfUnsupported,
1345 reasonIfUnsupported,
1357 reasonIfUnsupported,
1370 reasonIfUnsupported,
1383 reasonIfUnsupported,
1392 return IsNeonBackendSupported(reasonIfUnsupported, output);
1401 reasonIfUnsupported,
1458 reasonIfUnsupported,
1460 previousCellStateIn,
1479 reasonIfUnsupported,
1493 reasonIfUnsupported,
1508 reasonIfUnsupported,
1521 reasonIfUnsupported,
1532 reasonIfUnsupported,
1544 reasonIfUnsupported,
1556 reasonIfUnsupported,
1576 reasonIfUnsupported,
1588 reasonIfUnsupported,
1595 const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
1599 #if defined(ARMCOMPUTENEON_ENABLED)
1609 reasonIfUnsupported,
1612 *splitAxis.begin());
1616 for (
auto output : outputs)
1620 SetValueChecked(reasonIfUnsupported,
"Neon Splitter: Types and quantization parameters must match.");
1633 reasonIfUnsupported,
1645 reasonIfUnsupported,
1657 reasonIfUnsupported,
1670 reasonIfUnsupported,
1684 reasonIfUnsupported,
1718 reasonIfUnsupported,
1731 reasonIfUnsupported,
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
bool IsAdditionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonMinimumWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)
Validate function for validating the inputs and output.
arm_compute::Status NeonFullyConnectedWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TensorInfo &weights, const Optional< TensorInfo > &biases, const FullyConnectedDescriptor &descriptor, const ActivationDescriptor *activationDescriptor)
arm_compute::Status NeonSpaceToBatchNdWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const SpaceToBatchNdDescriptor &descriptor)
bool IsDequantizeSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
unsigned int GetConcatAxis() const
Get the concatenation axis value.
arm_compute::Status NeonReverseV2WorkloadValidate(const TensorInfo &input, const TensorInfo &axis, const TensorInfo &output)
A ViewsDescriptor for the SplitterLayer.
arm_compute::Status NeonTileWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TileDescriptor &descriptor)
An ActivationDescriptor for the ActivationLayer.
arm_compute::Status NeonConvertFp32ToFp16WorkloadValidate(const TensorInfo &input, const TensorInfo &output)
A FullyConnectedDescriptor for the FullyConnectedLayer.
arm_compute::Status NeonAdditionWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ActivationDescriptor *activationDescriptor)
bool IsSpaceToBatchNdSupported(const TensorInfo &input, const TensorInfo &output, const SpaceToBatchNdDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A QLstmDescriptor for the QLstmLayer.
arm_compute::Status NeonAbsWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
arm_compute::Status NeonMultiplicationWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ActivationDescriptor *activationDescriptor)
bool IsPermuteSupported(const TensorInfo &input, const TensorInfo &output, const PermuteDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsFastMathEnabled() const
arm_compute::Status NeonStackWorkloadValidate(const std::vector< const TensorInfo * > &inputs, const TensorInfo &output, const StackDescriptor &descriptor)
arm_compute::Status NeonPooling3dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const Pooling3dDescriptor &descriptor)
bool IsStackSupported(const std::vector< const TensorInfo * > &inputs, const TensorInfo &output, const StackDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A Pooling3dDescriptor for the Pooling3dLayer.
A ResizeDescriptor for the ResizeLayer.
arm_compute::Status NeonNegWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
An ArgMinMaxDescriptor for ArgMinMaxLayer.
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 ¶msInfo)
arm_compute::Status NeonGatherWorkloadValidate(const TensorInfo &input, const TensorInfo &indices, const TensorInfo &output, const GatherDescriptor &descriptor)
arm_compute::Status NeonConvolution3dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const Convolution3dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, bool isFastMathEnabled, const ActivationDescriptor *activationDescriptor)
arm_compute::Status NeonSubtractionWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ActivationDescriptor *activationDescriptor)
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
arm_compute::Status NeonInstanceNormalizationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const InstanceNormalizationDescriptor &descriptor)
A GatherDescriptor for the GatherLayer.
The NeonBackendModelContext is used to pass in Neon specific backend ModelOptions.
arm_compute::Status NeonMeanWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const MeanDescriptor &descriptor)
bool IsBatchMatMulSupported(const TensorInfo &inputX, const TensorInfo &inputY, const TensorInfo &output, const BatchMatMulDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsPooling3dSupported(const TensorInfo &input, const TensorInfo &output, const Pooling3dDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsConvertFp32ToFp16Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonUnidirectionalSequenceLstmFloatWorkloadValidate(const TensorInfo &input, const TensorInfo &outputStateIn, const TensorInfo &cellStateIn, const TensorInfo &outputStateOut, const TensorInfo &cellStateOut, const TensorInfo &output, const UnidirectionalSequenceLstmDescriptor &descriptor, const LstmInputParamsInfo ¶msInfo)
bool IsPreluSupported(const TensorInfo &input, const TensorInfo &alpha, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A L2NormalizationDescriptor for the L2NormalizationLayer.
arm_compute::Status NeonMaximumWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)
uint32_t GetNumDimensions() const
Get the number of dimensions.
A NormalizationDescriptor for the NormalizationLayer.
A ChannelShuffleDescriptor for the ChannelShuffle operator.
bool IsMultiplicationSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonResizeWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const ResizeDescriptor &descriptor)
arm_compute::Status NeonExpWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
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()) const
arm_compute::Status NeonPermuteWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const PermuteDescriptor &descriptor)
arm_compute::Status NeonLogicalNotWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
A StackDescriptor for the StackLayer.
bool IsConstantSupported(const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsLogicalBinarySupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const LogicalBinaryDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported) const
arm_compute::Status NeonBatchMatMulValidate(const TensorInfo &inputInfoX, const TensorInfo &inputInfoY, const TensorInfo &outputInfo, const BatchMatMulDescriptor &descriptor, const bool isFastMathEnabled, const ActivationDescriptor *activationDescriptor)
bool IsBatchToSpaceNdSupported(const TensorInfo &input, const TensorInfo &output, const BatchToSpaceNdDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonConvertFp16ToFp32WorkloadValidate(const TensorInfo &input, const TensorInfo &output)
bool IsReshapeSupported(const TensorInfo &input, const TensorInfo &output, const ReshapeDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
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
arm_compute::Status NeonLogWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
arm_compute::Status NeonArgMinMaxWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const ArgMinMaxDescriptor &descriptor)
bool IsGatherNdSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported) const
bool IsSoftmaxSupported(const TensorInfo &input, const TensorInfo &output, const SoftmaxDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonLogSoftmaxWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const LogSoftmaxDescriptor &descriptor)
arm_compute::Status NeonNormalizationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const NormalizationDescriptor &descriptor)
bool IsSpaceToDepthSupported(const TensorInfo &input, const TensorInfo &output, const SpaceToDepthDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsLayerSupported(const LayerType &type, const std::vector< TensorInfo > &infos, const BaseDescriptor &descriptor, const Optional< LstmInputParamsInfo > &lstmParamsInfo, const Optional< QuantizedLstmInputParamsInfo > &quantizedLstmParamsInfo, Optional< std::string & > reasonIfUnsupported) const override
Default implementation of the ILayerSupport interface, Backends should implement this as a switch sta...
arm_compute::Status NeonConstantWorkloadValidate(const TensorInfo &output)
arm_compute::Status NeonReduceWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const ReduceDescriptor &descriptor)
A FusedDescriptor for the FusedLayer.
bool IsResizeSupported(const TensorInfo &input, const TensorInfo &output, const ResizeDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonPadWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const PadDescriptor &descriptor)
arm_compute::Status NeonGatherNdWorkloadValidate(const TensorInfo ¶msInfo, const TensorInfo &indicesInfo, const TensorInfo &outputInfo)
arm_compute::Status NeonConcatWorkloadValidate(const std::vector< const TensorInfo * > &inputs, const TensorInfo &output, const OriginsDescriptor &descriptor)
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 ¶msInfo)
bool IsReduceSupported(const TensorInfo &input, const TensorInfo &output, const ReduceDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonDivisionWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ActivationDescriptor *activationDescriptor)
bool IsNormalizationSupported(const TensorInfo &input, const TensorInfo &output, const NormalizationDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsSliceSupported(const TensorInfo &input, const TensorInfo &output, const SliceDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonSqrtWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
arm_compute::Status NeonDepthToSpaceWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const DepthToSpaceDescriptor &descriptor)
bool IsSubtractionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
LogicalBinaryOperation m_Operation
Specifies the logical operation to execute.
A PadDescriptor for the PadLayer.
bool IsTileSupported(const TensorInfo &input0, const TensorInfo &output, const TileDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A TransposeDescriptor for the TransposeLayer.
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()) const
bool IsQuantizeSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
A SliceDescriptor for the SliceLayer.
arm_compute::Status NeonTransposeWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TransposeDescriptor &descriptor)
arm_compute::Status NeonSoftmaxWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const SoftmaxDescriptor &descriptor)
bool IsOutputSupported(const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
DestType PolymorphicDowncast(SourceType *value)
Polymorphic downcast for build in pointers only.
arm_compute::Status NeonSpaceToDepthWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const SpaceToDepthDescriptor &descriptor)
bool IsTypeSpaceMatch(const TensorInfo &other) const
Check that the types are the same and, if quantize, that the quantization parameters are the same.
bool IsMinimumSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A ReshapeDescriptor for the ReshapeLayer.
bool IsMergeSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsPadSupported(const TensorInfo &input, const TensorInfo &output, const PadDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsMemImportSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsDepthToSpaceSupported(const TensorInfo &input, const TensorInfo &output, const DepthToSpaceDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsTransposeSupported(const TensorInfo &input, const TensorInfo &output, const TransposeDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A PermuteDescriptor for the PermuteLayer.
A BatchMatMulDescriptor for the BatchMatMul operator.
arm_compute::Status NeonPreluWorkloadValidate(const TensorInfo &input, const TensorInfo &alpha, const TensorInfo &output)
arm_compute::Status NeonDequantizeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
bool IsQuantizedLstmSupported(const TensorInfo &input, const TensorInfo &cellStateIn, const TensorInfo &outputStateIn, const TensorInfo &cellStateOut, const TensorInfo &outputStateOut, const QuantizedLstmInputParamsInfo ¶msInfo, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A Convolution3dDescriptor for the Convolution3dLayer.
Base class for all descriptors.
bool IsConcatSupported(const std::vector< const TensorInfo * > inputs, const TensorInfo &output, const OriginsDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonLogicalAndWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)
bool IsReverseV2Supported(const TensorInfo &input, const TensorInfo &axis, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported) const
arm_compute::Status NeonDepthwiseConvolutionWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, const ActivationDescriptor *activationDescriptor)
bool IsFullyConnectedSupported(const TensorInfo &input, const TensorInfo &output, const TensorInfo &weights, const TensorInfo &biases, const FullyConnectedDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsElementwiseUnarySupported(const TensorInfo &input, const TensorInfo &output, const ElementwiseUnaryDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
DataType GetDataType() const
bool IsDepthwiseConvolutionSupported(const TensorInfo &input, const TensorInfo &output, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonQuantizedLstmWorkloadValidate(const TensorInfo &input, const TensorInfo &cellStateIn, const TensorInfo &outputStateIn, const TensorInfo &cellStateOut, const TensorInfo &outputStateOut, const QuantizedLstmInputParamsInfo ¶msInfo)
arm_compute::Status NeonActivationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const ActivationDescriptor &descriptor)
bool IsFillSupported(const TensorInfo &input, const TensorInfo &output, const FillDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
A Convolution2dDescriptor for the Convolution2dLayer.
A ComparisonDescriptor for the ComparisonLayer.
A FillDescriptor for the FillLayer.
arm_compute::Status NeonQuantizeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
UnaryOperation m_Operation
Specifies the elementwiseUnary operation to execute.
arm_compute::Status NeonBatchToSpaceNdWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const BatchToSpaceNdDescriptor &descriptor)
arm_compute::Status NeonCastValidate(const TensorInfo &input, const TensorInfo &output)
bool IsChannelShuffleSupported(const TensorInfo &input, const TensorInfo &output, const ChannelShuffleDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsShapeSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
#define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported,...)
An LstmDescriptor for the LstmLayer.
A StridedSliceDescriptor for the StridedSliceLayer.
bool IsL2NormalizationSupported(const TensorInfo &input, const TensorInfo &output, const L2NormalizationDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsArgMinMaxSupported(const TensorInfo &input, const TensorInfo &output, const ArgMinMaxDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsInstanceNormalizationSupported(const TensorInfo &input, const TensorInfo &output, const InstanceNormalizationDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
const TensorShape & GetShape() const
bool IsTransposeConvolution2dSupported(const TensorInfo &input, const TensorInfo &output, const TransposeConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonSplitterWorkloadValidate(const TensorInfo &input, const std::vector< std::reference_wrapper< TensorInfo >> &outputs, unsigned int splitAxis)
arm_compute::Status NeonFusedWorkloadValidate(const std::vector< std::reference_wrapper< TensorInfo >> &inputInfos, const std::vector< std::reference_wrapper< TensorInfo >> &outputInfos, const FusedDescriptor &fusedDescriptor, const ActivationDescriptor *activationDescriptor)
arm_compute::Status NeonRsqrtWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
arm_compute::Status NeonUnidirectionalSequenceLstmWorkloadValidate(const TensorInfo &input, const TensorInfo &outputStateIn, const TensorInfo &cellStateIn, const TensorInfo &outputStateOut, const TensorInfo &cellStateOut, const TensorInfo &output, const UnidirectionalSequenceLstmDescriptor &descriptor, const LstmInputParamsInfo ¶msInfo)
arm_compute::Status NeonReshapeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
arm_compute::Status NeonConvolution2dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const Convolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, bool isFastMathEnabled, const ActivationDescriptor *activationDescriptor)
void IgnoreUnused(Ts &&...)
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, const ActivationDescriptor *activationDescriptor)
bool IsCastSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
uint32_t GetNumDimensions() const
Get the number of dimensions.
arm_compute::Status NeonSinWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
bool IsFloorSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsConvolution3dSupported(const TensorInfo &input, const TensorInfo &output, const Convolution3dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsInputSupported(const TensorInfo &input, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsSupportedForDataTypeGeneric(Optional< std::string & > reasonIfUnsupported, DataType dataType, Float16Func float16FuncPtr, Float32Func float32FuncPtr, Uint8Func uint8FuncPtr, Int32Func int32FuncPtr, BooleanFunc booleanFuncPtr, Params &&... params)
@ UnidirectionalSequenceLstm
bool IsMeanSupported(const TensorInfo &input, const TensorInfo &output, const MeanDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsGatherSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const GatherDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported) const
An OriginsDescriptor for the ConcatLayer.
arm_compute::Status NeonStridedSliceWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const StridedSliceDescriptor &descriptor)
Copyright (c) 2021 ARM Limited and Contributors.
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
std::set< unsigned int > ComputeSplitAxis(const armnn::SplitterDescriptor &desc, const TensorShape &input)
Calculates the axis values for split operation.
bool IsConvertFp16ToFp32Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonSliceWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const SliceDescriptor &descriptor)
bool IsDivisionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsDilatedDepthwiseConvolutionSupported(const TensorInfo &input, const TensorInfo &output, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string & > reason=EmptyOptional()) const
bool IsMaximumSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonElementwiseBinaryWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ElementwiseBinaryDescriptor &descriptor, const ActivationDescriptor *activationDescriptor)
arm_compute::Status NeonPooling2dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const Pooling2dDescriptor &descriptor)
bool IsLayerTypeSupported(const LayerType &type, const std::vector< TensorInfo > &infos, const BaseDescriptor &descriptor, const Optional< LstmInputParamsInfo > &lstmParamsInfo, const Optional< QuantizedLstmInputParamsInfo > &quantizedLstmParamsInfo, Optional< std::string & > reasonIfUnsupported, const NeonLayerSupport &support)
void SetValueChecked(Optional< T & > optionalRef, V &&val)
bool IsComparisonSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ComparisonDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonChannelShuffleValidate(const TensorInfo &input, const TensorInfo &output, const ChannelShuffleDescriptor &descriptor)
arm_compute::Status NeonL2NormalizationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const L2NormalizationDescriptor &descriptor)
arm_compute::Status NeonComparisonWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ComparisonDescriptor &descriptor)
A Pooling2dDescriptor for the Pooling2dLayer.
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
bool IsMemCopySupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsUnidirectionalSequenceLstmSupported(const TensorInfo &input, const TensorInfo &outputStateIn, const TensorInfo &cellStateIn, const TensorInfo &outputStateOut, const TensorInfo &cellStateOut, const TensorInfo &output, const UnidirectionalSequenceLstmDescriptor &descriptor, const LstmInputParamsInfo ¶msInfo, Optional< std::string & > reasonIfUnsupported) const
A ReduceDescriptor for the REDUCE operators.
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 ¶msInfo, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsActivationSupported(const TensorInfo &input, const TensorInfo &output, const ActivationDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsSplitterSupported(const TensorInfo &input, const std::vector< std::reference_wrapper< TensorInfo >> &outputs, const ViewsDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
bool IsLogSoftmaxSupported(const TensorInfo &input, const TensorInfo &output, const LogSoftmaxDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A MeanDescriptor for the MeanLayer.
A SoftmaxDescriptor for the SoftmaxLayer.
bool IsStridedSliceSupported(const TensorInfo &input, const TensorInfo &output, const StridedSliceDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
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 ¶msInfo, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
std::shared_ptr< IBackendModelContext > IBackendSpecificModelContextPtr
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
bool has_value() const noexcept
bool IsPooling2dSupported(const TensorInfo &input, const TensorInfo &output, const Pooling2dDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonTransposeConvolution2dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TransposeConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases)
bool IsConvolution2dSupported(const TensorInfo &input, const TensorInfo &output, const Convolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status NeonLogicalOrWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)