24.08
|
Go to the documentation of this file.
18 #if defined(ARMCOMPUTECL_ENABLED)
100 template<
unsigned int FilterSize>
101 bool IsMatchingSize2d(
const TensorInfo& weightInfo)
104 return (weightInfo.GetShape()[3] == FilterSize) && (weightInfo.GetShape()[2] == FilterSize);
107 template<u
int32_t Val
idStr
ide>
108 bool IsMatchingStride(uint32_t actualStride)
110 return ValidStride == actualStride;
113 template<uint32_t FirstStride, uint32_t SecondStride, uint32_t... ValidStrides>
114 bool IsMatchingStride(uint32_t actualStride)
116 return IsMatchingStride<FirstStride>(actualStride) || IsMatchingStride<SecondStride, ValidStrides...>(actualStride);
119 template<
typename ... Args>
120 bool IsClBackendSupported(Optional<std::string&> reasonIfUnsupported, Args... args)
123 #if defined(ARMCOMPUTECL_ENABLED)
126 if (reasonIfUnsupported)
128 reasonIfUnsupported.value() =
"The armnn library has been built without CL support";
134 #if defined(ARMCOMPUTECL_ENABLED)
135 #define FORWARD_CL_LAYER_SUPPORT_FUNC(expr) (expr)
137 #define FORWARD_CL_LAYER_SUPPORT_FUNC(expr) IsClBackendSupported(reasonIfUnsupported)
140 #if defined(ARMCOMPUTECL_ENABLED)
141 template<
class FuncType,
class... Args>
142 inline bool IsWorkloadSupported(FuncType&& func, Optional<std::string&> reasonIfUnsupported, Args&&... args)
145 const bool supported = (aclStatus.error_code() == arm_compute::ErrorCode::OK);
146 if (!supported && reasonIfUnsupported)
148 reasonIfUnsupported.value() = aclStatus.error_description();
153 #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \
154 return IsWorkloadSupported(func, reasonIfUnsupported, __VA_ARGS__);
156 #define FORWARD_WORKLOAD_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \
157 return IsClBackendSupported(reasonIfUnsupported, __VA_ARGS__);
160 template<
typename FloatFunc,
typename Uint8Func,
typename ... Params>
161 bool IsSupportedForDataTypeCl(Optional<std::string&> reasonIfUnsupported,
163 FloatFunc floatFuncPtr,
164 Uint8Func uint8FuncPtr,
167 return IsClBackendSupported(reasonIfUnsupported) &&
175 std::forward<Params>(params)...);
180 : m_ModelContextPtr(modelContextPtr)
185 : m_ModelContextPtr(nullptr)
190 const std::vector<TensorInfo>& infos,
201 *(PolymorphicDowncast<const ActivationDescriptor*>(&descriptor)),
202 reasonIfUnsupported);
210 *(PolymorphicDowncast<const ArgMinMaxDescriptor*>(&descriptor)),
211 reasonIfUnsupported);
216 *(PolymorphicDowncast<const BatchMatMulDescriptor*>(&descriptor)),
217 reasonIfUnsupported);
225 *(PolymorphicDowncast<const BatchNormalizationDescriptor*>
227 reasonIfUnsupported);
231 *(PolymorphicDowncast<const BatchToSpaceNdDescriptor*>(&descriptor)),
232 reasonIfUnsupported);
238 *(PolymorphicDowncast<const ChannelShuffleDescriptor*>(&descriptor)),
239 reasonIfUnsupported);
244 *(PolymorphicDowncast<const ComparisonDescriptor*>(&descriptor)),
245 reasonIfUnsupported);
248 std::vector<const TensorInfo*> inputInfos;
249 for (uint32_t i = 0; i < (infos.size() - 1); i++)
251 inputInfos.push_back(&infos[i]);
254 infos[infos.size() - 1],
255 *(PolymorphicDowncast<const OriginsDescriptor*>(&descriptor)),
256 reasonIfUnsupported);
266 if (infos.size() != 4)
269 "TensorInfos should be of format: {input, output, weights, biases}.");
272 auto desc = *(PolymorphicDowncast<const Convolution2dDescriptor*>(&descriptor));
280 reasonIfUnsupported);
289 reasonIfUnsupported);
294 if (infos.size() != 4)
297 "TensorInfos should be of format: {input, output, weights, biases}.");
300 auto desc = *(PolymorphicDowncast<const Convolution3dDescriptor*>(&descriptor));
308 reasonIfUnsupported);
317 reasonIfUnsupported);
323 *(PolymorphicDowncast<const DepthToSpaceDescriptor*>(&descriptor)),
324 reasonIfUnsupported);
327 if (infos.size() != 4)
330 "TensorInfos should be of format: {input, output, weights, biases}.");
333 auto desc = *(PolymorphicDowncast<const DepthwiseConvolution2dDescriptor*>(&descriptor));
341 reasonIfUnsupported);
350 reasonIfUnsupported);
361 auto desc = *(PolymorphicDowncast<const ElementwiseBinaryDescriptor *>(&descriptor));
363 switch (desc.m_Operation)
421 *(PolymorphicDowncast<const ElementwiseUnaryDescriptor*>(&descriptor)),
422 reasonIfUnsupported);
426 *(PolymorphicDowncast<const FillDescriptor*>(&descriptor)),
427 reasonIfUnsupported);
435 *(PolymorphicDowncast<const FullyConnectedDescriptor*>(&descriptor)),
436 reasonIfUnsupported);
441 *(PolymorphicDowncast<const GatherDescriptor*>(&descriptor)),
442 reasonIfUnsupported);
447 reasonIfUnsupported);
453 *(PolymorphicDowncast<const InstanceNormalizationDescriptor*>
455 reasonIfUnsupported);
459 *(PolymorphicDowncast<const L2NormalizationDescriptor*>(&descriptor)),
460 reasonIfUnsupported);
465 *(PolymorphicDowncast<const LogicalBinaryDescriptor*>(&descriptor)),
466 reasonIfUnsupported);
470 *(PolymorphicDowncast<const LogSoftmaxDescriptor*>(&descriptor)),
471 reasonIfUnsupported);
480 *(PolymorphicDowncast<const LstmDescriptor*>(&descriptor)),
481 lstmParamsInfo.
value(),
482 reasonIfUnsupported);
493 reasonIfUnsupported);
501 *(PolymorphicDowncast<const MeanDescriptor*>(&descriptor)),
502 reasonIfUnsupported);
514 *(PolymorphicDowncast<const NormalizationDescriptor*>(&descriptor)),
515 reasonIfUnsupported);
521 *(PolymorphicDowncast<const PadDescriptor*>(&descriptor)),
522 reasonIfUnsupported);
526 *(PolymorphicDowncast<const PermuteDescriptor*>(&descriptor)),
527 reasonIfUnsupported);
531 *(PolymorphicDowncast<const Pooling2dDescriptor*>(&descriptor)),
532 reasonIfUnsupported);
536 *(PolymorphicDowncast<const Pooling3dDescriptor*>(&descriptor)),
537 reasonIfUnsupported);
547 *(PolymorphicDowncast<const QLstmDescriptor*>(&descriptor)),
548 lstmParamsInfo.
value(),
549 reasonIfUnsupported);
558 quantizedLstmParamsInfo.
value(),
559 reasonIfUnsupported);
565 *(PolymorphicDowncast<const ReduceDescriptor*>(&descriptor)),
566 reasonIfUnsupported);
570 *(PolymorphicDowncast<const ReshapeDescriptor*>(&descriptor)),
571 reasonIfUnsupported);
575 *(PolymorphicDowncast<const ResizeDescriptor*>(&descriptor)),
576 reasonIfUnsupported);
581 reasonIfUnsupported);
587 *(PolymorphicDowncast<const ScatterNdDescriptor*>(&descriptor)),
588 reasonIfUnsupported);
592 reasonIfUnsupported);
596 *(PolymorphicDowncast<const SliceDescriptor*>(&descriptor)),
597 reasonIfUnsupported);
601 *(PolymorphicDowncast<const SoftmaxDescriptor*>(&descriptor)),
602 reasonIfUnsupported);
606 *(PolymorphicDowncast<const SpaceToBatchNdDescriptor*>(&descriptor)),
607 reasonIfUnsupported);
611 *(PolymorphicDowncast<const SpaceToDepthDescriptor*>(&descriptor)),
612 reasonIfUnsupported);
615 std::vector<TensorInfo> outputInfos;
616 for (uint32_t i = 1; i < infos.size(); i++)
618 outputInfos.push_back(infos[i]);
621 {outputInfos.begin(), outputInfos.end()},
622 *(PolymorphicDowncast<const ViewsDescriptor*>(&descriptor)),
623 reasonIfUnsupported);
627 std::vector<const TensorInfo*> inputInfos;
628 for (uint32_t i = 0; i < infos.size() - 1; i++)
630 inputInfos.push_back(&infos[i]);
633 infos[infos.size() - 1],
634 *(PolymorphicDowncast<const StackDescriptor*>(&descriptor)),
635 reasonIfUnsupported);
640 *(PolymorphicDowncast<const StridedSliceDescriptor*>(&descriptor)),
641 reasonIfUnsupported);
649 *(PolymorphicDowncast<const TileDescriptor*>(&descriptor)),
650 reasonIfUnsupported);
654 *(PolymorphicDowncast<const TransposeDescriptor*>(&descriptor)),
655 reasonIfUnsupported);
658 if (infos.size() != 4)
661 "TensorInfos should be of format: {input, output, weights, biases}.");
664 auto desc = *(PolymorphicDowncast<const TransposeConvolution2dDescriptor*>(&descriptor));
672 reasonIfUnsupported);
681 reasonIfUnsupported);
693 lstmParamsInfo.
value(),
694 reasonIfUnsupported);
834 SetValueChecked(reasonIfUnsupported,
"Cl Concat: Concat axis > Number of dimensions.");
839 if(concatInnerAxis < 3)
847 else if (concatInnerAxis == 3)
851 for (
auto& input : inputs)
855 SetValueChecked(reasonIfUnsupported,
"Cl Concat: Types and quantization parameters must match.");
863 SetValueChecked(reasonIfUnsupported,
"Cl Concat: Maximum of 4 dimensions supported.");
903 bool isFastMathEnabled =
false;
904 #if defined(ARMCOMPUTECL_ENABLED)
905 if (m_ModelContextPtr)
907 if (m_ModelContextPtr.get() !=
nullptr)
936 bool isFastMathEnabled =
false;
937 #if defined(ARMCOMPUTECL_ENABLED)
938 if (m_ModelContextPtr)
940 if (m_ModelContextPtr.get() !=
nullptr)
1009 reasonIfUnsupported,
1025 reasonIfUnsupported,
1041 reasonIfUnsupported,
1046 reasonIfUnsupported,
1051 reasonIfUnsupported,
1056 reasonIfUnsupported,
1061 reasonIfUnsupported,
1066 reasonIfUnsupported,
1071 reasonIfUnsupported,
1076 reasonIfUnsupported,
1093 return IsClBackendSupported(reasonIfUnsupported);
1101 reasonIfUnsupported,
1114 reasonIfUnsupported,
1130 reasonIfUnsupported,
1143 reasonIfUnsupported,
1152 return IsClBackendSupported(reasonIfUnsupported, input);
1161 reasonIfUnsupported,
1173 reasonIfUnsupported,
1191 reasonIfUnsupported,
1197 reasonIfUnsupported,
1213 reasonIfUnsupported,
1231 reasonIfUnsupported,
1249 reasonIfUnsupported,
1261 reasonIfUnsupported,
1273 reasonIfUnsupported,
1285 reasonIfUnsupported,
1303 return IsClBackendSupported(reasonIfUnsupported, output);
1312 reasonIfUnsupported,
1368 reasonIfUnsupported,
1370 previousCellStateIn,
1393 reasonIfUnsupported,
1395 previousCellStateIn,
1407 reasonIfUnsupported,
1418 reasonIfUnsupported,
1447 reasonIfUnsupported,
1461 reasonIfUnsupported,
1491 reasonIfUnsupported,
1503 reasonIfUnsupported,
1510 const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
1514 #if defined(ARMCOMPUTECL_ENABLED)
1524 reasonIfUnsupported,
1527 *splitAxis.begin());
1531 for (
auto output : outputs)
1535 SetValueChecked(reasonIfUnsupported,
"Cl Splitter: Types and quantization parameters must match.");
1548 reasonIfUnsupported,
1560 reasonIfUnsupported,
1572 reasonIfUnsupported,
1585 reasonIfUnsupported,
1599 reasonIfUnsupported,
1626 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
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)
arm_compute::Status ClScatterNdWorkloadValidate(const TensorInfo &inputInfo, const TensorInfo &indicesInfo, const TensorInfo &updatesInfo, const TensorInfo &outputInfo, const ScatterNdDescriptor &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
std::set< unsigned int > ComputeSplitAxis(const armnn::SplitterDescriptor &desc, const TensorShape &input)
Calculates the axis values for split operation.
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 ScatterNdDescriptor for the ScatterNdLayer.
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.
bool IsScatterNdSupported(const TensorInfo &input, const TensorInfo &indices, const TensorInfo &updates, const TensorInfo &output, const ScatterNdDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
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