Home
last modified time | relevance | path

Searched refs:sum (Results 1 – 18 of 18) sorted by relevance

/cmsis-nn-3.6.0-3.5.0/Source/BasicMathFunctions/
Darm_elementwise_add_s8.c110 int32_t sum; in arm_elementwise_add_s8()
145 sum = input_1 + input_2; in arm_elementwise_add_s8()
146 sum = arm_nn_requantize(sum, out_mult, out_shift); in arm_elementwise_add_s8()
147 sum += out_offset; in arm_elementwise_add_s8()
148 sum = MAX(sum, out_activation_min); in arm_elementwise_add_s8()
149 sum = MIN(sum, out_activation_max); in arm_elementwise_add_s8()
150 r1 = (int8_t)sum; in arm_elementwise_add_s8()
159 sum = input_1 + input_2; in arm_elementwise_add_s8()
160 sum = arm_nn_requantize(sum, out_mult, out_shift); in arm_elementwise_add_s8()
161 sum += out_offset; in arm_elementwise_add_s8()
[all …]
Darm_elementwise_add_s16.c109 int32_t sum; in arm_elementwise_add_s16() local
122 sum = input_1 + input_2; in arm_elementwise_add_s16()
123 sum = arm_nn_requantize(sum, out_mult, out_shift); in arm_elementwise_add_s16()
124 sum = MAX(sum, out_activation_min); in arm_elementwise_add_s16()
125 sum = MIN(sum, out_activation_max); in arm_elementwise_add_s16()
126 sum_1 = (int16_t)sum; in arm_elementwise_add_s16()
132 sum = input_1 + input_2; in arm_elementwise_add_s16()
133 sum = arm_nn_requantize(sum, out_mult, out_shift); in arm_elementwise_add_s16()
134 sum = MAX(sum, out_activation_min); in arm_elementwise_add_s16()
135 sum = MIN(sum, out_activation_max); in arm_elementwise_add_s16()
[all …]
/cmsis-nn-3.6.0-3.5.0/Source/ConvolutionFunctions/
Darm_convolve_fast_s16.c156 int32_t sum = 0; in arm_convolve_fast_s16() local
172 sum = SMLAD(ker_a1, ip_b1, sum); in arm_convolve_fast_s16()
174 sum = SMLAD(ker_a2, ip_b2, sum); in arm_convolve_fast_s16()
184 sum += ker_a1 * ip_b1; in arm_convolve_fast_s16()
190 int64_t acc_64 = sum + bias_data[i]; in arm_convolve_fast_s16()
191 sum = arm_nn_requantize_s64(acc_64, reduced_multiplier, output_shift[i]); in arm_convolve_fast_s16()
195 sum = arm_nn_requantize(sum, output_mult[i], output_shift[i]); in arm_convolve_fast_s16()
197 sum = MAX(sum, out_activation_min); in arm_convolve_fast_s16()
198 sum = MIN(sum, out_activation_max); in arm_convolve_fast_s16()
199 *out++ = (int16_t)sum; in arm_convolve_fast_s16()
Darm_convolve_s8.c229 int32_t sum = 0; in arm_convolve_s8()
232 sum = bias_data[i]; in arm_convolve_s8()
248 sum = SMLAD(ker_a1, ip_b1, sum); in arm_convolve_s8()
250 sum = SMLAD(ker_a2, ip_b2, sum); in arm_convolve_s8()
263 sum += ker_a1 * ip_b1; in arm_convolve_s8()
267 sum = arm_nn_requantize(sum, output_mult[i], output_shift[i]); in arm_convolve_s8()
268 sum += out_offset; in arm_convolve_s8()
269 sum = MAX(sum, out_activation_min); in arm_convolve_s8()
270 sum = MIN(sum, out_activation_max); in arm_convolve_s8()
271 *out++ = (int8_t)sum; in arm_convolve_s8()
Darm_depthwise_conv_s8_opt.c276 int32_t sum = 0; in arm_depthwise_conv_s8_opt() local
282 sum = *bias++; in arm_depthwise_conv_s8_opt()
314 sum = SMLAD(op_c, op_b, sum); in arm_depthwise_conv_s8_opt()
338 sum += row_pos[0] * col_pos[0]; in arm_depthwise_conv_s8_opt()
348 sum = arm_nn_requantize(sum, *output_mult++, *output_shift++); in arm_depthwise_conv_s8_opt()
349 sum += output_offset; in arm_depthwise_conv_s8_opt()
350 sum = MAX(sum, output_activation_min); in arm_depthwise_conv_s8_opt()
351 sum = MIN(sum, output_activation_max); in arm_depthwise_conv_s8_opt()
352 *output++ = (int8_t)sum; in arm_depthwise_conv_s8_opt()
379 int32_t sum = 0; in arm_depthwise_conv_s8_opt() local
[all …]
Darm_depthwise_conv_fast_s16.c400 int32_t sum = 0; in arm_depthwise_conv_fast_s16() local
406 sum += row_pos[i * input_ch] * col_pos[i * input_ch]; in arm_depthwise_conv_fast_s16()
408 int64_t acc = sum; in arm_depthwise_conv_fast_s16()
/cmsis-nn-3.6.0-3.5.0/Source/PoolingFunctions/
Darm_avgpool_s16.c47 int32_t sum = buffer[i] > 0 ? (buffer[i] + half_count) : (buffer[i] - half_count); in scale_q31_to_q15_and_clamp() local
48 sum = sum / count; in scale_q31_to_q15_and_clamp()
49 sum = MAX(sum, act_min); in scale_q31_to_q15_and_clamp()
50 sum = MIN(sum, act_max); in scale_q31_to_q15_and_clamp()
52 target[i] = (int16_t)sum; in scale_q31_to_q15_and_clamp()
263 int sum = 0; in arm_avgpool_s16() local
270sum += src[i_ch_in + ch_src * (k_x + base_idx_x + (k_y + base_idx_y) * input_x)]; in arm_avgpool_s16()
281 sum = sum > 0 ? (sum + count / 2) / count : (sum - count / 2) / count; in arm_avgpool_s16()
282 sum = MAX(sum, act_min); in arm_avgpool_s16()
283 sum = MIN(sum, act_max); in arm_avgpool_s16()
[all …]
Darm_avgpool_s8.c46 int32_t sum = buffer[i] > 0 ? (buffer[i] + half_count) : (buffer[i] - half_count); in scale_q31_to_q7_and_clamp() local
47 sum = sum / count; in scale_q31_to_q7_and_clamp()
48 sum = MAX(sum, act_min); in scale_q31_to_q7_and_clamp()
49 sum = MIN(sum, act_max); in scale_q31_to_q7_and_clamp()
51 target[i] = (int8_t)sum; in scale_q31_to_q7_and_clamp()
314 int sum = 0; in arm_avgpool_s8() local
322 sum += src[i_ch_in + ch_src * (k_x + k_y * input_x)]; in arm_avgpool_s8()
334 sum = sum > 0 ? (sum + count / 2) / count : (sum - count / 2) / count; in arm_avgpool_s8()
335 sum = MAX(sum, act_min); in arm_avgpool_s8()
336 sum = MIN(sum, act_max); in arm_avgpool_s8()
[all …]
/cmsis-nn-3.6.0-3.5.0/Source/SVDFunctions/
Darm_svdf_s8.c145 int32_t sum = 0; in arm_svdf_s8() local
157 sum = SMLAD(r1_1, r2_1, sum); in arm_svdf_s8()
158 sum = SMLAD(r1_2, r2_2, sum); in arm_svdf_s8()
164 sum += *v1 * *v2; in arm_svdf_s8()
171 sum += *v1 * *v2; in arm_svdf_s8()
177 *ptr_a = sum; in arm_svdf_s8()
208 int32_t sum = bias_data[i]; in arm_svdf_s8() local
211 sum += *ptr_a; in arm_svdf_s8()
214 output_data_temp[i] = sum; in arm_svdf_s8()
228 int32_t sum = 0; in arm_svdf_s8() local
[all …]
Darm_svdf_state_s16_s8.c143 int32_t sum = 0; in arm_svdf_state_s16_s8() local
154 sum = SMLAD(r1, r2, sum); in arm_svdf_state_s16_s8()
160 sum += *v1 * *v2; in arm_svdf_state_s16_s8()
167 sum += *v1 * *v2; in arm_svdf_state_s16_s8()
173 *ptr_a = sum; in arm_svdf_state_s16_s8()
204 int32_t sum = bias_data[i]; in arm_svdf_state_s16_s8() local
207 sum += *ptr_a; in arm_svdf_state_s16_s8()
210 output_data_temp[i] = sum; in arm_svdf_state_s16_s8()
224 int32_t sum = 0; in arm_svdf_state_s16_s8() local
227 sum += *ptr_a; in arm_svdf_state_s16_s8()
[all …]
/cmsis-nn-3.6.0-3.5.0/Source/SoftmaxFunctions/
Darm_softmax_u8.c68 int32_t sum = 0; in arm_softmax_u8() local
75 sum += DIV_POW2(EXP_ON_NEG(MUL_SAT(diff * mask, mult)), ACCUM_BITS); in arm_softmax_u8()
79 const int32_t headroom = CLZ((uint32_t)sum); in arm_softmax_u8()
81 const int32_t shifted_scale = ONE_OVER1((sum << headroom) - (1 << 31)); in arm_softmax_u8()
Darm_nn_softmax_common_s8.c81 int32_t sum = 0; in arm_nn_softmax_common_s8() local
88 sum += DIV_POW2(EXP_ON_NEG(MUL_SAT(diff * mask, mult)), ACCUM_BITS); in arm_nn_softmax_common_s8()
92 const int32_t headroom = CLZ(sum); in arm_nn_softmax_common_s8()
93 const int32_t shifted_scale = ONE_OVER1((sum > 0 ? sum << headroom : 0) - (1 << 31)); in arm_nn_softmax_common_s8()
Darm_softmax_s16.c65 int32_t sum = 0; in arm_softmax_s16() local
84 sum += cached_exp_results[col]; in arm_softmax_s16()
87 const int32_t headroom = CLZ(sum); in arm_softmax_s16()
90 const int32_t shifted_sum = (((sum) << (headroom - 1)) + (1 << 13)) >> 14; in arm_softmax_s16()
Darm_softmax_s8.c117 int32_t sum = 0; in arm_softmax_s8() local
133 sum += vaddvq_s32(res); in arm_softmax_s8()
146 sum += DIV_POW2(EXP_ON_NEG(MUL_SAT(diff * mask, mult)), ACCUM_BITS); in arm_softmax_s8()
150 const int32_t headroom = CLZ((uint32_t)sum); in arm_softmax_s8()
152 const int32_t shifted_scale = ONE_OVER1((sum > 0 ? sum << headroom : 0) - (1 << 31)); in arm_softmax_s8()
/cmsis-nn-3.6.0-3.5.0/Source/NNSupportFunctions/
Darm_nn_mat_mul_core_4x_s8.c101 [sum] "+Te"(sum_tmp), in arm_nn_mat_mul_core_4x_s8()
Darm_nn_mat_mul_core_1x_s8.c91 … : [col] "+r"(col_base), [sum] "+Te"(sum_tmp), [row0] "+r"(row_base), [out0] "+Te"(acc_n0) in arm_nn_mat_mul_core_1x_s8()
Darm_nn_mat_mult_nt_t_s8.c117 [sum] "=Te"(sum_tmp), in arm_nn_mat_mult_nt_t_s8()
183 … : [col] "+r"(col_base), [sum] "=Te"(sum_tmp), [row0] "+r"(lhs_vec), [out0] "=Te"(acc_n0) in arm_nn_mat_mult_nt_t_s8()
/cmsis-nn-3.6.0-3.5.0/Include/
Darm_nnsupportfunctions.h1121 const int64_t sum = (int64_t)val + (int64_t)NN_Q31_MAX; in arm_nn_one_over_one_plus_x_for_x_in_0_1() local
1122 const int32_t half_denominator = (int32_t)((sum + (sum >= 0 ? 1 : -1)) / 2L); in arm_nn_one_over_one_plus_x_for_x_in_0_1()