diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2018-08-15 16:53:27 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:54:54 +0000 |
commit | d30714a9702140408cb0e313c07b278536bb0cf9 (patch) | |
tree | b345c505400d80ed41feaac231e7293bd12e2d02 /src/runtime | |
parent | 1b65807d4d94ad67cd7490d7a002fe418efdadf6 (diff) | |
download | ComputeLibrary-d30714a9702140408cb0e313c07b278536bb0cf9.tar.gz |
COMPMID-1188 - Fix CLWinogradConvolutionLayer for NHWC
Change-Id: Ib4abe0388f218276e79f7c4405827e61722f0ef8
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/144240
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime')
-rw-r--r-- | src/runtime/CL/functions/CLWinogradConvolutionLayer.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/runtime/CL/functions/CLWinogradConvolutionLayer.cpp b/src/runtime/CL/functions/CLWinogradConvolutionLayer.cpp index f9ea91ddc4..a70389ab6c 100644 --- a/src/runtime/CL/functions/CLWinogradConvolutionLayer.cpp +++ b/src/runtime/CL/functions/CLWinogradConvolutionLayer.cpp @@ -33,28 +33,28 @@ using namespace arm_compute; namespace { -Size2D winograd_output_tile(const Size2D &input_dims, const Size2D &kernel_dims) +Size2D winograd_output_tile(const Size2D &input_dims, const Size2D &kernel_dims, DataLayout data_layout) { Size2D output_tile = Size2D{}; 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); + const bool is_input_lt4_nchw = (input_dims.width <= 4 && input_dims.height <= 4) && (data_layout == DataLayout::NCHW); if(kernel_max_dim == 3U) { if(kernel_dims == Size2D(3U, 3U)) { - output_tile = is_input_lt4 ? Size2D(2U, 2U) : Size2D(4U, 4U); + output_tile = is_input_lt4_nchw ? Size2D(2U, 2U) : Size2D(4U, 4U); } else if(kernel_dims == Size2D(3U, 1U)) { - output_tile = is_input_lt4 ? Size2D(2U, 1U) : Size2D(4U, 1U); + output_tile = is_input_lt4_nchw ? Size2D(2U, 1U) : Size2D(4U, 1U); } else { - output_tile = is_input_lt4 ? Size2D(1U, 2U) : Size2D(1U, 4U); + output_tile = is_input_lt4_nchw ? Size2D(1U, 2U) : Size2D(1U, 4U); } } else if(kernel_max_dim == 5U) @@ -99,7 +99,7 @@ void CLWinogradConvolutionLayer::configure(ICLTensor *input, const ICLTensor *we // Input shape, kernel size and output tile const Size2D input_dims = Size2D(input->info()->tensor_shape()[idx_width], input->info()->tensor_shape()[idx_height]); const Size2D kernel_size = Size2D(weights->info()->tensor_shape()[idx_width], weights->info()->tensor_shape()[idx_height]); - const Size2D output_tile = winograd_output_tile(input_dims, kernel_size); + const Size2D output_tile = winograd_output_tile(input_dims, kernel_size, input->info()->data_layout()); // Check if the Winograd configuration requires fast math if(!enable_fast_math) @@ -156,7 +156,7 @@ Status CLWinogradConvolutionLayer::validate(const ITensorInfo *input, const ITen // Input shape, kernel size and output tile const Size2D input_dims = Size2D(input->tensor_shape()[idx_width], input->tensor_shape()[idx_height]); const Size2D kernel_size = Size2D(weights->tensor_shape()[idx_width], weights->tensor_shape()[idx_height]); - const Size2D output_tile = winograd_output_tile(input_dims, kernel_size); + const Size2D output_tile = winograd_output_tile(input_dims, kernel_size, input->data_layout()); // Check if the Winograd configuration requires fast math if(!enable_fast_math) |