aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-02-19 13:58:22 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:47:40 +0000
commit15997879873b374ea297197fc4aafb15e38b938b (patch)
tree1822578068bd63965865b3898e8d9a1d280c7274 /src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp
parent933fe86bdc0603c5350fa131df72549933632233 (diff)
downloadComputeLibrary-15997879873b374ea297197fc4aafb15e38b938b.tar.gz
COMPMID-934: Asymmetric padding support.
Change-Id: Ibe7a679e4c053a088b8c893e495c97cb24bf7272 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/121298 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp b/src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp
index 4b141f7ecd..ac3c9ac4a6 100644
--- a/src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp
+++ b/src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -126,10 +126,10 @@ std::pair<Status, Window> validate_and_configure_window(ITensorInfo *input, ITen
unsigned int conv_stride_x = std::get<0>(conv_info.stride());
unsigned int conv_stride_y = std::get<1>(conv_info.stride());
- unsigned int conv_pad_left = std::max(conv_info.pad_left(), kernel_size / 2);
- unsigned int conv_pad_top = std::max(conv_info.pad_top(), kernel_size / 2);
- unsigned int conv_pad_right = std::max(conv_info.pad_right(), kernel_size / 2);
- unsigned int conv_pad_bottom = std::max(conv_info.pad_bottom(), kernel_size / 2);
+ unsigned int conv_pad_left = conv_info.pad_left();
+ unsigned int conv_pad_top = conv_info.pad_top();
+ unsigned int conv_pad_right = conv_info.pad_right();
+ unsigned int conv_pad_bottom = conv_info.pad_bottom();
unsigned int num_elems_read_per_iteration_x = 0;
unsigned int num_elems_read_per_iteration_y = 0;
@@ -302,18 +302,13 @@ void CLDirectConvolutionLayerKernel::configure(const ICLTensor *input, const ICL
_conv_stride_x = std::get<0>(conv_info.stride());
_conv_stride_y = std::get<1>(conv_info.stride());
+ _border_size = BorderSize(conv_info.pad_top(), conv_info.pad_right(), conv_info.pad_bottom(), conv_info.pad_left());
_input = input;
_weights = weights;
_output = output;
_biases = biases;
- int conv_pad_left = std::min(conv_info.pad_left(), kernel_size / 2);
- int conv_pad_top = std::min(conv_info.pad_top(), kernel_size / 2);
- int conv_pad_right = std::min(conv_info.pad_right(), kernel_size / 2);
- int conv_pad_bottom = std::min(conv_info.pad_bottom(), kernel_size / 2);
- _border_size = BorderSize(conv_pad_top, conv_pad_right, conv_pad_bottom, conv_pad_left);
-
const GPUTarget gpu_target = get_arch_from_target(get_target());
std::stringstream kernel_name;
@@ -450,13 +445,13 @@ void CLDirectConvolutionLayerKernel::configure(const ICLTensor *input, const ICL
_config_id += "_";
_config_id += support::cpp11::to_string(kernel_size);
_config_id += "_";
- _config_id += support::cpp11::to_string(conv_pad_left);
+ _config_id += support::cpp11::to_string(border_size().left);
_config_id += "_";
- _config_id += support::cpp11::to_string(conv_pad_top);
+ _config_id += support::cpp11::to_string(border_size().top);
_config_id += "_";
- _config_id += support::cpp11::to_string(conv_pad_right);
+ _config_id += support::cpp11::to_string(border_size().right);
_config_id += "_";
- _config_id += support::cpp11::to_string(conv_pad_bottom);
+ _config_id += support::cpp11::to_string(border_size().bottom);
_config_id += "_";
_config_id += support::cpp11::to_string(_conv_stride_x);
_config_id += "_";