From 16cdf89eec95986d1b386312ccf3b221f6a1bad4 Mon Sep 17 00:00:00 2001 From: Jaroslaw Rzepecki Date: Fri, 27 Oct 2017 13:15:03 +0100 Subject: IVGCVSW-657 : fix asymmetric padding for 3x3 depthwise conv Change-Id: Ied6b3c41d988b9ff6a93f938117dc29ad4c85e9f Reviewed-on: http://mpd-gerrit.cambridge.arm.com/93421 Reviewed-by: Georgios Pinitas Tested-by: Kaizen --- .../core/CL/kernels/CLDepthwiseConvolution3x3Kernel.h | 4 ++-- src/core/CL/kernels/CLDepthwiseConvolution3x3Kernel.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arm_compute/core/CL/kernels/CLDepthwiseConvolution3x3Kernel.h b/arm_compute/core/CL/kernels/CLDepthwiseConvolution3x3Kernel.h index b3d1eaf3af..4d4c288533 100644 --- a/arm_compute/core/CL/kernels/CLDepthwiseConvolution3x3Kernel.h +++ b/arm_compute/core/CL/kernels/CLDepthwiseConvolution3x3Kernel.h @@ -68,8 +68,8 @@ private: const ICLTensor *_biases; unsigned int _conv_stride_x; unsigned int _conv_stride_y; - unsigned int _conv_pad_x; - unsigned int _conv_pad_y; + unsigned int _conv_pad_left; + unsigned int _conv_pad_top; }; } // namespace arm_compute #endif /*__ARM_COMPUTE_CLDEPTHWISECONVOLUTIONKERNEL3x3_H__ */ diff --git a/src/core/CL/kernels/CLDepthwiseConvolution3x3Kernel.cpp b/src/core/CL/kernels/CLDepthwiseConvolution3x3Kernel.cpp index 2d0c416d0a..7b5dfd6e98 100644 --- a/src/core/CL/kernels/CLDepthwiseConvolution3x3Kernel.cpp +++ b/src/core/CL/kernels/CLDepthwiseConvolution3x3Kernel.cpp @@ -37,7 +37,7 @@ using namespace arm_compute; CLDepthwiseConvolution3x3Kernel::CLDepthwiseConvolution3x3Kernel() - : _border_size(0), _input(), _output(), _weights(), _biases(), _conv_stride_x(0), _conv_stride_y(0), _conv_pad_x(0), _conv_pad_y(0) + : _border_size(0), _input(), _output(), _weights(), _biases(), _conv_stride_x(0), _conv_stride_y(0), _conv_pad_left(0), _conv_pad_top(0) { } @@ -74,9 +74,9 @@ void CLDepthwiseConvolution3x3Kernel::configure(const ICLTensor *input, ICLTenso _biases = biases; _conv_stride_x = conv_info.stride().first; _conv_stride_y = conv_info.stride().second; - _conv_pad_x = conv_info.pad().first; - _conv_pad_y = conv_info.pad().second; - _border_size = BorderSize(_conv_pad_y, _conv_pad_x); + _conv_pad_left = conv_info.pad_left(); + _conv_pad_top = conv_info.pad_top(); + _border_size = BorderSize(_conv_pad_top, conv_info.pad_right(), conv_info.pad_bottom(), _conv_pad_left); // Set build options ARM_COMPUTE_ERROR_ON(_conv_stride_x < 1 || _conv_stride_x > 3); @@ -116,8 +116,8 @@ void CLDepthwiseConvolution3x3Kernel::run(const Window &window, cl::CommandQueue Window slice_out = window.first_slice_window_3D(); Window slice_weights = window.first_slice_window_3D(); - slice_in.adjust(Window::DimX, -_conv_pad_x, true); - slice_in.adjust(Window::DimY, -_conv_pad_y, true); + slice_in.adjust(Window::DimX, -_conv_pad_left, true); + slice_in.adjust(Window::DimY, -_conv_pad_top, true); slice_in.set_dimension_step(Window::DimX, window.x().step() * _conv_stride_x); slice_in.set_dimension_step(Window::DimY, window.y().step() * _conv_stride_y); slice_weights.set_dimension_step(Window::DimX, 0); -- cgit v1.2.1