aboutsummaryrefslogtreecommitdiff
path: root/src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp
diff options
context:
space:
mode:
authorIsabella Gottardi <isabella.gottardi@arm.com>2018-01-26 12:32:45 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:46:07 +0000
commit6e464c37b5335e362ac3f988cc4b0beed5205ff4 (patch)
tree24f758be47f1dd439a4ab3f8f3631a1ed7ef4566 /src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp
parent3364c4ca658d44f449a8d3d6e9eee31d90254f15 (diff)
downloadComputeLibrary-6e464c37b5335e362ac3f988cc4b0beed5205ff4.tar.gz
COMPMID-828 - Add support for non square pool size - Part1
Change-Id: Ib8100e7c659c49694c746fa3f36ce20f44f6929f Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/117804 Reviewed-by: Michele DiGiorgio <michele.digiorgio@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp')
-rw-r--r--src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp b/src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp
index 6451db741d..64b94c0334 100644
--- a/src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp
+++ b/src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -62,12 +62,13 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, c
"Unsupported combination of parameters!");
const bool is_global_pooling = pool_info.is_global_pooling();
- const unsigned int pool_size = is_global_pooling ? input->tensor_shape().x() : pool_info.pool_size();
+ const unsigned int pool_size = is_global_pooling ? input->tensor_shape().x() : pool_info.pool_size().width;
ARM_COMPUTE_RETURN_ERROR_ON_MSG(is_global_pooling && (input->tensor_shape().x() != input->tensor_shape().y()),
"Global pooling is supported only with rectangular inputs!");
ARM_COMPUTE_RETURN_ERROR_ON_MSG(!is_global_pooling && ((pool_info.pad_stride_info().pad().first >= pool_size) || (pool_info.pad_stride_info().pad().second >= pool_size)),
"Invalid pool size and pool pad combination!");
+ ARM_COMPUTE_RETURN_ERROR_ON_MSG(pool_info.pool_size().width != pool_info.pool_size().height, "Invalid Pool size, width not equal to height!");
// Checks performed when output is configured
if(output->total_size() != 0)
@@ -97,7 +98,7 @@ std::tuple<Status, Window, GCPoolingConfig> validate_and_configure_window(ITenso
int pool_stride_y = 0;
unsigned int pooled_w = 0;
unsigned int pooled_h = 0;
- int pool_size = pool_info.pool_size();
+ int pool_size = pool_info.pool_size().width;
const PadStrideInfo pad_stride_info = pool_info.pad_stride_info();
std::tie(pool_pad_x, pool_pad_y) = pad_stride_info.pad();
std::tie(pool_stride_x, pool_stride_y) = pad_stride_info.stride();
@@ -229,7 +230,7 @@ void GCPoolingLayerKernel::configure(const IGCTensor *input, IGCTensor *output,
unsigned int pooled_w = 0;
unsigned int pooled_h = 0;
const PoolingType pool_type = pool_info.pool_type();
- int pool_size = pool_info.pool_size();
+ int pool_size = pool_info.pool_size().width;
const PadStrideInfo pad_stride_info = pool_info.pad_stride_info();
const bool exclude_padding = pool_info.exclude_padding();
std::tie(pool_pad_x, pool_pad_y) = pad_stride_info.pad();