aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/utils/misc
diff options
context:
space:
mode:
authorGiorgio Arena <gioare01@e108627-lin.cambridge.arm.com>2018-03-01 11:13:45 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:49:16 +0000
commit1f9ca1d7737846c74053d68ee0844b448bae298b (patch)
treec8f8c6850b59899a01efcde3b0a2e294af40c5b5 /arm_compute/core/utils/misc
parenta9676118fd2a0e5bc916969af83ecee049bae76b (diff)
downloadComputeLibrary-1f9ca1d7737846c74053d68ee0844b448bae298b.tar.gz
COMPMID-935 Implementing Convolution with Winograd on OpenCL (part 3)
Change-Id: I51f92f30602fb0a02314f344fa67061f448694bf Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/122793 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Giorgio Arena <giorgio.arena@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Diffstat (limited to 'arm_compute/core/utils/misc')
-rw-r--r--arm_compute/core/utils/misc/ShapeCalculator.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h
index e21e5cd0d6..2919625511 100644
--- a/arm_compute/core/utils/misc/ShapeCalculator.h
+++ b/arm_compute/core/utils/misc/ShapeCalculator.h
@@ -194,6 +194,24 @@ inline TensorShape compute_fully_connected_reshaped_weights_shape(const ITensorI
return output_shape;
}
+
+inline TensorShape compute_winograd_input_transform_shape(const ITensorInfo &input, const PadStrideInfo &conv_info, const Size2D &kernel_size)
+{
+ // Compute height
+ const unsigned int num_tiles_x = std::ceil((input.tensor_shape().x() - (kernel_size.width - 1) + conv_info.pad_left() + conv_info.pad_right()) / 2.f);
+ const unsigned int num_tiles_y = std::ceil((input.tensor_shape().y() - (kernel_size.height - 1) + conv_info.pad_top() + conv_info.pad_bottom()) / 2.f);
+
+ const unsigned int width = input.tensor_shape()[get_data_layout_dimension_index(input.data_layout(), DataLayoutDimension::CHANNEL)];
+ const unsigned int height = num_tiles_x * num_tiles_y;
+ const unsigned int depth = 16; // COMPMID-990
+
+ TensorShape output_shape{ input.tensor_shape() };
+ output_shape.set(0, width);
+ output_shape.set(1, height);
+ output_shape.set(2, depth);
+
+ return output_shape;
+}
} // namespace shape_calculator
} // namespace misc
} // namespace arm_compute