1 // Auto-generated file. Do not edit!
2 // Template: src/f32-dwconv/up-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/dwconv.h>
13 #include <xnnpack/math.h>
14
15
xnn_f32_dwconv_ukernel_up1x25__wasm_acc2(size_t channels,size_t output_width,const float ** input,const float * weights,float * output,size_t input_stride,size_t output_increment,size_t input_offset,const float * zero,const union xnn_f32_default_params params[restrict XNN_MIN_ELEMENTS (1)])16 void xnn_f32_dwconv_ukernel_up1x25__wasm_acc2(
17 size_t channels,
18 size_t output_width,
19 const float** input,
20 const float* weights,
21 float* output,
22 size_t input_stride,
23 size_t output_increment,
24 size_t input_offset,
25 const float* zero,
26 const union xnn_f32_default_params params[restrict XNN_MIN_ELEMENTS(1)])
27 {
28 assert(channels != 0);
29 assert(output_width != 0);
30
31 do {
32 const float* i0 = input[0];
33 assert(i0 != NULL);
34 if XNN_UNPREDICTABLE(i0 != zero) {
35 i0 = (const float*) ((uintptr_t) i0 + input_offset);
36 }
37 const float* i1 = input[1];
38 assert(i1 != NULL);
39 if XNN_UNPREDICTABLE(i1 != zero) {
40 i1 = (const float*) ((uintptr_t) i1 + input_offset);
41 }
42 const float* i2 = input[2];
43 assert(i2 != NULL);
44 if XNN_UNPREDICTABLE(i2 != zero) {
45 i2 = (const float*) ((uintptr_t) i2 + input_offset);
46 }
47 const float* i3 = input[3];
48 assert(i3 != NULL);
49 if XNN_UNPREDICTABLE(i3 != zero) {
50 i3 = (const float*) ((uintptr_t) i3 + input_offset);
51 }
52 const float* i4 = input[4];
53 assert(i4 != NULL);
54 if XNN_UNPREDICTABLE(i4 != zero) {
55 i4 = (const float*) ((uintptr_t) i4 + input_offset);
56 }
57 const float* i5 = input[5];
58 assert(i5 != NULL);
59 if XNN_UNPREDICTABLE(i5 != zero) {
60 i5 = (const float*) ((uintptr_t) i5 + input_offset);
61 }
62 const float* i6 = input[6];
63 assert(i6 != NULL);
64 if XNN_UNPREDICTABLE(i6 != zero) {
65 i6 = (const float*) ((uintptr_t) i6 + input_offset);
66 }
67 const float* i7 = input[7];
68 assert(i7 != NULL);
69 if XNN_UNPREDICTABLE(i7 != zero) {
70 i7 = (const float*) ((uintptr_t) i7 + input_offset);
71 }
72 const float* i8 = input[8];
73 assert(i8 != NULL);
74 if XNN_UNPREDICTABLE(i8 != zero) {
75 i8 = (const float*) ((uintptr_t) i8 + input_offset);
76 }
77 const float* i9 = input[9];
78 assert(i9 != NULL);
79 if XNN_UNPREDICTABLE(i9 != zero) {
80 i9 = (const float*) ((uintptr_t) i9 + input_offset);
81 }
82 const float* i10 = input[10];
83 assert(i10 != NULL);
84 if XNN_UNPREDICTABLE(i10 != zero) {
85 i10 = (const float*) ((uintptr_t) i10 + input_offset);
86 }
87 const float* i11 = input[11];
88 assert(i11 != NULL);
89 if XNN_UNPREDICTABLE(i11 != zero) {
90 i11 = (const float*) ((uintptr_t) i11 + input_offset);
91 }
92 const float* i12 = input[12];
93 assert(i12 != NULL);
94 if XNN_UNPREDICTABLE(i12 != zero) {
95 i12 = (const float*) ((uintptr_t) i12 + input_offset);
96 }
97 const float* i13 = input[13];
98 assert(i13 != NULL);
99 if XNN_UNPREDICTABLE(i13 != zero) {
100 i13 = (const float*) ((uintptr_t) i13 + input_offset);
101 }
102 const float* i14 = input[14];
103 assert(i14 != NULL);
104 if XNN_UNPREDICTABLE(i14 != zero) {
105 i14 = (const float*) ((uintptr_t) i14 + input_offset);
106 }
107 const float* i15 = input[15];
108 assert(i15 != NULL);
109 if XNN_UNPREDICTABLE(i15 != zero) {
110 i15 = (const float*) ((uintptr_t) i15 + input_offset);
111 }
112 const float* i16 = input[16];
113 assert(i16 != NULL);
114 if XNN_UNPREDICTABLE(i16 != zero) {
115 i16 = (const float*) ((uintptr_t) i16 + input_offset);
116 }
117 const float* i17 = input[17];
118 assert(i17 != NULL);
119 if XNN_UNPREDICTABLE(i17 != zero) {
120 i17 = (const float*) ((uintptr_t) i17 + input_offset);
121 }
122 const float* i18 = input[18];
123 assert(i18 != NULL);
124 if XNN_UNPREDICTABLE(i18 != zero) {
125 i18 = (const float*) ((uintptr_t) i18 + input_offset);
126 }
127 const float* i19 = input[19];
128 assert(i19 != NULL);
129 if XNN_UNPREDICTABLE(i19 != zero) {
130 i19 = (const float*) ((uintptr_t) i19 + input_offset);
131 }
132 const float* i20 = input[20];
133 assert(i20 != NULL);
134 if XNN_UNPREDICTABLE(i20 != zero) {
135 i20 = (const float*) ((uintptr_t) i20 + input_offset);
136 }
137 const float* i21 = input[21];
138 assert(i21 != NULL);
139 if XNN_UNPREDICTABLE(i21 != zero) {
140 i21 = (const float*) ((uintptr_t) i21 + input_offset);
141 }
142 const float* i22 = input[22];
143 assert(i22 != NULL);
144 if XNN_UNPREDICTABLE(i22 != zero) {
145 i22 = (const float*) ((uintptr_t) i22 + input_offset);
146 }
147 const float* i23 = input[23];
148 assert(i23 != NULL);
149 if XNN_UNPREDICTABLE(i23 != zero) {
150 i23 = (const float*) ((uintptr_t) i23 + input_offset);
151 }
152 const float* i24 = input[24];
153 assert(i24 != NULL);
154 if XNN_UNPREDICTABLE(i24 != zero) {
155 i24 = (const float*) ((uintptr_t) i24 + input_offset);
156 }
157 input = (const float**) ((uintptr_t) input + input_stride);
158
159 size_t c = channels;
160 const float* w = weights;
161 do {
162 float vacc0p0 = w[0];
163
164 const float vi0 = *i0++;
165 const float vk0 = w[1];
166 vacc0p0 += vi0 * vk0;
167
168 const float vi1 = *i1++;
169 const float vk1 = w[2];
170 float vacc0p1 = vi1 * vk1;
171
172 const float vi2 = *i2++;
173 const float vk2 = w[3];
174 vacc0p0 += vi2 * vk2;
175
176 const float vi3 = *i3++;
177 const float vk3 = w[4];
178 vacc0p1 += vi3 * vk3;
179
180 const float vi4 = *i4++;
181 const float vk4 = w[5];
182 vacc0p0 += vi4 * vk4;
183
184 const float vi5 = *i5++;
185 const float vk5 = w[6];
186 vacc0p1 += vi5 * vk5;
187
188 const float vi6 = *i6++;
189 const float vk6 = w[7];
190 vacc0p0 += vi6 * vk6;
191
192 const float vi7 = *i7++;
193 const float vk7 = w[8];
194 vacc0p1 += vi7 * vk7;
195
196 const float vi8 = *i8++;
197 const float vk8 = w[9];
198 vacc0p0 += vi8 * vk8;
199
200 const float vi9 = *i9++;
201 const float vk9 = w[10];
202 vacc0p1 += vi9 * vk9;
203
204 const float vi10 = *i10++;
205 const float vk10 = w[11];
206 vacc0p0 += vi10 * vk10;
207
208 const float vi11 = *i11++;
209 const float vk11 = w[12];
210 vacc0p1 += vi11 * vk11;
211
212 const float vi12 = *i12++;
213 const float vk12 = w[13];
214 vacc0p0 += vi12 * vk12;
215
216 const float vi13 = *i13++;
217 const float vk13 = w[14];
218 vacc0p1 += vi13 * vk13;
219
220 const float vi14 = *i14++;
221 const float vk14 = w[15];
222 vacc0p0 += vi14 * vk14;
223
224 const float vi15 = *i15++;
225 const float vk15 = w[16];
226 vacc0p1 += vi15 * vk15;
227
228 const float vi16 = *i16++;
229 const float vk16 = w[17];
230 vacc0p0 += vi16 * vk16;
231
232 const float vi17 = *i17++;
233 const float vk17 = w[18];
234 vacc0p1 += vi17 * vk17;
235
236 const float vi18 = *i18++;
237 const float vk18 = w[19];
238 vacc0p0 += vi18 * vk18;
239
240 const float vi19 = *i19++;
241 const float vk19 = w[20];
242 vacc0p1 += vi19 * vk19;
243
244 const float vi20 = *i20++;
245 const float vk20 = w[21];
246 vacc0p0 += vi20 * vk20;
247
248 const float vi21 = *i21++;
249 const float vk21 = w[22];
250 vacc0p1 += vi21 * vk21;
251
252 const float vi22 = *i22++;
253 const float vk22 = w[23];
254 vacc0p0 += vi22 * vk22;
255
256 const float vi23 = *i23++;
257 const float vk23 = w[24];
258 vacc0p1 += vi23 * vk23;
259
260 const float vi24 = *i24++;
261 const float vk24 = w[25];
262 vacc0p0 += vi24 * vk24;
263
264 w += 26;
265
266 vacc0p0 += vacc0p1;
267
268 *output++ = vacc0p0;
269 } while (--c != 0);
270
271 output = (float*) ((uintptr_t) output + output_increment);
272 } while (--output_width != 0);
273 }
274