aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Di Giorgio <michele.digiorgio@arm.com>2021-01-27 16:22:05 +0000
committerTeresaARM <teresa.charlinreyes@arm.com>2021-01-27 17:40:01 +0000
commitef28340ac76f46753ad901b5d00311791a7f0887 (patch)
tree29af0035852ad41e74dee246cbfefc3b0540d3d3
parent237be03ada644232b19005f44742b97efa5dbfc6 (diff)
downloadComputeLibrary-ef28340ac76f46753ad901b5d00311791a7f0887.tar.gz
Force early exit of threads when output_height=1 and channels=1 in assembly pooling
Resolves COMPMID-4156, COMPMID-4125 Change-Id: I408e51e9759448e6190490975ccab2c1bc07a813 Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4927 Reviewed-by: TeresaARM <teresa.charlinreyes@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--src/core/NEON/kernels/arm_conv/pooling/pooling_depthfirst_generic.hpp6
-rw-r--r--src/core/NEON/kernels/arm_conv/pooling/pooling_depthfirst_generic_quantized.hpp6
2 files changed, 12 insertions, 0 deletions
diff --git a/src/core/NEON/kernels/arm_conv/pooling/pooling_depthfirst_generic.hpp b/src/core/NEON/kernels/arm_conv/pooling/pooling_depthfirst_generic.hpp
index 3a15b28d92..fa06a0078b 100644
--- a/src/core/NEON/kernels/arm_conv/pooling/pooling_depthfirst_generic.hpp
+++ b/src/core/NEON/kernels/arm_conv/pooling/pooling_depthfirst_generic.hpp
@@ -159,6 +159,12 @@ class PoolingDepthfirstGeneric : public PoolingCommon<typename strategy::operand
end_out_height = output_height;
}
+ if(start_channel >= end_channel)
+ {
+ // Early exit in case of multiple threads parallelising on channels
+ return;
+ }
+
// Cast input and output pointers into the right types
const TInput *const inptr = static_cast<const TInput *>(_input) + start_channel;
TOutput *const outptr = static_cast<TOutput *>(_output) + start_channel;
diff --git a/src/core/NEON/kernels/arm_conv/pooling/pooling_depthfirst_generic_quantized.hpp b/src/core/NEON/kernels/arm_conv/pooling/pooling_depthfirst_generic_quantized.hpp
index 9516042eed..1f2891f814 100644
--- a/src/core/NEON/kernels/arm_conv/pooling/pooling_depthfirst_generic_quantized.hpp
+++ b/src/core/NEON/kernels/arm_conv/pooling/pooling_depthfirst_generic_quantized.hpp
@@ -160,6 +160,12 @@ class PoolingDepthfirstGenericQuantized : public PoolingCommon<typename strategy
end_out_height = output_height;
}
+ if(start_channel >= end_channel)
+ {
+ // Early exit in case of multiple threads parallelising on channels
+ return;
+ }
+
// Cast input and output pointers into the right types
const TInput *const inptr = static_cast<const TInput *>(_input) + start_channel;
TOutput *const outptr = static_cast<TOutput *>(_output) + start_channel;