aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLPoolingLayerKernel.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-07-03 17:51:34 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:15:39 +0100
commit1dad50ea7b662e7c07a0a06bbbd175fd1bcf9bfc (patch)
tree5a06252e752bb14176a5d31f9ca7e8df4806bff5 /src/core/CL/kernels/CLPoolingLayerKernel.cpp
parentb76346dd20f8d2be49cd796d6e0427fa1a55f612 (diff)
downloadComputeLibrary-1dad50ea7b662e7c07a0a06bbbd175fd1bcf9bfc.tar.gz
COMPMID-417: Auto initialization for PoolingLayer for NEON/CL.
Change-Id: I2c399c5fe30a9d68fb84742771e7ef10beadb071 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79569 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLPoolingLayerKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLPoolingLayerKernel.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/core/CL/kernels/CLPoolingLayerKernel.cpp b/src/core/CL/kernels/CLPoolingLayerKernel.cpp
index 15f26e3985..08f0d4a4e5 100644
--- a/src/core/CL/kernels/CLPoolingLayerKernel.cpp
+++ b/src/core/CL/kernels/CLPoolingLayerKernel.cpp
@@ -68,8 +68,7 @@ void CLPoolingLayerKernel::configure(const ICLTensor *input, ICLTensor *output,
ARM_COMPUTE_UNUSED(supported_pool_sizes);
ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::F16, DataType::F32);
- ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(output, 1, DataType::F16, DataType::F32);
- ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, output);
+ ARM_COMPUTE_ERROR_ON_NULLPTR(output);
ARM_COMPUTE_ERROR_ON(supported_pool_sizes.find(pool_size) == supported_pool_sizes.end());
ARM_COMPUTE_ERROR_ON(pool_pad_x >= pool_size || pool_pad_y >= pool_size);
@@ -79,8 +78,18 @@ void CLPoolingLayerKernel::configure(const ICLTensor *input, ICLTensor *output,
pool_size,
pool_size,
pool_info.pad_stride_info());
- ARM_COMPUTE_UNUSED(pooled_w);
- ARM_COMPUTE_UNUSED(pooled_h);
+
+ // Output auto initialization if not yet initialized
+ {
+ TensorShape output_shape{ input->info()->tensor_shape() };
+ output_shape.set(0, pooled_w);
+ output_shape.set(1, pooled_h);
+
+ auto_init_if_empty(*output->info(), output_shape, 1, input->info()->data_type(), input->info()->fixed_point_position());
+ }
+
+ ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, output);
+ ARM_COMPUTE_ERROR_ON_MISMATCHING_FIXED_POINT(input, output);
ARM_COMPUTE_ERROR_ON((output->info()->dimension(0) != pooled_w) || (output->info()->dimension(1) != pooled_h));
const int num_elements_read_per_iteration = (pool_size == 7) ? 8 : pool_size;