From acce504ec4aebe5e5da470c1cfc3cee401ff11f3 Mon Sep 17 00:00:00 2001 From: giuros01 Date: Thu, 21 Feb 2019 17:32:34 +0000 Subject: COMPMID-1740: Fuse batch normalization with Convolution Layer at graph level Change-Id: I77ca51c2c72783cc26a099a6a9c3210cdbbe822d Signed-off-by: giuros01 Reviewed-on: https://review.mlplatform.org/c/797 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Reviewed-by: Georgios Pinitas --- src/graph/backends/CL/CLFunctionsFactory.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/graph/backends/CL/CLFunctionsFactory.cpp') diff --git a/src/graph/backends/CL/CLFunctionsFactory.cpp b/src/graph/backends/CL/CLFunctionsFactory.cpp index b9e3ddc0a3..7473ff480f 100644 --- a/src/graph/backends/CL/CLFunctionsFactory.cpp +++ b/src/graph/backends/CL/CLFunctionsFactory.cpp @@ -40,7 +40,8 @@ namespace backends /** Target specific information structure used to pass information to the layer templates */ struct CLTargetInfo { - using TensorType = arm_compute::ICLTensor; + using TensorType = arm_compute::ICLTensor; + using TensorConcreteType = CLTensor; static Target TargetType; }; @@ -69,6 +70,14 @@ struct CLEltwiseFunctions using Subtraction = CLArithmeticSubtraction; using Multiplication = CLPixelWiseMultiplication; }; + +/** Function and tensor types to be used inside a CL fused convolution/batch normalization layer */ +struct CLFusedLayerTypes +{ + using ConvolutionLayer = CLConvolutionLayer; + using FuseBatchNormalization = CLFuseBatchNormalization; +}; + // TODO (isagot01): Remove once we support heterogeneous scheduling at function level /** Wrapper for the CPP Function in the OpenCL backend **/ class CPPWrapperFunction : public IFunction @@ -192,6 +201,8 @@ std::unique_ptr CLFunctionFactory::create(INode *node, GraphContext & return detail::create_flatten_layer(*polymorphic_downcast(node)); case NodeType::FullyConnectedLayer: return detail::create_fully_connected_layer(*polymorphic_downcast(node), ctx); + case NodeType::FusedConvolutionBatchNormalizationLayer: + return detail::create_fused_convolution_batch_normalization_layer(*polymorphic_downcast(node)); case NodeType::GenerateProposalsLayer: return detail::create_generate_proposals_layer(*polymorphic_downcast(node), ctx); case NodeType::NormalizationLayer: -- cgit v1.2.1