aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp
diff options
context:
space:
mode:
authorsteniu01 <steven.niu@arm.com>2017-08-09 16:26:22 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commitdb00668890e1aba956e02fa02e1383b54dfd1435 (patch)
treee20cc07d9bc9eb4bf613213007a2351f5d4eec60 /src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp
parentff6ab352f4f6715b7028a39d8722759d19d2524b (diff)
downloadComputeLibrary-db00668890e1aba956e02fa02e1383b54dfd1435.tar.gz
COMPMID-478 Implemnt CL direct convolution 5x5
Change-Id: I4b975aff310cda9964d8c5dcee182d5d5c82741b Reviewed-on: http://mpd-gerrit.cambridge.arm.com/83474 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp b/src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp
index c5fdb77a4a..1620d545c7 100644
--- a/src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp
+++ b/src/core/CL/kernels/CLDirectConvolutionLayerKernel.cpp
@@ -53,14 +53,14 @@ void CLDirectConvolutionLayerKernel::configure(const ICLTensor *input, const ICL
ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::QS8, DataType::QS16, DataType::F16, DataType::F32);
ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, weights);
ARM_COMPUTE_ERROR_ON_MSG(weights->info()->dimension(0) != weights->info()->dimension(1),
- "Only kernel sizes 1x1 and 3x3 are supported");
- ARM_COMPUTE_ERROR_ON_MSG(weights->info()->dimension(0) != 1 && weights->info()->dimension(0) != 3,
- "Only kernel sizes 1x1 and 3x3 are supported");
+ "Weights should have same width as length");
+ ARM_COMPUTE_ERROR_ON_MSG(weights->info()->dimension(0) != 1 && weights->info()->dimension(0) != 3 && weights->info()->dimension(0) != 5,
+ "Kernel sizes other than 1x1, 3x3 or 5x5 are not supported");
ARM_COMPUTE_ERROR_ON(weights->info()->dimension(2) != input->info()->dimension(2));
ARM_COMPUTE_ERROR_ON(weights->info()->dimension(0) != weights->info()->dimension(1));
ARM_COMPUTE_ERROR_ON(weights->info()->num_dimensions() > 4);
ARM_COMPUTE_ERROR_ON_MSG((weights->info()->dimension(0) == 1) && std::get<0>(conv_info.stride()) > 3, "Strides larger than 3 not supported for 1x1 convolution.");
- ARM_COMPUTE_ERROR_ON_MSG((weights->info()->dimension(0) == 3) && std::get<0>(conv_info.stride()) > 2, "Strides larger than 2 not supported for 3x3 convolution.");
+ ARM_COMPUTE_ERROR_ON_MSG((weights->info()->dimension(0) == 3 || weights->info()->dimension(0) == 5) && std::get<0>(conv_info.stride()) > 2, "Strides larger than 2 not supported for 3x3 convolution.");
if(biases != nullptr)
{
@@ -138,9 +138,9 @@ void CLDirectConvolutionLayerKernel::configure(const ICLTensor *input, const ICL
// Configure kernel window
Window win = calculate_max_window(*output->info());
- bool is_kernel3x3_stride2 = ((kernel_size == 3) && (_conv_stride_x == 2));
+ bool is_stride2 = ((kernel_size != 1) && (_conv_stride_x == 2));
- const unsigned int num_elems_read_per_iteration_x = 8 + 2 * (kernel_size / 2) + (is_kernel3x3_stride2 ? 7 : 0);
+ const unsigned int num_elems_read_per_iteration_x = 8 + 2 * (kernel_size / 2) + (is_stride2 ? 6 + kernel_size / 2 : 0);
const unsigned int num_elems_read_per_iteration_y = kernel_size;
const unsigned int num_elems_written_per_iteration_x = 8;
const unsigned int num_elems_written_per_iteration_y = 1;