24.02
|
Go to the documentation of this file.
19 #if defined(ARMCOMPUTENEON_ENABLED)
98 const TensorInfo OverrideDataType(
const TensorInfo& info, Optional<DataType> type)
104 return TensorInfo(
info.GetShape(),
106 info.GetQuantizationScale(),
107 info.GetQuantizationOffset(),
111 template<
typename ... Args>
112 bool IsNeonBackendSupported(Optional<std::string&> reasonIfUnsupported, Args... args)
115 #if defined(ARMCOMPUTENEON_ENABLED)
118 SetValueChecked(reasonIfUnsupported,
"The armnn library has been built without NEON support");
123 template<
typename FloatFunc,
typename Uint8Func,
typename ... Params>
124 bool IsSupportedForDataTypeNeon(Optional<std::string&> reasonIfUnsupported,
126 FloatFunc floatFuncPtr,
127 Uint8Func uint8FuncPtr,
130 return IsNeonBackendSupported(reasonIfUnsupported) &&
138 std::forward<Params>(params)...);
141 #if defined(ARMCOMPUTENEON_ENABLED)
142 template<
class FuncType,
class... Args>
143 inline bool IsWorkloadSupported(FuncType& func, Optional<std::string&> reasonIfUnsupported, Args&&... args)
146 const bool supported = (aclStatus.error_code() == arm_compute::ErrorCode::OK);
147 if (!supported && reasonIfUnsupported)
149 reasonIfUnsupported.value() = aclStatus.error_description();
154 #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \
155 return IsWorkloadSupported(func, reasonIfUnsupported, __VA_ARGS__);
157 #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \
158 return IsNeonBackendSupported(reasonIfUnsupported, __VA_ARGS__);
163 : m_ModelContextPtr(modelContextPtr)
168 : m_ModelContextPtr(nullptr)
173 const std::vector<TensorInfo>& infos,
185 *(PolymorphicDowncast<const ActivationDescriptor*>(&descriptor)),
186 reasonIfUnsupported);
192 *(PolymorphicDowncast<const ArgMinMaxDescriptor*>(&descriptor)),
193 reasonIfUnsupported);
198 *(PolymorphicDowncast<const BatchMatMulDescriptor*>(&descriptor)),
199 reasonIfUnsupported);
209 reasonIfUnsupported);
215 reasonIfUnsupported);
217 return support.
IsCastSupported(infos[0], infos[1], reasonIfUnsupported);
223 reasonIfUnsupported);
228 *(PolymorphicDowncast<const ComparisonDescriptor*>(&descriptor)),
229 reasonIfUnsupported);
232 std::vector<const TensorInfo*> inputInfos;
233 for (uint32_t i = 0; i < (infos.size() - 1); i++)
235 inputInfos.push_back(&infos[i]);
238 infos[infos.size() - 1],
239 *(PolymorphicDowncast<const OriginsDescriptor*>(&descriptor)),
240 reasonIfUnsupported);
250 if (infos.size() != 4)
253 "TensorInfos should be of format: {input, output, weights, biases}.");
256 auto desc = *(PolymorphicDowncast<const Convolution2dDescriptor*>(&descriptor));
264 reasonIfUnsupported);
273 reasonIfUnsupported);
278 if (infos.size() != 4)
281 "TensorInfos should be of format: {input, output, weights, biases}.");
284 auto desc = *(PolymorphicDowncast<const Convolution3dDescriptor*>(&descriptor));
292 reasonIfUnsupported);
301 reasonIfUnsupported);
307 *(PolymorphicDowncast<const DepthToSpaceDescriptor*>(&descriptor)),
308 reasonIfUnsupported);
311 if (infos.size() != 4)
314 "TensorInfos should be of format: {input, output, weights, biases}.");
317 auto desc = *(PolymorphicDowncast<const DepthwiseConvolution2dDescriptor*>(&descriptor));
325 reasonIfUnsupported);
334 reasonIfUnsupported);
341 auto desc = *(PolymorphicDowncast<const DetectionPostProcessDescriptor*>(&descriptor));
350 reasonIfUnsupported);
356 auto desc = *(PolymorphicDowncast<const ElementwiseBinaryDescriptor *>(&descriptor));
358 switch (desc.m_Operation)
418 reasonIfUnsupported);
422 *(PolymorphicDowncast<const FillDescriptor*>(&descriptor)),
423 reasonIfUnsupported);
433 reasonIfUnsupported);
436 auto fusedDescriptor = *(PolymorphicDowncast<const FusedDescriptor*>(&descriptor));
437 if (fusedDescriptor.m_NumInputSlots + fusedDescriptor.m_NumOutputSlots != infos.size())
442 auto it = infos.begin() + numeric_cast<TensorInfo::DifferenceType>(fusedDescriptor.m_NumInputSlots);
443 std::vector<TensorInfo> inputInfos(infos.begin(), it);
444 std::vector<TensorInfo> outputInfos(it, infos.end());
447 {outputInfos.begin(), outputInfos.end()},
449 reasonIfUnsupported);
455 *(PolymorphicDowncast<const GatherDescriptor*>(&descriptor)),
456 reasonIfUnsupported);
461 reasonIfUnsupported);
469 reasonIfUnsupported);
475 reasonIfUnsupported);
482 reasonIfUnsupported);
486 *(PolymorphicDowncast<const LogSoftmaxDescriptor*>(&descriptor)),
487 reasonIfUnsupported);
496 *(PolymorphicDowncast<const LstmDescriptor*>(&descriptor)),
497 lstmParamsInfo.
value(),
498 reasonIfUnsupported);
506 *(PolymorphicDowncast<const MeanDescriptor*>(&descriptor)),
507 reasonIfUnsupported);
516 reasonIfUnsupported);
526 reasonIfUnsupported);
532 *(PolymorphicDowncast<const PadDescriptor*>(&descriptor)),
533 reasonIfUnsupported);
537 *(PolymorphicDowncast<const PermuteDescriptor*>(&descriptor)),
538 reasonIfUnsupported);
542 *(PolymorphicDowncast<const Pooling2dDescriptor*>(&descriptor)),
543 reasonIfUnsupported);
547 *(PolymorphicDowncast<const Pooling3dDescriptor*>(&descriptor)),
548 reasonIfUnsupported);
550 return support.
IsPreluSupported(infos[0], infos[1], infos[2], reasonIfUnsupported);
558 *(PolymorphicDowncast<const QLstmDescriptor*>(&descriptor)),
559 lstmParamsInfo.
value(),
560 reasonIfUnsupported);
569 quantizedLstmParamsInfo.
value(),
570 reasonIfUnsupported);
576 *(PolymorphicDowncast<const ReshapeDescriptor*>(&descriptor)),
577 reasonIfUnsupported);
581 *(PolymorphicDowncast<const ResizeDescriptor*>(&descriptor)),
582 reasonIfUnsupported);
586 *(PolymorphicDowncast<const ReduceDescriptor*>(&descriptor)),
587 reasonIfUnsupported);
592 reasonIfUnsupported);
596 reasonIfUnsupported);
600 *(PolymorphicDowncast<const SliceDescriptor*>(&descriptor)),
601 reasonIfUnsupported);
605 *(PolymorphicDowncast<const SoftmaxDescriptor*>(&descriptor)),
606 reasonIfUnsupported);
612 reasonIfUnsupported);
616 *(PolymorphicDowncast<const SpaceToDepthDescriptor*>(&descriptor)),
617 reasonIfUnsupported);
620 std::vector<TensorInfo> outputInfos;
621 for (uint32_t i = 1; i < infos.size(); i++)
623 outputInfos.push_back(infos[i]);
626 {outputInfos.begin(), outputInfos.end()},
627 *(PolymorphicDowncast<const ViewsDescriptor*>(&descriptor)),
628 reasonIfUnsupported);
632 std::vector<const TensorInfo*> inputInfos;
633 for (uint32_t i = 0; i < infos.size() - 1; i++)
635 inputInfos.push_back(&infos[i]);
638 infos[infos.size() - 1],
639 *(PolymorphicDowncast<const StackDescriptor*>(&descriptor)),
640 reasonIfUnsupported);
645 *(PolymorphicDowncast<const StridedSliceDescriptor*>(&descriptor)),
646 reasonIfUnsupported);
652 *(PolymorphicDowncast<const TileDescriptor*>(&descriptor)),
653 reasonIfUnsupported);
657 *(PolymorphicDowncast<const TransposeDescriptor*>(&descriptor)),
658 reasonIfUnsupported);
661 if (infos.size() != 4)
664 "TensorInfos should be of format: {input, output, weights, biases}.");
667 auto desc = *(PolymorphicDowncast<const TransposeConvolution2dDescriptor*>(&descriptor));
675 reasonIfUnsupported);
684 reasonIfUnsupported);
689 auto desc = *(PolymorphicDowncast<const UnidirectionalSequenceLstmDescriptor*>(&descriptor));
697 lstmParamsInfo.
value(),
698 reasonIfUnsupported);
711 const std::vector<TensorInfo>& infos,
721 quantizedLstmParamsInfo,
734 std::string checkStr =
"This CPU architecture does not support F16 data type, you need v8.2 or above";
736 && reasonIfUnsupported.
value().find(checkStr) != std::string::npos)
738 std::vector<TensorInfo> newInfos;
739 for (
auto info: infos)
744 std::string tmpString;
749 quantizedLstmParamsInfo,
802 bool isFastMathEnabled =
false;
803 #if defined(ARMCOMPUTENEON_ENABLED)
804 if (m_ModelContextPtr)
806 if (m_ModelContextPtr.get() !=
nullptr)
903 SetValueChecked(reasonIfUnsupported,
"Neon Concat: Concat axis > Number of dimensions.");
908 if(concatInnerAxis < 3)
916 else if (concatInnerAxis == 3)
918 for (
auto& input : inputs)
922 SetValueChecked(reasonIfUnsupported,
"Neon Concat: Types and quantization parameters must match.");
930 SetValueChecked(reasonIfUnsupported,
"Neon Concat: Maximum of 4 dimensions supported.");
970 bool isFastMathEnabled =
false;
971 #if defined(ARMCOMPUTENEON_ENABLED)
972 if (m_ModelContextPtr)
974 if (m_ModelContextPtr.get() !=
nullptr)
1003 bool isFastMathEnabled =
false;
1004 #if defined(ARMCOMPUTENEON_ENABLED)
1005 if (m_ModelContextPtr)
1007 if (m_ModelContextPtr.get() !=
nullptr)
1019 reasonIfUnsupported,
1035 reasonIfUnsupported,
1049 reasonIfUnsupported,
1063 reasonIfUnsupported,
1076 reasonIfUnsupported,
1094 reasonIfUnsupported,
1099 reasonIfUnsupported,
1104 reasonIfUnsupported,
1109 reasonIfUnsupported,
1114 reasonIfUnsupported,
1119 reasonIfUnsupported,
1124 reasonIfUnsupported,
1129 reasonIfUnsupported,
1146 return IsNeonBackendSupported(reasonIfUnsupported);
1154 return IsNeonBackendSupported(reasonIfUnsupported) &&
1172 reasonIfUnsupported,
1182 const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
1187 reasonIfUnsupported,
1201 reasonIfUnsupported,
1214 reasonIfUnsupported,
1223 return IsNeonBackendSupported(reasonIfUnsupported, input);
1232 reasonIfUnsupported,
1256 reasonIfUnsupported,
1262 reasonIfUnsupported,
1291 reasonIfUnsupported,
1309 reasonIfUnsupported,
1321 reasonIfUnsupported,
1333 reasonIfUnsupported,
1345 reasonIfUnsupported,
1358 reasonIfUnsupported,
1371 reasonIfUnsupported,
1380 return IsNeonBackendSupported(reasonIfUnsupported, output);
1389 reasonIfUnsupported,
1446 reasonIfUnsupported,
1448 previousCellStateIn,
1467 reasonIfUnsupported,
1481 reasonIfUnsupported,
1496 reasonIfUnsupported,
1509 reasonIfUnsupported,
1520 reasonIfUnsupported,
1532 reasonIfUnsupported,
1544 reasonIfUnsupported,
1564 reasonIfUnsupported,
1576 reasonIfUnsupported,
1583 const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
1587 #if defined(ARMCOMPUTENEON_ENABLED)
1597 reasonIfUnsupported,
1600 *splitAxis.begin());
1604 for (
auto output : outputs)
1608 SetValueChecked(reasonIfUnsupported,
"Neon Splitter: Types and quantization parameters must match.");
1621 reasonIfUnsupported,
1633 reasonIfUnsupported,
1645 reasonIfUnsupported,
1658 reasonIfUnsupported,
1672 reasonIfUnsupported,
1706 reasonIfUnsupported,
1719 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
std::set< unsigned int > ComputeSplitAxis(const armnn::SplitterDescriptor &desc, const TensorShape &input)
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.
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)