aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdnan AlSinan <adnan.alsinan@arm.com>2022-05-04 11:31:45 +0100
committerAdnan AlSinan <adnan.alsinan@arm.com>2022-05-04 12:36:28 +0000
commitfacd9dd4c75feb886240a2b55cefe55ccf773f63 (patch)
treeb9ecbd92e594dcb030144335035729b4db839f1e
parent388866b18a76f77d2d43681c06e99ddee4d49968 (diff)
downloadComputeLibrary-facd9dd4c75feb886240a2b55cefe55ccf773f63.tar.gz
Add a missing validation check to CPU Pool3d
- Add a check for pooling region that is entirely outside input tensor. Signed-off-by: Adnan AlSinan <adnan.alsinan@arm.com> Change-Id: Ib6b4565b1cb64235e714fe065b4a95f96a5adbd9 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7497 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--src/cpu/kernels/CpuPool3dKernel.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cpu/kernels/CpuPool3dKernel.cpp b/src/cpu/kernels/CpuPool3dKernel.cpp
index 1305f7c5e8..4504f3f7c9 100644
--- a/src/cpu/kernels/CpuPool3dKernel.cpp
+++ b/src/cpu/kernels/CpuPool3dKernel.cpp
@@ -97,6 +97,8 @@ Status validate_arguments(const ITensorInfo *src, const ITensorInfo *dst, const
int output_height = 0;
int output_depth = 0;
+ ARM_COMPUTE_RETURN_ERROR_ON_MSG(is_pool_3d_region_entirely_outside_input(pool_info), "Pooling region that is entirely outside input tensor is unsupported");
+
std::tie(output_width, output_height, output_depth) = scaled_3d_dimensions_signed(src->tensor_shape()[idx_width], src->tensor_shape()[idx_height], src->tensor_shape()[idx_depth],
pool_size_x, pool_size_y, pool_size_z, pool_info);
ARM_COMPUTE_RETURN_ERROR_ON_MSG((output_width < 1 || output_height < 1 || output_depth < 1), "Calculated output dimension size is invalid");