aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLWinogradConvolutionLayer.cpp
diff options
context:
space:
mode:
authorGian Marco Iodice <gianmarco.iodice@arm.com>2018-06-13 14:05:54 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:53:57 +0000
commitf1c2bf0971dd1c996da149faf3dd669d566074c7 (patch)
tree802b3ce5198c3209d77fc6b603c209023fe45650 /src/runtime/CL/functions/CLWinogradConvolutionLayer.cpp
parent89a2b571cfc0ea87c26ba8b1ed1ab87d13244f0e (diff)
downloadComputeLibrary-f1c2bf0971dd1c996da149faf3dd669d566074c7.tar.gz
COMPMID-1201 - Implementing Winograd Convolution Layer 1x3 and 3x1 kernels on OpenCL
Change-Id: I39667bab49daa4da009694163274a59fd3574c73 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/137595 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Giorgio Arena <giorgio.arena@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLWinogradConvolutionLayer.cpp')
-rw-r--r--src/runtime/CL/functions/CLWinogradConvolutionLayer.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/runtime/CL/functions/CLWinogradConvolutionLayer.cpp b/src/runtime/CL/functions/CLWinogradConvolutionLayer.cpp
index 49753ad080..11714fac41 100644
--- a/src/runtime/CL/functions/CLWinogradConvolutionLayer.cpp
+++ b/src/runtime/CL/functions/CLWinogradConvolutionLayer.cpp
@@ -37,11 +37,27 @@ Size2D winograd_output_tile(const Size2D &input_dims, const Size2D &kernel_dims)
{
Size2D output_tile = Size2D{};
- if(kernel_dims == Size2D(3U, 3U))
+ const unsigned int kernel_max_dim = std::max(kernel_dims.width, kernel_dims.height);
+
+ // Check if the input spatial dimensions are smaller than 4
+ const bool is_input_lt4 = (input_dims.width <= 4 && input_dims.height <= 4);
+
+ if(kernel_max_dim == 3U)
{
- output_tile = (input_dims.width <= 4 && input_dims.height <= 4) ? Size2D(2U, 2U) : Size2D(4U, 4U);
+ if(kernel_dims == Size2D(3U, 3U))
+ {
+ output_tile = is_input_lt4 ? Size2D(2U, 2U) : Size2D(4U, 4U);
+ }
+ else if(kernel_dims == Size2D(3U, 1U))
+ {
+ output_tile = is_input_lt4 ? Size2D(2U, 1U) : Size2D(4U, 1U);
+ }
+ else
+ {
+ output_tile = is_input_lt4 ? Size2D(1U, 2U) : Size2D(1U, 4U);
+ }
}
- else if(kernel_dims == Size2D(5U, 5U))
+ else if(kernel_max_dim == 5U)
{
output_tile = Size2D(4U, 4U);
}