24.02
|
Go to the documentation of this file.
12 #if defined(ARMCOMPUTEGPUFSA_ENABLED)
30 template<
typename ... Args>
34 #if defined(ARMCOMPUTEGPUFSA_ENABLED)
37 if (reasonIfUnsupported)
39 reasonIfUnsupported.
value() =
"The armnn library has been built without CL support";
45 #if defined(ARMCOMPUTEGPUFSA_ENABLED)
46 #define FORWARD_GPUFSA_LAYER_SUPPORT_FUNC(expr) (expr)
48 #define FORWARD_GPUFSA_LAYER_SUPPORT_FUNC(expr) IsGpuFsaBackendSupported(reasonIfUnsupported)
51 #if defined(ARMCOMPUTEGPUFSA_ENABLED)
52 template<
class FuncType,
class... Args>
53 inline bool CheckIsLayerSupported(FuncType&& func, Optional<std::string&> reasonIfUnsupported, Args&&... args)
56 const bool supported = (aclStatus.error_code() == arm_compute::ErrorCode::OK);
57 if (!supported && reasonIfUnsupported)
59 reasonIfUnsupported.value() = aclStatus.error_description();
64 #define FORWARD_LAYER_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \
65 return CheckIsLayerSupported(func, reasonIfUnsupported, __VA_ARGS__);
67 #define FORWARD_LAYER_VALIDATE_FUNC(func, reasonIfUnsupported, ...) \
68 return IsGpuFsaBackendSupported(reasonIfUnsupported, __VA_ARGS__);
72 const std::vector<TensorInfo>& infos,
85 if (infos.size() != 2)
88 "TensorInfos should be of format: {input, output}.");
91 auto desc = PolymorphicDowncast<const ActivationDescriptor*>(&descriptor);
99 if (infos.size() != 3)
102 "TensorInfos should be of format: {input0, input1 output}.");
105 auto desc = PolymorphicDowncast<const BatchMatMulDescriptor*>(&descriptor);
114 if (infos.size() != 2)
117 "TensorInfos should be of format: {input, output}.");
127 if (infos.size() != 4)
130 "TensorInfos should be of format: {input, output, weights, biases}.");
133 auto desc = PolymorphicDowncast<const Convolution2dDescriptor*>(&descriptor);
155 if (infos.size() != 4)
158 "TensorInfos should be of format: {input, output, weights, biases}.");
161 auto desc = PolymorphicDowncast<const DepthwiseConvolution2dDescriptor*>(&descriptor);
183 if (infos.size() != 3)
186 "TensorInfos should be of format: {input0, input1, output}.");
189 auto desc = PolymorphicDowncast<const ElementwiseBinaryDescriptor*>(&descriptor);
198 if (infos.size() != 2)
201 "TensorInfos should be of format: {input, output}.");
204 auto desc = PolymorphicDowncast<const Pooling2dDescriptor*>(&descriptor);
212 if (infos.size() != 2)
215 "TensorInfos should be of format: { input, output }.");
218 auto desc = PolymorphicDowncast<const ReshapeDescriptor*>(&descriptor);
227 if (infos.size() != 2)
230 "TensorInfos should be of format: {input, output}.");
233 auto desc = PolymorphicDowncast<const ResizeDescriptor*>(&descriptor);
241 if (infos.size() != 2)
244 "TensorInfos should be of format: {input, output}.");
247 auto desc = PolymorphicDowncast<const SoftmaxDescriptor*>(&descriptor);
arm_compute::Status GpuFsaCastValidate(const TensorInfo &input, const TensorInfo &output)
#define FORWARD_LAYER_VALIDATE_FUNC(func, reasonIfUnsupported,...)
arm_compute::Status GpuFsaPooling2dValidate(const TensorInfo &input, const Pooling2dDescriptor &descriptor)
bool IsGpuFsaBackendSupported(Optional< std::string & > reasonIfUnsupported, Args... args)
bool IsLayerSupported(const LayerType &type, const std::vector< TensorInfo > &infos, const BaseDescriptor &descriptor, const Optional< LstmInputParamsInfo > &lstmParamsInfo, const Optional< QuantizedLstmInputParamsInfo > &, Optional< std::string & > reasonIfUnsupported) const override
Default implementation of the ILayerSupport interface, Backends should implement this as a switch sta...
arm_compute::Status GpuFsaResizeValidate(const TensorInfo &input, const ResizeDescriptor &descriptor)
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
arm_compute::Status GpuFsaReshapeValidate(const TensorInfo &input, const ReshapeDescriptor &descriptor)
arm_compute::Status GpuFsaActivationValidate(const TensorInfo &input, const ActivationDescriptor &descriptor)
Base class for all descriptors.
arm_compute::Status GpuFsaConvolution2dValidate(const TensorInfo &input, const Convolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases)
void IgnoreUnused(Ts &&...)
Copyright (c) 2021 ARM Limited and Contributors.
arm_compute::Status GpuFsaElementwiseBinaryValidate(const TensorInfo &input0, const TensorInfo &input1, const ElementwiseBinaryDescriptor &descriptor)
arm_compute::Status GpuFsaDepthwiseConvolution2dValidate(const TensorInfo &input, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases)
arm_compute::Status GpuFsaSoftmaxValidate(const TensorInfo &input, const TensorInfo &output, const SoftmaxDescriptor &descriptor)
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
arm_compute::Status GpuFsaBatchMatMulValidate(const TensorInfo &input0, const TensorInfo &input1, const BatchMatMulDescriptor &descriptor)