24.02
|
Go to the documentation of this file.
18 #if defined(ARMCOMPUTECL_ENABLED)
98 template<
unsigned int FilterSize>
99 bool IsMatchingSize2d(
const TensorInfo& weightInfo)
102 return (weightInfo.GetShape()[3] == FilterSize) && (weightInfo.GetShape()[2] == FilterSize);
105 template<u
int32_t Val
idStr
ide>
106 bool IsMatchingStride(uint32_t actualStride)
108 return ValidStride == actualStride;
111 template<uint32_t FirstStride, uint32_t SecondStride, uint32_t... ValidStrides>
112 bool IsMatchingStride(uint32_t actualStride)
114 return IsMatchingStride<FirstStride>(actualStride) || IsMatchingStride<SecondStride, ValidStrides...>(actualStride);
117 template<
typename ... Args>
118 bool IsClBackendSupported(Optional<std::string&> reasonIfUnsupported, Args... args)
121 #if defined(ARMCOMPUTECL_ENABLED)
124 if (reasonIfUnsupported)
126 reasonIfUnsupported.value() =
"The armnn library has been built without CL support";
132 #if defined(ARMCOMPUTECL_ENABLED)
133 #define FORWARD_CL_LAYER_SUPPORT_FUNC(expr) (expr)
135 #define FORWARD_CL_LAYER_SUPPORT_FUNC(expr) IsClBackendSupported(reasonIfUnsupported)
138 #if defined(ARMCOMPUTECL_ENABLED)
139 template<
class FuncType,
class... Args>
140 inline bool IsWorkloadSupported(FuncType&& func, Optional<std::string&> reasonIfUnsupported, Args&&... args)
143 const bool supported = (aclStatus.error_code() == arm_compute::ErrorCode::OK);
144 if (!supported && reasonIfUnsupported)
146 reasonIfUnsupported.value() = aclStatus.error_description();
151 #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \
152 return IsWorkloadSupported(func, reasonIfUnsupported, __VA_ARGS__);
154 #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \
155 return IsClBackendSupported(reasonIfUnsupported, __VA_ARGS__);
158 template<
typename FloatFunc,
typename Uint8Func,
typename ... Params>
159 bool IsSupportedForDataTypeCl(Optional<std::string&> reasonIfUnsupported,
161 FloatFunc floatFuncPtr,
162 Uint8Func uint8FuncPtr,
165 return IsClBackendSupported(reasonIfUnsupported) &&
173 std::forward<Params>(params)...);
178 : m_ModelContextPtr(modelContextPtr)
183 : m_ModelContextPtr(nullptr)
188 const std::vector<TensorInfo>& infos,
199 *(PolymorphicDowncast<const ActivationDescriptor*>(&descriptor)),
200 reasonIfUnsupported);
208 *(PolymorphicDowncast<const ArgMinMaxDescriptor*>(&descriptor)),
209 reasonIfUnsupported);
214 *(PolymorphicDowncast<const BatchMatMulDescriptor*>(&descriptor)),
215 reasonIfUnsupported);
223 *(PolymorphicDowncast<const BatchNormalizationDescriptor*>
225 reasonIfUnsupported);
229 *(PolymorphicDowncast<const BatchToSpaceNdDescriptor*>(&descriptor)),
230 reasonIfUnsupported);
236 *(PolymorphicDowncast<const ChannelShuffleDescriptor*>(&descriptor)),
237 reasonIfUnsupported);
242 *(PolymorphicDowncast<const ComparisonDescriptor*>(&descriptor)),
243 reasonIfUnsupported);
246 std::vector<const TensorInfo*> inputInfos;
247 for (uint32_t i = 0; i < (infos.size() - 1); i++)
249 inputInfos.push_back(&infos[i]);
252 infos[infos.size() - 1],
253 *(PolymorphicDowncast<const OriginsDescriptor*>(&descriptor)),
254 reasonIfUnsupported);
264 if (infos.size() != 4)
267 "TensorInfos should be of format: {input, output, weights, biases}.");
270 auto desc = *(PolymorphicDowncast<const Convolution2dDescriptor*>(&descriptor));
278 reasonIfUnsupported);
287 reasonIfUnsupported);
292 if (infos.size() != 4)
295 "TensorInfos should be of format: {input, output, weights, biases}.");
298 auto desc = *(PolymorphicDowncast<const Convolution3dDescriptor*>(&descriptor));
306 reasonIfUnsupported);
315 reasonIfUnsupported);
321 *(PolymorphicDowncast<const DepthToSpaceDescriptor*>(&descriptor)),
322 reasonIfUnsupported);
325 if (infos.size() != 4)
328 "TensorInfos should be of format: {input, output, weights, biases}.");
331 auto desc = *(PolymorphicDowncast<const DepthwiseConvolution2dDescriptor*>(&descriptor));
339 reasonIfUnsupported);
348 reasonIfUnsupported);
359 auto desc = *(PolymorphicDowncast<const ElementwiseBinaryDescriptor *>(&descriptor));
361 switch (desc.m_Operation)
419 *(PolymorphicDowncast<const ElementwiseUnaryDescriptor*>(&descriptor)),
420 reasonIfUnsupported);
424 *(PolymorphicDowncast<const FillDescriptor*>(&descriptor)),
425 reasonIfUnsupported);
433 *(PolymorphicDowncast<const FullyConnectedDescriptor*>(&descriptor)),
434 reasonIfUnsupported);
439 *(PolymorphicDowncast<const GatherDescriptor*>(&descriptor)),
440 reasonIfUnsupported);
445 reasonIfUnsupported);
451 *(PolymorphicDowncast<const InstanceNormalizationDescriptor*>
453 reasonIfUnsupported);
457 *(PolymorphicDowncast<const L2NormalizationDescriptor*>(&descriptor)),
458 reasonIfUnsupported);
463 *(PolymorphicDowncast<const LogicalBinaryDescriptor*>(&descriptor)),
464 reasonIfUnsupported);
468 *(PolymorphicDowncast<const LogSoftmaxDescriptor*>(&descriptor)),
469 reasonIfUnsupported);
478 *(PolymorphicDowncast<const LstmDescriptor*>(&descriptor)),
479 lstmParamsInfo.
value(),
480 reasonIfUnsupported);
491 reasonIfUnsupported);
499 *(PolymorphicDowncast<const MeanDescriptor*>(&descriptor)),
500 reasonIfUnsupported);
512 *(PolymorphicDowncast<const NormalizationDescriptor*>(&descriptor)),
513 reasonIfUnsupported);
519 *(PolymorphicDowncast<const PadDescriptor*>(&descriptor)),
520 reasonIfUnsupported);
524 *(PolymorphicDowncast<const PermuteDescriptor*>(&descriptor)),
525 reasonIfUnsupported);
529 *(PolymorphicDowncast<const Pooling2dDescriptor*>(&descriptor)),
530 reasonIfUnsupported);
534 *(PolymorphicDowncast<const Pooling3dDescriptor*>(&descriptor)),
535 reasonIfUnsupported);
545 *(PolymorphicDowncast<const QLstmDescriptor*>(&descriptor)),
546 lstmParamsInfo.
value(),
547 reasonIfUnsupported);
556 quantizedLstmParamsInfo.
value(),
557 reasonIfUnsupported);
563 *(PolymorphicDowncast<const ReduceDescriptor*>(&descriptor)),
564 reasonIfUnsupported);
568 *(PolymorphicDowncast<const ReshapeDescriptor*>(&descriptor)),
569 reasonIfUnsupported);
573 *(PolymorphicDowncast<const ResizeDescriptor*>(&descriptor)),
574 reasonIfUnsupported);
579 reasonIfUnsupported);
583 reasonIfUnsupported);
587 *(PolymorphicDowncast<const SliceDescriptor*>(&descriptor)),
588 reasonIfUnsupported);
592 *(PolymorphicDowncast<const SoftmaxDescriptor*>(&descriptor)),
593 reasonIfUnsupported);
597 *(PolymorphicDowncast<const SpaceToBatchNdDescriptor*>(&descriptor)),
598 reasonIfUnsupported);
602 *(PolymorphicDowncast<const SpaceToDepthDescriptor*>(&descriptor)),
603 reasonIfUnsupported);
606 std::vector<TensorInfo> outputInfos;
607 for (uint32_t i = 1; i < infos.size(); i++)
609 outputInfos.push_back(infos[i]);
612 {outputInfos.begin(), outputInfos.end()},
613 *(PolymorphicDowncast<const ViewsDescriptor*>(&descriptor)),
614 reasonIfUnsupported);
618 std::vector<const TensorInfo*> inputInfos;
619 for (uint32_t i = 0; i < infos.size() - 1; i++)
621 inputInfos.push_back(&infos[i]);
624 infos[infos.size() - 1],
625 *(PolymorphicDowncast<const StackDescriptor*>(&descriptor)),
626 reasonIfUnsupported);
631 *(PolymorphicDowncast<const StridedSliceDescriptor*>(&descriptor)),
632 reasonIfUnsupported);
640 *(PolymorphicDowncast<const TileDescriptor*>(&descriptor)),
641 reasonIfUnsupported);
645 *(PolymorphicDowncast<const TransposeDescriptor*>(&descriptor)),
646 reasonIfUnsupported);
649 if (infos.size() != 4)
652 "TensorInfos should be of format: {input, output, weights, biases}.");
655 auto desc = *(PolymorphicDowncast<const TransposeConvolution2dDescriptor*>(&descriptor));
663 reasonIfUnsupported);
672 reasonIfUnsupported);
684 lstmParamsInfo.
value(),
685 reasonIfUnsupported);
825 SetValueChecked(reasonIfUnsupported,
"Cl Concat: Concat axis > Number of dimensions.");
830 if(concatInnerAxis < 3)
838 else if (concatInnerAxis == 3)
842 for (
auto& input : inputs)
846 SetValueChecked(reasonIfUnsupported,
"Cl Concat: Types and quantization parameters must match.");
854 SetValueChecked(reasonIfUnsupported,
"Cl Concat: Maximum of 4 dimensions supported.");
894 bool isFastMathEnabled =
false;
895 #if defined(ARMCOMPUTECL_ENABLED)
896 if (m_ModelContextPtr)
898 if (m_ModelContextPtr.get() !=
nullptr)
927 bool isFastMathEnabled =
false;
928 #if defined(ARMCOMPUTECL_ENABLED)
929 if (m_ModelContextPtr)
931 if (m_ModelContextPtr.get() !=
nullptr)
1000 reasonIfUnsupported,
1016 reasonIfUnsupported,
1032 reasonIfUnsupported,
1037 reasonIfUnsupported,
1042 reasonIfUnsupported,
1047 reasonIfUnsupported,
1052 reasonIfUnsupported,
1057 reasonIfUnsupported,
1062 reasonIfUnsupported,
1067 reasonIfUnsupported,
1084 return IsClBackendSupported(reasonIfUnsupported);
1092 reasonIfUnsupported,
1105 reasonIfUnsupported,
1121 reasonIfUnsupported,
1134 reasonIfUnsupported,
1143 return IsClBackendSupported(reasonIfUnsupported, input);
1152 reasonIfUnsupported,
1164 reasonIfUnsupported,
1182 reasonIfUnsupported,
1188 reasonIfUnsupported,
1204 reasonIfUnsupported,
1222 reasonIfUnsupported,
1240 reasonIfUnsupported,
1252 reasonIfUnsupported,
1264 reasonIfUnsupported,
1276 reasonIfUnsupported,
1294 return IsClBackendSupported(reasonIfUnsupported, output);
1303 reasonIfUnsupported,
1359 reasonIfUnsupported,
1361 previousCellStateIn,
1384 reasonIfUnsupported,
1386 previousCellStateIn,
1398 reasonIfUnsupported,
1409 reasonIfUnsupported,
1438 reasonIfUnsupported,
1466 reasonIfUnsupported,
1478 reasonIfUnsupported,
1485 const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
1489 #if defined(ARMCOMPUTECL_ENABLED)
1499 reasonIfUnsupported,
1502 *splitAxis.begin());
1506 for (
auto output : outputs)
1510 SetValueChecked(reasonIfUnsupported,
"Cl Splitter: Types and quantization parameters must match.");
1523 reasonIfUnsupported,
1535 reasonIfUnsupported,
1547 reasonIfUnsupported,
1560 reasonIfUnsupported,
1574 reasonIfUnsupported,
1601 reasonIfUnsupported,
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
bool IsPooling2dSupported(const TensorInfo &input, const TensorInfo &output, const Pooling2dDescriptor &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
unsigned int GetConcatAxis() const
Get the concatenation axis value.
arm_compute::Status ClLogWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
A ViewsDescriptor for the SplitterLayer.
arm_compute::Status ClRsqrtWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
An ActivationDescriptor for the ActivationLayer.
A FullyConnectedDescriptor for the FullyConnectedLayer.
bool IsMinimumSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClFloorWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
A QLstmDescriptor for the QLstmLayer.
bool IsPreluSupported(const TensorInfo &input, const TensorInfo &alpha, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClSubtractionValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ActivationDescriptor *activationDescriptor)
bool IsConvolution2dSupported(const TensorInfo &input, const TensorInfo &output, const Convolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, 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
bool IsConcatSupported(const std::vector< const TensorInfo * > inputs, const TensorInfo &output, const OriginsDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClQuantizeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
arm_compute::Status ClTransposeConvolution2dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TransposeConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases)
arm_compute::Status ClCastValidate(const TensorInfo &input, const TensorInfo &output)
#define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported,...)
arm_compute::Status ClStridedSliceWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const StridedSliceDescriptor &descriptor)
A Pooling3dDescriptor for the Pooling3dLayer.
arm_compute::Status ClExpWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
A ResizeDescriptor for the ResizeLayer.
An ArgMinMaxDescriptor for ArgMinMaxLayer.
arm_compute::Status ClMaximumWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)
bool IsAdditionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
bool IsBatchMatMulSupported(const TensorInfo &inputX, const TensorInfo &inputY, const TensorInfo &output, const BatchMatMulDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClMultiplicationWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ActivationDescriptor *activationDescriptor)
A GatherDescriptor for the GatherLayer.
arm_compute::Status ClGatherNdWorkloadValidate(const TensorInfo ¶msInfo, const TensorInfo &indicesInfo, const TensorInfo &outputInfo)
arm_compute::Status ClSpaceToDepthWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const SpaceToDepthDescriptor &descriptor)
bool IsMaximumSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClSplitterWorkloadValidate(const TensorInfo &input, const std::vector< std::reference_wrapper< TensorInfo >> &outputs, unsigned int splitAxis)
bool IsActivationSupported(const TensorInfo &input, const TensorInfo &output, const ActivationDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A L2NormalizationDescriptor for the L2NormalizationLayer.
arm_compute::Status ClUnidirectionalSequenceLstmFloatWorkloadValidate(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 ClBatchToSpaceNdWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const BatchToSpaceNdDescriptor &descriptor)
uint32_t GetNumDimensions() const
Get the number of dimensions.
A NormalizationDescriptor for the NormalizationLayer.
bool IsOutputSupported(const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClLogicalAndWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)
bool IsDepthwiseConvolutionSupported(const TensorInfo &input, const TensorInfo &output, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsPadSupported(const TensorInfo &input, const TensorInfo &output, const PadDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsFullyConnectedSupported(const TensorInfo &input, const TensorInfo &output, const TensorInfo &weights, const TensorInfo &biases, const FullyConnectedDescriptor &descriptor, 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
A ChannelShuffleDescriptor for the ChannelShuffle operator.
arm_compute::Status ClDepthToSpaceWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const DepthToSpaceDescriptor &descriptor)
arm_compute::Status ClActivationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const ActivationDescriptor &descriptor)
arm_compute::Status ClMeanValidate(const TensorInfo &input, const TensorInfo &output, const MeanDescriptor &descriptor)
arm_compute::Status ClElementwiseBinaryValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ElementwiseBinaryDescriptor &descriptor, const ActivationDescriptor *activationDescriptor)
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
arm_compute::Status ClChannelShuffleValidate(const TensorInfo &input, const TensorInfo &output, const ChannelShuffleDescriptor &descriptor)
bool IsNormalizationSupported(const TensorInfo &input, const TensorInfo &output, const NormalizationDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsReduceSupported(const TensorInfo &input, const TensorInfo &output, const ReduceDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClFullyConnectedWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TensorInfo &weights, const Optional< TensorInfo > &biases, const FullyConnectedDescriptor &descriptor, const ActivationDescriptor *activationDescriptor)
A StackDescriptor for the StackLayer.
arm_compute::Status ClConvolution2dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const Convolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, bool isFastMathEnabled, const ActivationDescriptor *activationDescriptor)
bool IsSliceSupported(const TensorInfo &input, const TensorInfo &output, const SliceDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
std::set< unsigned int > ComputeSplitAxis(const armnn::SplitterDescriptor &desc, const TensorShape &input)
bool IsSoftmaxSupported(const TensorInfo &input, const TensorInfo &output, const SoftmaxDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsMeanSupported(const TensorInfo &input, const TensorInfo &output, const MeanDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClL2NormalizationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const L2NormalizationDescriptor &descriptor)
bool IsChannelShuffleSupported(const TensorInfo &input, const TensorInfo &output, const ChannelShuffleDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsConvertFp16ToFp32Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsFloorSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClAdditionValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ActivationDescriptor *activationDescriptor)
arm_compute::Status ClNegWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
bool IsQuantizeSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClQLstmWorkloadValidate(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 ClReduceWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const ReduceDescriptor &descriptor)
bool IsMultiplicationSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
The ClBackendModelContext is used to pass in CL specific backend ModelOptions.
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 ClConstantWorkloadValidate(const TensorInfo &output)
arm_compute::Status ClPermuteWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const PermuteDescriptor &descriptor)
bool IsInstanceNormalizationSupported(const TensorInfo &input, const TensorInfo &output, const InstanceNormalizationDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsSpaceToDepthSupported(const TensorInfo &input, const TensorInfo &output, const SpaceToDepthDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsReshapeSupported(const TensorInfo &input, const TensorInfo &output, const ReshapeDescriptor &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
Default implementation of the ILayerSupport interface, Backends should implement this as a switch sta...
arm_compute::Status ClResizeWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const ResizeDescriptor &descriptor)
LogicalBinaryOperation m_Operation
Specifies the logical operation to execute.
A PadDescriptor for the PadLayer.
arm_compute::Status ClPooling3dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const Pooling3dDescriptor &descriptor)
arm_compute::Status ClStackWorkloadValidate(const std::vector< const TensorInfo * > &inputs, const TensorInfo &output, const StackDescriptor &descriptor)
A TransposeDescriptor for the TransposeLayer.
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
A SliceDescriptor for the SliceLayer.
DestType PolymorphicDowncast(SourceType *value)
Polymorphic downcast for build in pointers only.
bool IsTypeSpaceMatch(const TensorInfo &other) const
Check that the types are the same and, if quantize, that the quantization parameters are the same.
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
arm_compute::Status ClComparisonWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ComparisonDescriptor &descriptor)
arm_compute::Status ClTileWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TileDescriptor &descriptor)
A ReshapeDescriptor for the ReshapeLayer.
bool IsMergeSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsComparisonSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &ouput, const ComparisonDescriptor &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 IsMemImportSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClConvertFp32ToFp16WorkloadValidate(const TensorInfo &input, const TensorInfo &output)
arm_compute::Status ClTransposeWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TransposeDescriptor &descriptor)
A PermuteDescriptor for the PermuteLayer.
A BatchMatMulDescriptor for the BatchMatMul operator.
arm_compute::Status ClSoftmaxWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const SoftmaxDescriptor &descriptor)
arm_compute::Status ClReverseV2WorkloadValidate(const TensorInfo &input, const TensorInfo &axis, const TensorInfo &output)
arm_compute::Status ClPadValidate(const TensorInfo &input, const TensorInfo &output, const PadDescriptor &descriptor)
bool IsTransposeSupported(const TensorInfo &input, const TensorInfo &output, const TransposeDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsTileSupported(const TensorInfo &input, const TensorInfo &output, const TileDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClInstanceNormalizationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const InstanceNormalizationDescriptor &descriptor)
arm_compute::Status ClGatherWorkloadValidate(const TensorInfo &input, const TensorInfo &indices, const TensorInfo &output, const GatherDescriptor &descriptor)
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
arm_compute::Status ClSliceWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const SliceDescriptor &descriptor)
A Convolution3dDescriptor for the Convolution3dLayer.
arm_compute::Status ClBatchMatMulValidate(const TensorInfo &inputInfoX, const TensorInfo &inputInfoY, const TensorInfo &outputInfo, const BatchMatMulDescriptor &descriptor, const ActivationDescriptor *activationDescriptor)
Base class for all descriptors.
arm_compute::Status ClLstmFloatWorkloadValidate(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 IsSpaceToBatchNdSupported(const TensorInfo &input, const TensorInfo &output, const SpaceToBatchNdDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsL2NormalizationSupported(const TensorInfo &input, const TensorInfo &output, const L2NormalizationDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsCastSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
DataType GetDataType() const
arm_compute::Status ClSqrtWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
arm_compute::Status ClNormalizationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const NormalizationDescriptor &descriptor)
bool IsDivisionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, 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.
bool IsInputSupported(const TensorInfo &input, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsDepthToSpaceSupported(const TensorInfo &input, const TensorInfo &output, const DepthToSpaceDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
UnaryOperation m_Operation
Specifies the elementwiseUnary operation to execute.
bool IsArgMinMaxSupported(const TensorInfo &input, const TensorInfo &output, const ArgMinMaxDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsBatchToSpaceNdSupported(const TensorInfo &input, const TensorInfo &output, const BatchToSpaceNdDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsElementwiseUnarySupported(const TensorInfo &input, const TensorInfo &output, const ElementwiseUnaryDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsResizeSupported(const TensorInfo &input, const TensorInfo &output, const ResizeDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsShapeSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClPooling2dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const Pooling2dDescriptor &descriptor)
bool IsFillSupported(const TensorInfo &input, const TensorInfo &output, const FillDescriptor &descriptor, 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
An LstmDescriptor for the LstmLayer.
A StridedSliceDescriptor for the StridedSliceLayer.
arm_compute::Status ClMinimumWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)
arm_compute::Status ClSpaceToBatchNdWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const SpaceToBatchNdDescriptor &descriptor)
bool IsQuantizedLstmSupported(const TensorInfo &input, const TensorInfo &previousCellStateIn, const TensorInfo &previousOutputIn, const TensorInfo &cellStateOut, const TensorInfo &output, const QuantizedLstmInputParamsInfo ¶msInfo, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
bool IsSubtractionSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
const TensorShape & GetShape() const
#define ARMNN_NO_DEPRECATE_WARN_END
bool IsPermuteSupported(const TensorInfo &input, const TensorInfo &output, const PermuteDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClConvolution3dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const Convolution3dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, bool isFastMathEnabled, const ActivationDescriptor *activationDescriptor)
bool IsGatherNdSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported) const
arm_compute::Status ClBatchNormalizationValidate(const TensorInfo &input, const TensorInfo &output, const TensorInfo &mean, const TensorInfo &var, const TensorInfo &beta, const TensorInfo &gamma, const BatchNormalizationDescriptor &descriptor, const ActivationDescriptor *activationDescriptor)
void IgnoreUnused(Ts &&...)
uint32_t GetNumDimensions() const
Get the number of dimensions.
arm_compute::Status ClQuantizedLstmWorkloadValidate(const TensorInfo &input, const TensorInfo &previousCellStateIn, const TensorInfo &previousOutputIn, const TensorInfo &cellStateOut, const TensorInfo &output, const QuantizedLstmInputParamsInfo ¶msInfo)
arm_compute::Status ClLogSoftmaxWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const LogSoftmaxDescriptor &descriptor)
arm_compute::Status ClDivisionWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ActivationDescriptor *activationDescriptor)
arm_compute::Status ClConcatWorkloadValidate(const std::vector< const TensorInfo * > &inputs, const TensorInfo &output, const OriginsDescriptor &descriptor)
bool IsSupportedForDataTypeGeneric(Optional< std::string & > reasonIfUnsupported, DataType dataType, Float16Func float16FuncPtr, Float32Func float32FuncPtr, Uint8Func uint8FuncPtr, Int32Func int32FuncPtr, BooleanFunc booleanFuncPtr, Params &&... params)
bool IsSplitterSupported(const TensorInfo &input, const std::vector< std::reference_wrapper< TensorInfo >> &outputs, const ViewsDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
@ UnidirectionalSequenceLstm
An OriginsDescriptor for the ConcatLayer.
bool IsDequantizeSupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
Copyright (c) 2021 ARM Limited and Contributors.
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
arm_compute::Status ClPreluWorkloadValidate(const TensorInfo &input, const TensorInfo &alpha, const TensorInfo &output)
bool IsGatherSupported(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const GatherDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported) const
arm_compute::Status ClSinWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
arm_compute::Status ClAbsWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
bool IsStridedSliceSupported(const TensorInfo &input, const TensorInfo &output, const StridedSliceDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsStackSupported(const std::vector< const TensorInfo * > &inputs, const TensorInfo &output, const StackDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
arm_compute::Status ClConvertFp16ToFp32WorkloadValidate(const TensorInfo &input, const TensorInfo &output)
bool IsLogSoftmaxSupported(const TensorInfo &input, const TensorInfo &output, const LogSoftmaxDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
void SetValueChecked(Optional< T & > optionalRef, V &&val)
bool IsConstantSupported(const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A Pooling2dDescriptor for the Pooling2dLayer.
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
arm_compute::Status ClLogicalOrWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output)
arm_compute::Status ClDequantizeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
bool IsMemCopySupported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
A ReduceDescriptor for the REDUCE operators.
arm_compute::Status ClReshapeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
arm_compute::Status ClDepthwiseConvolutionWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, const ActivationDescriptor *activationDescriptor)
A MeanDescriptor for the MeanLayer.
arm_compute::Status ClArgMinMaxWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const ArgMinMaxDescriptor &descriptor)
A SoftmaxDescriptor for the SoftmaxLayer.
bool IsReverseV2Supported(const TensorInfo &input, const TensorInfo &axis, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported) 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
arm_compute::Status ClLogicalNotWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
std::shared_ptr< IBackendModelContext > IBackendSpecificModelContextPtr
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
bool IsConvertFp32ToFp16Supported(const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
bool IsFastMathEnabled() const
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