aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2021-12-13 17:42:52 +0000
committerGiorgio Arena <giorgio.arena@arm.com>2021-12-17 11:56:54 +0000
commitf33996223eae1e3daa662325e8ac4d9a2ee08cac (patch)
treecb1f1212c99126b0414e288bba41ec8b75148c44
parent40a245f943330219e59adaf9c0d23139d674a5b5 (diff)
downloadComputeLibrary-f33996223eae1e3daa662325e8ac4d9a2ee08cac.tar.gz
Redirect Pool2d unsupported cases to unoptimized path
Unsupported case: Any of the convolution padding > pool size Resolve COMPMID-4999 Signed-off-by: Giorgio Arena <giorgio.arena@arm.com> Change-Id: I4279f3f14d865e0faf53e04847b52ef328970cf2 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6817 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
-rw-r--r--src/cpu/kernels/internal/CpuPool2dAssemblyWrapperKernel.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cpu/kernels/internal/CpuPool2dAssemblyWrapperKernel.cpp b/src/cpu/kernels/internal/CpuPool2dAssemblyWrapperKernel.cpp
index 78ac134604..8610bc7f43 100644
--- a/src/cpu/kernels/internal/CpuPool2dAssemblyWrapperKernel.cpp
+++ b/src/cpu/kernels/internal/CpuPool2dAssemblyWrapperKernel.cpp
@@ -104,6 +104,11 @@ Status CpuPool2dAssemblyWrapperKernel::validate(const ITensorInfo *src, const IT
ARM_COMPUTE_RETURN_ERROR_ON_MSG((info.pool_type != PoolingType::AVG) && (info.pool_type != PoolingType::MAX),
"Only AVG and MAX pooling are supported by assembly kernels");
+ const auto ps = info.pad_stride_info;
+ const auto max_padding = std::max({ ps.pad_left(), ps.pad_right(), ps.pad_top(), ps.pad_bottom() });
+ const auto min_pool_sz = std::min(info.pool_size.x(), info.pool_size.y());
+ ARM_COMPUTE_RETURN_ERROR_ON_MSG(max_padding > min_pool_sz, "Convolution padding greater than pool size is unsupported by assembly kernels");
+
if(dst->total_size() > 0)
{
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(src, dst);
@@ -278,12 +283,12 @@ void CpuPool2dAssemblyWrapperKernel::create_arm_pooling_requant(const ITensorInf
size_t CpuPool2dAssemblyWrapperKernel::get_mws(const CPUInfo &platform, size_t thread_count) const
{
ARM_COMPUTE_UNUSED(thread_count);
- // Tuning results that gave optimized results in performance investigation
- if (platform.get_cpu_model() == CPUModel::A73 )
+ // Tuning results that gave optimized results in performance investigation
+ if(platform.get_cpu_model() == CPUModel::A73)
{
return 10240;
}
- else
+ else
{
return 9216;
}