From 7e4b23953e885e58d655a7d9f35a1afcc38365e4 Mon Sep 17 00:00:00 2001 From: Gian Marco Iodice Date: Thu, 22 Feb 2018 16:17:20 +0000 Subject: COMPMID-935 - Implementing Convolution with Winograd on OpenCL (part 2) Implemented Winograd Filter Transform 3x3 on OpenCL Change-Id: I8f2b2dd938c5c000ef7ce392a37fb7b8b4202a4e Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/122708 Reviewed-by: Georgios Pinitas Tested-by: Jenkins --- arm_compute/core/utils/misc/ShapeCalculator.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'arm_compute/core/utils') diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index 354f60d016..9cb8023463 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -184,7 +184,7 @@ inline TensorShape compute_fully_connected_reshaped_weights_shape(const ITensorI output_shape = compute_transposed_shape(*input); } - // If the we run multiple batches we need 1xW transpose, too. + // If we run multiple batches we need 1xW transpose, too. if(is_batched_fc_layer) { output_shape = compute_transposed_shape(input->clone()->set_tensor_shape(output_shape)); @@ -193,6 +193,29 @@ inline TensorShape compute_fully_connected_reshaped_weights_shape(const ITensorI return output_shape; } + +inline TensorShape compute_winograd_filter_transform_shape(const ITensorInfo &input) +{ + // COMPMID-984 (giaiod01) + TensorShape tensor_shape{ input.tensor_shape() }; + + if(input.data_layout() == DataLayout::NCHW) + { + tensor_shape.remove_dimension(0); + tensor_shape.set(Window::DimX, input.dimension(3)); + tensor_shape.set(Window::DimY, input.dimension(2)); + tensor_shape.set(Window::DimZ, 16); + } + else + { + tensor_shape.remove_dimension(1); + tensor_shape.set(Window::DimY, input.dimension(2)); + tensor_shape.set(Window::DimZ, 16); + } + + return tensor_shape; +} + inline TensorShape compute_winograd_input_transform_shape(const ITensorInfo &input, const PadStrideInfo &conv_info, const Size2D &kernel_size) { // Compute height -- cgit v1.2.1