Debian Codegraph @

src/x32-zerob/gen/x32-zerob-2c2s1r-gemm-scalar-float.c

raw
1 // Auto-generated file. Do not edit!
2 // Template: src/x32-packb/scalar.c.in
3 // Generator: tools/xngen
4 //
5 // Copyright 2023 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 #include <stddef.h>
12
13 #include "xnnpack/math.h"
14 #include "xnnpack/packb.h"
15 #include "xnnpack/unaligned.h"
16
17 void xnn_x32_zerob_gemm_ukernel_2c2s1r__scalar_float(
18 size_t groups,
19 size_t channels,
20 uint32_t* packed_weights,
21 size_t channel_tile_stride,
22 size_t channel_subtile_stride,
23 const struct xnn_x32_packb_params params[restrict XNN_MIN_ELEMENTS(1)])
24 {
25 assert(groups != 0);
26 assert(channels != 0);
27 assert(packed_weights != NULL);
28
29 float* w = (float*) packed_weights;
30 const float vzero = 0;
31 do {
32 // channel tile loop multiple of 2
33 size_t c = channels;
34 for (; c >= 2; c -= 2) {
35 unaligned_indexed_store_f32(w, 0, vzero);
36 unaligned_indexed_store_f32(w, 1, vzero);
37
38 w = (float*) ((uintptr_t) w + channel_tile_stride);
39 }
40
41
42 if XNN_UNLIKELY(c != 0) {
43 unaligned_indexed_store_f32(w, 0, vzero);
44 w = (float*) ((uintptr_t) w + channel_subtile_stride);
45 }
46 } while (--groups != 0);
47 }