blob: d7013321c255519f0475e4e8ab60eb04d662a728 [file] [log] [blame]
Frank Barchard674778d2020-08-08 10:17:25 -07001// Auto-generated file. Do not edit!
2// Template: src/f32-vbinary/vop-scalar.c.in
3// Generator: tools/xngen
4//
5// Copyright 2019 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/common.h>
13#include <xnnpack/math.h>
14#include <xnnpack/vbinary.h>
15
16
17void xnn_f32_vadd_relu_ukernel__scalar_x1(
18 size_t n,
19 const float* a,
20 const float* b,
21 float* y,
22 const union xnn_f32_relu_params params[restrict XNN_MIN_ELEMENTS(1)])
23{
24 assert(n != 0);
25 assert(n % sizeof(float) == 0);
26 assert(a != NULL);
27 assert(b != NULL);
28 assert(y != NULL);
29
30
31 for (; n >= sizeof(float); n -= sizeof(float)) {
32 const float va = *a++;
33 const float vb = *b++;
34 float vy = va + vb;
35 vy = math_max_f32(vy, 0.0f);
36 *y++ = vy;
37 }
38}