aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;