aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/utils/misc
diff options
context:
space:
mode:
authorGian Marco Iodice <gianmarco.iodice@arm.com>2018-02-22 16:17:20 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:49:16 +0000
commit7e4b23953e885e58d655a7d9f35a1afcc38365e4 (patch)
tree4f5a3f6535aae10a36482bd4f996d3427ac77080 /arm_compute/core/utils/misc
parent66c656a1d10831d8311f7797b285faa2c30bcb3f (diff)
downloadComputeLibrary-7e4b23953e885e58d655a7d9f35a1afcc38365e4.tar.gz
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 <georgios.pinitas@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/utils/misc')
-rw-r--r--arm_compute/core/utils/misc/ShapeCalculator.h25
1 files changed, 24 insertions, 1 deletions
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