Debian Codegraph @

src/qu8-rsum/gen/qu8-rsum-scalar-u2.c

raw
1 // Auto-generated file. Do not edit!
2 // Template: src/qu8-rsum/scalar.c.in
3 // Generator: tools/xngen
4 //
5 // This source code is licensed under the BSD-style license found in the
6 // LICENSE file in the root directory of this source tree.
7
8 #include <assert.h>
9
10 #include "xnnpack/common.h"
11 #include "xnnpack/math.h"
12 #include "xnnpack/reduce.h"
13
14
15 void xnn_qu8_rsum_ukernel__scalar_u2(
16 size_t batch,
17 const uint8_t* restrict input,
18 uint32_t* restrict output,
19 const struct xnn_qs8_rsum_params params[restrict XNN_MIN_ELEMENTS(1)])
20 {
21 assert(batch != 0);
22 assert(input != NULL);
23 assert(output != NULL);
24 assert(params != NULL);
25
26 uint32_t vacc0 = 0;
27 for (; batch >= 2; batch -= 2) {
28 const uint32_t vt0 = (uint32_t) input[0];
29 const uint32_t vt1 = (uint32_t) input[1];
30 input += 2;
31
32 vacc0 += vt0;
33 vacc0 += vt1;
34 }
35
36 if XNN_UNLIKELY(batch != 0) {
37 const uint32_t vt = (uint32_t) *input;
38 vacc0 += vt;
39 }
40
41 *output += vacc0;
42 }