diff options
author | rihab kouki <rihab.kouki@st.com> | 2020-07-28 11:24:49 +0100 |
---|---|---|
committer | rihab kouki <rihab.kouki@st.com> | 2020-07-28 11:24:49 +0100 |
commit | 96d6da4e252b06dcfdc041e7df23e86161c33007 (patch) | |
tree | a262f59bb1db7ec7819acae435f5049cbe5e2354 /NN/Source/PoolingFunctions | |
parent | 9f95ff5b6ba01db09552b84a0ab79607060a2666 (diff) | |
download | st-cmsis-core-lowfat-96d6da4e252b06dcfdc041e7df23e86161c33007.tar.gz st-cmsis-core-lowfat-96d6da4e252b06dcfdc041e7df23e86161c33007.tar.bz2 st-cmsis-core-lowfat-96d6da4e252b06dcfdc041e7df23e86161c33007.zip |
Diffstat (limited to 'NN/Source/PoolingFunctions')
-rw-r--r-- | NN/Source/PoolingFunctions/arm_pool_q7_HWC.c | 16 |
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) |