Debian Codegraph @

src/f32-vrelu/gen/f32-vrelu-scalar-u1.c

raw symbols SCIP
1 // Auto-generated file. Do not edit!
2 // Template: src/f32-vrelu/scalar.c.in
3 // Generator: tools/xngen
4 //
5 // Copyright 2020 Google LLC
6 //
7 // This source code is licensed under the BSD-style license found in the
8 // LICENSE file in the root directory of this source tree.
9
10 #include <assert.h>
11
12 #include "xnnpack/vunary.h"
13 #include "xnnpack/common.h"
14 #include "xnnpack/math.h"
15
16 void xnn_f32_vrelu_ukernel__scalar_u1(
17 size_t batch,
18 const float* input,
19 float* output,
20 const struct xnn_f32_relu_params params[restrict XNN_MIN_ELEMENTS(1)])
21 {
22 assert(batch != 0);
23 assert(batch % sizeof(float) == 0);
24 assert(input != NULL);
25 assert(output != NULL);
26
27 const uint32_t* i = (const uint32_t*) input;
28 uint32_t* o = (uint32_t*) output;
29
30 for (; batch >= sizeof(uint32_t); batch -= sizeof(uint32_t)) {
31 uint32_t vacc = *i++;
32 vacc = ((vacc >> 31) - 1) & vacc;
33 *o++ = vacc;
34 }
35 }