From 35b1ef182c497439056b703b4607e29178234545 Mon Sep 17 00:00:00 2001 From: Xintong Han Date: Mon, 28 Mar 2022 13:23:01 +0800 Subject: [PATCH] Fix bug in MNNSigmoidLowp When dataSize is not a multiple of 4, the calculation is wrong as it does not move the dst address after the for loop. --- source/backend/cpu/compute/CommonOptFunction.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/backend/cpu/compute/CommonOptFunction.cpp b/source/backend/cpu/compute/CommonOptFunction.cpp index 485b0c57..1fc87b81 100644 --- a/source/backend/cpu/compute/CommonOptFunction.cpp +++ b/source/backend/cpu/compute/CommonOptFunction.cpp @@ -2417,6 +2417,7 @@ void MNNSigmoidLowp(float* dst, const float* src, size_t dataSize) { } out = vrecpeq_f32(vaddq_f32(value,out)); vst1q_f32(dst, out); + dst += 4; dataSize = dataSize - 4 * dataC4; } #endif