COMPMID-1451: Perform two steps in calculating sqrt in NEPoolingLayer
Increases the steps for calculating invsqrt used in L2 pool by 1 to increase accuracy.
Change-Id: Ib938a963809b07c30d47ec0675abae75bc086986
diff --git a/src/core/NEON/kernels/NEPoolingLayerKernel.cpp b/src/core/NEON/kernels/NEPoolingLayerKernel.cpp
index fdd3410..f5d5281 100644
--- a/src/core/NEON/kernels/NEPoolingLayerKernel.cpp
+++ b/src/core/NEON/kernels/NEPoolingLayerKernel.cpp
@@ -1828,8 +1828,7 @@
// Calculate square-root in case of l2 pooling
if(pooling_type == PoolingType::L2)
{
- float32x4_t sqrt_reciprocal = vrsqrteq_f32(vres);
- vres = vmulq_f32(vres, vmulq_f32(vrsqrtsq_f32(vmulq_f32(vres, sqrt_reciprocal), sqrt_reciprocal), sqrt_reciprocal));
+ vres = vmulq_f32(vres, vinvsqrtq_f32(vres));
}
// Store result