summaryrefslogtreecommitdiff
path: root/NN/Source/PoolingFunctions/arm_pool_q7_HWC.c
diff options
context:
space:
mode:
Diffstat (limited to 'NN/Source/PoolingFunctions/arm_pool_q7_HWC.c')
-rw-r--r--NN/Source/PoolingFunctions/arm_pool_q7_HWC.c16
1 files changed, 14 insertions, 2 deletions
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)