48 Target GCTargetInfo::TargetType = Target::GC;
51 struct GCConvolutionLayerFunctions
53 using GenericConvolutionLayer = GCConvolutionLayer;
54 using GEMMConvolutionLayer = GCConvolutionLayer;
55 using DirectConvolutionLayer = GCDirectConvolutionLayer;
59 struct GCDepthwiseConvolutionLayerFunctions
61 using DepthwiseConvolutionLayer3x3 = GCDepthwiseConvolutionLayer3x3;
65 struct GCEltwiseFunctions
67 using Addition = GCArithmeticAddition;
68 using Multiplication = GCPixelWiseMultiplication;
76 validate_node<GCTargetInfo>(node, 3 , 1 );
94 std::shared_ptr<IMemoryManager> mm =
get_memory_manager(ctx, GCTargetInfo::TargetType);
95 std::unique_ptr<IFunction>
func;
96 std::string func_name;
98 if(conv_algorithm == ConvolutionMethod::Direct)
100 std::tie(func, func_name) = create_named_function<GCConvolutionLayerFunctions::DirectConvolutionLayer>(
101 std::string(
"DirectConvolutionLayer"),
106 std::tie(func, func_name) = create_named_memory_managed_function<GCConvolutionLayerFunctions::GenericConvolutionLayer>(
107 std::string(
"ConvolutionLayer"), mm,
114 <<
" Type: " << func_name
115 <<
" Data Type: " << input->info()->data_type()
116 <<
" Input QuantInfo: " << input->info()->quantization_info()
117 <<
" Weights QuantInfo: " << weights->info()->quantization_info()
118 <<
" Input shape: " << input->info()->tensor_shape()
119 <<
" Weights shape: " << weights->info()->tensor_shape()
120 <<
" Output shape: " << output->info()->tensor_shape()
123 return std::move(func);
129 validate_node<GCTargetInfo>(node, 3 , 1 );
145 const int depth_multiplier = node.depth_multiplier();
148 std::unique_ptr<IFunction>
func;
149 std::string func_name;
150 if(dwc_algorithm == DepthwiseConvolutionMethod::Optimized3x3)
152 std::tie(func, func_name) = create_named_function<GCDepthwiseConvolutionLayerFunctions::DepthwiseConvolutionLayer3x3>(
153 std::string(
"DepthwiseConvolutionLayer3x3"),
154 input, weights, biases, output,
conv_info, depth_multiplier, fused_act);
158 ARM_COMPUTE_ERROR(
"Generic DepthwiseConvolutionLayer is not supported in GLES backend");
164 <<
" Type: " << func_name
165 <<
" Target " << GCTargetInfo::TargetType
166 <<
" Data Type: " << input->info()->data_type()
167 <<
" Input QuantInfo: " << input->info()->quantization_info()
168 <<
" Weights QuantInfo: " << weights->info()->quantization_info()
169 <<
" Input shape: " << input->info()->tensor_shape()
170 <<
" Weights shape: " << weights->info()->tensor_shape()
171 <<
" Output shape: " << output->info()->tensor_shape()
172 <<
" Depth multiplier: " << depth_multiplier
175 return std::move(func);
182 "Creating GC EltwiseLayer node with ID : " << node.id() <<
" and Name: " << node.name() << std::endl);
196 std::unique_ptr<IFunction>
func =
nullptr;
197 std::string func_name;
198 if(eltwise_op == EltwiseOperation::Add)
200 std::tie(func, func_name) = create_named_function<GCEltwiseFunctions::Addition>(
201 std::string(
"GCArithmeticAddition"),
202 input1, input2, output, convert_policy);
204 else if(eltwise_op == EltwiseOperation::Sub)
208 else if(eltwise_op == EltwiseOperation::Mul)
210 std::tie(func, func_name) = create_named_function<GCEltwiseFunctions::Multiplication>(
211 std::string(
"PixelWiseMultiplication"),
212 input1, input2, output, 1.f);
222 <<
" Type: " << node.type()
223 <<
" Target: " << GCTargetInfo::TargetType
224 <<
" Operation: " << func_name
225 <<
" Data Type: " << input1->info()->data_type()
226 <<
" Shape: " << input1->info()->tensor_shape()
229 return std::move(func);
243 case NodeType::ActivationLayer:
244 return detail::create_activation_layer<GCActivationLayer, GCTargetInfo>(*polymorphic_downcast<ActivationLayerNode *>(node));
245 case NodeType::BatchNormalizationLayer:
246 return detail::create_batch_normalization_layer<GCBatchNormalizationLayer, GCTargetInfo>(*polymorphic_downcast<BatchNormalizationLayerNode *>(node));
247 case NodeType::ConvolutionLayer:
249 case NodeType::ConcatenateLayer:
250 return detail::create_concatenate_layer<GCConcatenateLayer, GCTargetInfo>(*polymorphic_downcast<ConcatenateLayerNode *>(node));
251 case NodeType::DepthwiseConvolutionLayer:
253 case NodeType::EltwiseLayer:
255 case NodeType::FullyConnectedLayer:
256 return detail::create_fully_connected_layer<GCFullyConnectedLayer, GCTargetInfo>(*polymorphic_downcast<FullyConnectedLayerNode *>(node), ctx);
257 case NodeType::NormalizationLayer:
258 return detail::create_normalization_layer<GCNormalizationLayer, GCTargetInfo>(*polymorphic_downcast<NormalizationLayerNode *>(node), ctx);
259 case NodeType::NormalizePlanarYUVLayer:
260 return detail::create_normalize_planar_yuv_layer<GCNormalizePlanarYUVLayer, GCTargetInfo>(*polymorphic_downcast<NormalizePlanarYUVLayerNode *>(node));
261 case NodeType::PoolingLayer:
262 return detail::create_pooling_layer<GCPoolingLayer, GCTargetInfo>(*polymorphic_downcast<PoolingLayerNode *>(node));
263 case NodeType::PrintLayer:
264 return detail::create_print_layer<GCTargetInfo>(*polymorphic_downcast<PrintLayerNode *>(node));
265 case NodeType::ResizeLayer:
266 return detail::create_resize_layer<GCScale, GCTargetInfo>(*polymorphic_downcast<ResizeLayerNode *>(node));
267 case NodeType::SoftmaxLayer:
268 return detail::create_softmax_layer<GCSoftmaxLayer, GCTargetInfo>(*polymorphic_downcast<SoftmaxLayerNode *>(node), ctx);
EltwiseOperation
Supported Element-wise operations.
bool enabled() const
Check if initialised.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Interface for GLES Compute tensor.
Activation Layer Information class.
decltype(strategy::transforms) typedef type
#define ARM_COMPUTE_LOG_GRAPH_INFO(x)
Copyright (c) 2017-2021 Arm Limited.
Convolution Layer Weights Information class.
1 channel, 1 S32 per channel
DepthwiseConvolutionMethod
Supported Depthwise Convolution layer methods.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
Padding and stride information class.
std::unique_ptr< IFunction > create_depthwise_convolution_layer< GCDepthwiseConvolutionLayerFunctions, GCTargetInfo >(DepthwiseConvolutionLayerNode &node)
virtual ITensorInfo & set_data_type(DataType data_type)=0
Set the data type to the specified value.
Includes all the OpenGLES functions at once.
bool is_data_type_quantized_asymmetric(DataType dt)
Check if a given data type is of asymmetric quantized type.
Class for specifying the size of an image or rectangle.
std::string to_string(const ICLTensor &arg)
std::shared_ptr< IMemoryManager > get_memory_manager(GraphContext &ctx, Target target)
Returns the memory manager for a given target.
#define ARM_COMPUTE_LOG_GRAPH_VERBOSE(x)
ConvolutionMethod
Supported Convolution layer methods.
std::unique_ptr< IFunction > create_eltwise_layer< GCEltwiseFunctions, GCTargetInfo >(EltwiseLayerNode &node)
Depthwise Convolution Layer node.
ActivationFunction activation() const
Get the type of activation function.
virtual NodeType type() const =0
Returns node's type.
ConvertPolicy
Policy to handle overflow.
std::unique_ptr< IFunction > create_convolution_layer< GCConvolutionLayerFunctions, GCTargetInfo >(ConvolutionLayerNode &node, GraphContext &ctx)