From 96d6da4e252b06dcfdc041e7df23e86161c33007 Mon Sep 17 00:00:00 2001 From: rihab kouki Date: Tue, 28 Jul 2020 11:24:49 +0100 Subject: Official ARM version: v5.6.0 --- NN/Source/PoolingFunctions/arm_pool_q7_HWC.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'NN/Source/PoolingFunctions') diff --git a/NN/Source/PoolingFunctions/arm_pool_q7_HWC.c b/NN/Source/PoolingFunctions/arm_pool_q7_HWC.c index b451f5e..2956774 100644 --- a/NN/Source/PoolingFunctions/arm_pool_q7_HWC.c +++ b/NN/Source/PoolingFunctions/arm_pool_q7_HWC.c @@ -50,12 +50,12 @@ static void buffer_scale_back_q15_to_q7(q15_t * buffer, q7_t * target, uint16_t } static void compare_and_replace_if_larger_q7(q7_t * base, // base data - q7_t * target, // compare target + const q7_t * target, // compare target const uint16_t length // data length ) { q7_t *pIn = base; - q7_t *pCom = target; + const q7_t *pCom = target; union arm_nnword in; union arm_nnword com; uint16_t cnt = length >> 2; @@ -79,6 +79,18 @@ static void compare_and_replace_if_larger_q7(q7_t * base, // base data cnt--; } + + cnt = length & 0x3; + while (cnt > 0u) + { + if (*pCom > *pIn) + { + *pIn = *pCom; + } + pIn++; + pCom++; + cnt--; + } } static void accumulate_q7_to_q15(q15_t * base, q7_t * target, const uint16_t length) -- cgit