SHL 2.2.x
Loading...
Searching...
No Matches
shl_ref.h
1/*
2 * Copyright (C) 2016-2023 T-Head Semiconductor Co., Ltd. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Licensed under the Apache License, Version 2.0 (the License); you may
7 * not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19/* SHL version 2.2.x */
20
21#ifndef INCLUDE_SHL_REF_H_
22#define INCLUDE_SHL_REF_H_
23
24#include "csi_nn.h"
25#include "shl_utils.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31int shl_ref_abs_f32(struct csinn_tensor *input, struct csinn_tensor *output,
32 struct csinn_siso_params *params);
33
34int shl_ref_abs_quant(struct csinn_tensor *input, struct csinn_tensor *output,
35 struct csinn_siso_params *params);
36
37int shl_ref_acos_f32(struct csinn_tensor *input, struct csinn_tensor *output,
38 struct csinn_siso_params *params);
39
40int shl_ref_acos_quant(struct csinn_tensor *input, struct csinn_tensor *output,
41 struct csinn_siso_params *params);
42
43int shl_ref_acosh_f32(struct csinn_tensor *input, struct csinn_tensor *output,
44 struct csinn_siso_params *params);
45
46int shl_ref_acosh_quant(struct csinn_tensor *input, struct csinn_tensor *output,
47 struct csinn_siso_params *params);
48
49int shl_ref_add_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
50 struct csinn_tensor *output, struct csinn_diso_params *params);
51
52int shl_ref_add_u8(struct csinn_tensor *input0, struct csinn_tensor *input1,
53 struct csinn_tensor *output, struct csinn_diso_params *params);
54
55int shl_ref_add_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
56 struct csinn_tensor *output, struct csinn_diso_params *params);
57
58int shl_ref_add_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
59 struct csinn_tensor *output, struct csinn_diso_params *params);
60
61int shl_ref_and_u32(struct csinn_tensor *input0, struct csinn_tensor *input1,
62 struct csinn_tensor *output, struct csinn_diso_params *params);
63
64int shl_ref_and_u8(struct csinn_tensor *input0, struct csinn_tensor *input1,
65 struct csinn_tensor *output, struct csinn_diso_params *params);
66
67int shl_ref_and_i8(struct csinn_tensor *input0, struct csinn_tensor *input1,
68 struct csinn_tensor *output, struct csinn_diso_params *params);
69
70int shl_ref_arange_f32(struct csinn_tensor *output, struct csinn_arange_params *params);
71
72int shl_ref_arange_quant(struct csinn_tensor *output, struct csinn_arange_params *params);
73
74int shl_ref_argmax_stride_i32_f32(struct csinn_tensor *input, struct csinn_tensor *output,
75 struct csinn_reduce_params *params);
76
77int shl_ref_argmax_stride_quant(struct csinn_tensor *input, struct csinn_tensor *output,
78 struct csinn_reduce_params *params);
79
80int shl_ref_argmin_stride_i32_f32(struct csinn_tensor *input, struct csinn_tensor *output,
81 struct csinn_reduce_params *params);
82
83int shl_ref_argmin_stride_quant(struct csinn_tensor *input, struct csinn_tensor *output,
84 struct csinn_reduce_params *params);
85
86int shl_ref_asin_f32(struct csinn_tensor *input, struct csinn_tensor *output,
87 struct csinn_siso_params *params);
88
89int shl_ref_asin_quant(struct csinn_tensor *input, struct csinn_tensor *output,
90 struct csinn_siso_params *params);
91
92int shl_ref_asinh_f32(struct csinn_tensor *input, struct csinn_tensor *output,
93 struct csinn_siso_params *params);
94
95int shl_ref_asinh_quant(struct csinn_tensor *input, struct csinn_tensor *output,
96 struct csinn_siso_params *params);
97
98int shl_ref_atan_f32(struct csinn_tensor *input, struct csinn_tensor *output,
99 struct csinn_siso_params *params);
100
101int shl_ref_atan_quant(struct csinn_tensor *input, struct csinn_tensor *output,
102 struct csinn_siso_params *params);
103
104int shl_ref_atanh_f32(struct csinn_tensor *input, struct csinn_tensor *output,
105 struct csinn_siso_params *params);
106
107int shl_ref_atanh_quant(struct csinn_tensor *input, struct csinn_tensor *output,
108 struct csinn_siso_params *params);
109
110int shl_ref_avgpool2d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
111 struct csinn_pool_params *params);
112
113int shl_ref_avgpool2d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
114 struct csinn_pool_params *params);
115
116int shl_ref_avgpool3d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
117 struct csinn_pool_params *params);
118
119int shl_ref_avgpool3d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
120 struct csinn_pool_params *params);
121
122int shl_ref_batch_normalization_f32(struct csinn_tensor *input, struct csinn_tensor *mean,
123 struct csinn_tensor *variance, struct csinn_tensor *gamma,
124 struct csinn_tensor *beta, struct csinn_tensor *output,
125 struct csinn_bn_params *params);
126
127int shl_ref_batch_normalization_quant(struct csinn_tensor *input, struct csinn_tensor *mean,
128 struct csinn_tensor *variance, struct csinn_tensor *gamma,
129 struct csinn_tensor *beta, struct csinn_tensor *output,
130 struct csinn_bn_params *params);
131
132int shl_ref_batch_to_space_f32(struct csinn_tensor *input, struct csinn_tensor *output,
133 struct csinn_batch_to_space_params *params);
134
135int shl_ref_batch_to_space_quant(struct csinn_tensor *input, struct csinn_tensor *output,
136 struct csinn_batch_to_space_params *params);
137
138int shl_ref_broadcast_to_f32(struct csinn_tensor *input, struct csinn_tensor *output,
139 struct csinn_broadcast_to_params *params);
140
141int shl_ref_broadcast_to_quant(struct csinn_tensor *input, struct csinn_tensor *output,
142 struct csinn_broadcast_to_params *params);
143
144int shl_ref_ceil_f32(struct csinn_tensor *input, struct csinn_tensor *output,
145 struct csinn_siso_params *params);
146
147int shl_ref_ceil_quant(struct csinn_tensor *input, struct csinn_tensor *output,
148 struct csinn_siso_params *params);
149
150int shl_ref_clip_f32(struct csinn_tensor *input, struct csinn_tensor *output,
151 struct csinn_clip_params *params);
152
153int shl_ref_clip_quant(struct csinn_tensor *input, struct csinn_tensor *output,
154 struct csinn_clip_params *params);
155
156int shl_ref_col2im_f32(struct csinn_tensor *input, struct csinn_tensor *output,
157 struct csinn_tensor *kernel, struct csinn_col2im_params *params);
158
159int shl_ref_concat_f32(struct csinn_tensor **input, struct csinn_tensor *output,
160 struct csinn_concat_params *params);
161
162int shl_ref_concat_quant(struct csinn_tensor **input, struct csinn_tensor *output,
163 struct csinn_concat_params *params);
164
165int shl_ref_conv1d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
166 struct csinn_tensor *kernel, struct csinn_tensor *bias,
167 struct csinn_conv1d_params *params);
168
169int shl_ref_conv1d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
170 struct csinn_tensor *kernel, struct csinn_tensor *bias,
171 struct csinn_conv1d_params *params);
172
173int shl_ref_conv2d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
174 struct csinn_tensor *kernel, struct csinn_tensor *bias,
175 struct csinn_conv2d_params *params);
176
177int shl_ref_conv2d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
178 struct csinn_tensor *kernel, struct csinn_tensor *bias,
179 struct csinn_conv2d_params *params);
180
181int shl_ref_conv2d_channel_quant(struct csinn_tensor *input, struct csinn_tensor *output,
182 struct csinn_tensor *kernel, struct csinn_tensor *bias,
183 struct csinn_conv2d_params *params);
184
185int shl_ref_conv2d_relu_f32(struct csinn_tensor *o_input, struct csinn_tensor *o_output,
186 struct csinn_tensor *o_kernel, struct csinn_tensor *o_bias,
187 struct csinn_conv2d_params *params);
188
189int shl_ref_conv2d_relu_quant(struct csinn_tensor *o_input, struct csinn_tensor *o_output,
190 struct csinn_tensor *o_kernel, struct csinn_tensor *o_bias,
191 struct csinn_conv2d_params *params);
192
193int shl_ref_cache_matmul_init(struct csinn_tensor *input, struct csinn_tensor *output,
194 struct csinn_tensor *weight, struct csinn_tensor *bias,
195 struct csinn_cache_matmul_params *params);
196
197int shl_ref_cache_matmul_f32(struct csinn_tensor *input, struct csinn_tensor *output,
198 struct csinn_tensor *weight, struct csinn_tensor *bias,
199 struct csinn_cache_matmul_params *params);
200
201int shl_ref_cache_matmul_quant(struct csinn_tensor *input, struct csinn_tensor *output,
202 struct csinn_tensor *weight, struct csinn_tensor *bias,
203 struct csinn_cache_matmul_params *params);
204
205int shl_ref_cache_conv1d_init(struct csinn_tensor *input, struct csinn_tensor *output,
206 struct csinn_tensor *weight, struct csinn_tensor *bias,
207 struct csinn_cache_conv1d_params *params);
208
209int shl_ref_cache_conv1d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
210 struct csinn_tensor *weight, struct csinn_tensor *bias,
211 struct csinn_cache_conv1d_params *params);
212
213int shl_ref_cache_conv1d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
214 struct csinn_tensor *weight, struct csinn_tensor *bias,
215 struct csinn_cache_conv1d_params *params);
216
217int shl_ref_conv2d_channel_relu_quant(struct csinn_tensor *o_input, struct csinn_tensor *o_output,
218 struct csinn_tensor *o_kernel, struct csinn_tensor *o_bias,
219 struct csinn_conv2d_params *params);
220
221int shl_ref_conv2d_relu6_quant(struct csinn_tensor *input, struct csinn_tensor *output,
222 struct csinn_tensor *kernel, struct csinn_tensor *bias,
223 struct csinn_conv2d_params *params);
224
225int shl_ref_conv2d_channel_relu6_quant(struct csinn_tensor *input, struct csinn_tensor *output,
226 struct csinn_tensor *kernel, struct csinn_tensor *bias,
227 struct csinn_conv2d_params *params);
228
229int shl_ref_depthwise_conv2d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
230 struct csinn_tensor *kernel, struct csinn_tensor *bias,
231 struct csinn_conv2d_params *params);
232
233int shl_ref_depthwise_conv2d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
234 struct csinn_tensor *kernel, struct csinn_tensor *bias,
235 struct csinn_conv2d_params *params);
236
237int shl_ref_depthwise_conv2d_channel_quant(struct csinn_tensor *input, struct csinn_tensor *output,
238 struct csinn_tensor *kernel, struct csinn_tensor *bias,
239 struct csinn_conv2d_params *params);
240
241int shl_ref_depthwise_conv2d_relu_f32(struct csinn_tensor *o_input, struct csinn_tensor *o_output,
242 struct csinn_tensor *o_kernel, struct csinn_tensor *o_bias,
243 struct csinn_conv2d_params *params);
244
245int shl_ref_depthwise_conv2d_relu_quant(struct csinn_tensor *o_input, struct csinn_tensor *o_output,
246 struct csinn_tensor *o_kernel, struct csinn_tensor *o_bias,
247 struct csinn_conv2d_params *params);
248
249int shl_ref_depthwise_conv2d_channel_relu_quant(struct csinn_tensor *o_input,
250 struct csinn_tensor *o_output,
251 struct csinn_tensor *o_kernel,
252 struct csinn_tensor *o_bias,
253 struct csinn_conv2d_params *params);
254
255int shl_ref_depthwise_conv2d_relu6_quant(struct csinn_tensor *input, struct csinn_tensor *output,
256 struct csinn_tensor *kernel, struct csinn_tensor *bias,
257 struct csinn_conv2d_params *params);
258
259int shl_ref_depthwise_conv2d_channel_relu6_quant(struct csinn_tensor *input,
260 struct csinn_tensor *output,
261 struct csinn_tensor *kernel,
262 struct csinn_tensor *bias,
263 struct csinn_conv2d_params *params);
264
265int shl_ref_group_conv2d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
266 struct csinn_tensor *kernel, struct csinn_tensor *bias,
267 struct csinn_conv2d_params *params);
268
269int shl_ref_group_conv2d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
270 struct csinn_tensor *kernel, struct csinn_tensor *bias,
271 struct csinn_conv2d_params *params);
272
273int shl_ref_group_conv2d_channel_quant(struct csinn_tensor *input, struct csinn_tensor *output,
274 struct csinn_tensor *kernel, struct csinn_tensor *bias,
275 struct csinn_conv2d_params *params);
276
277int shl_ref_group_conv2d_relu_quant(struct csinn_tensor *input, struct csinn_tensor *output,
278 struct csinn_tensor *kernel, struct csinn_tensor *bias,
279 struct csinn_conv2d_params *params);
280
281int shl_ref_group_conv2d_relu6_quant(struct csinn_tensor *input, struct csinn_tensor *output,
282 struct csinn_tensor *kernel, struct csinn_tensor *bias,
283 struct csinn_conv2d_params *params);
284
285int shl_ref_group_conv2d_channel_relu_quant(struct csinn_tensor *input, struct csinn_tensor *output,
286 struct csinn_tensor *kernel, struct csinn_tensor *bias,
287 struct csinn_conv2d_params *params);
288
289int shl_ref_conv3d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
290 struct csinn_tensor *kernel, struct csinn_tensor *bias,
291 struct csinn_conv3d_params *params);
292
293int shl_ref_conv3d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
294 struct csinn_tensor *kernel, struct csinn_tensor *bias,
295 struct csinn_conv3d_params *params);
296
297int shl_ref_cos_f32(struct csinn_tensor *input, struct csinn_tensor *output,
298 struct csinn_siso_params *params);
299
300int shl_ref_cos_quant(struct csinn_tensor *input, struct csinn_tensor *output,
301 struct csinn_siso_params *params);
302
303int shl_ref_cosh_f32(struct csinn_tensor *input, struct csinn_tensor *output,
304 struct csinn_siso_params *params);
305
306int shl_ref_cosh_quant(struct csinn_tensor *input, struct csinn_tensor *output,
307 struct csinn_siso_params *params);
308
309int shl_ref_cumprod_f32(struct csinn_tensor *input, struct csinn_tensor *output,
310 struct csinn_cumprod_params *params);
311
312int shl_ref_cumprod_quant(struct csinn_tensor *input, struct csinn_tensor *output,
313 struct csinn_cumprod_params *params);
314
315int shl_ref_cumsum_f32(struct csinn_tensor *input, struct csinn_tensor *output,
316 struct csinn_cumsum_params *params);
317
318int shl_ref_cumsum_quant(struct csinn_tensor *input, struct csinn_tensor *output,
319 struct csinn_cumsum_params *params);
320
321int shl_ref_data_convert_f32(struct csinn_tensor *input, struct csinn_tensor *output,
322 struct csinn_siso_params *params);
323int shl_ref_data_convert_quant(struct csinn_tensor *input, struct csinn_tensor *output,
324 struct csinn_siso_params *params);
325
326int shl_ref_deconv2d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
327 struct csinn_tensor *kernel, struct csinn_tensor *bias,
328 struct csinn_conv2d_params *params);
329
330int shl_ref_deconv2d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
331 struct csinn_tensor *kernel, struct csinn_tensor *bias,
332 struct csinn_conv2d_params *params);
333
334int shl_ref_depthwise_deconv2d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
335 struct csinn_tensor *kernel, struct csinn_tensor *bias,
336 struct csinn_conv2d_params *params);
337
338int shl_ref_depthwise_deconv2d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
339 struct csinn_tensor *kernel, struct csinn_tensor *bias,
340 struct csinn_conv2d_params *params);
341
342int shl_ref_deconv3d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
343 struct csinn_tensor *kernel, struct csinn_tensor *bias,
344 struct csinn_conv3d_params *params);
345
346int shl_ref_deconv3d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
347 struct csinn_tensor *kernel, struct csinn_tensor *bias,
348 struct csinn_conv3d_params *params);
349
350int shl_ref_depth_to_space_f32(struct csinn_tensor *input, struct csinn_tensor *output,
351 struct csinn_depth_to_space_params *params);
352
353int shl_ref_depth_to_space_quant(struct csinn_tensor *input, struct csinn_tensor *output,
354 struct csinn_depth_to_space_params *params);
355
356int shl_ref_div_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
357 struct csinn_tensor *output, struct csinn_diso_params *params);
358
359int shl_ref_div_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
360 struct csinn_tensor *output, struct csinn_diso_params *params);
361
362int shl_ref_elu_f32(struct csinn_tensor *input, struct csinn_tensor *output,
363 struct csinn_relu_params *params);
364
365int shl_ref_elu_quant(struct csinn_tensor *input, struct csinn_tensor *output,
366 struct csinn_relu_params *params);
367
368int shl_ref_fsmn_f32(struct csinn_tensor *frame, struct csinn_tensor *l_filter,
369 struct csinn_tensor *r_filter, struct csinn_tensor *frame_sequence,
370 struct csinn_tensor *frame_counter, struct csinn_tensor *output,
371 struct csinn_fsmn_params *params);
372
373int shl_ref_fsmn_quant(struct csinn_tensor *frame, struct csinn_tensor *l_filter,
374 struct csinn_tensor *r_filter, struct csinn_tensor *frame_sequence,
375 struct csinn_tensor *frame_counter, struct csinn_tensor *output,
376 struct csinn_fsmn_params *params);
377
378int shl_ref_equal_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
379 struct csinn_tensor *output, struct csinn_diso_params *params);
380
381int shl_ref_equal_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
382 struct csinn_tensor *output, struct csinn_diso_params *params);
383
384int shl_ref_erf_f32(struct csinn_tensor *input, struct csinn_tensor *output,
385 struct csinn_siso_params *params);
386
387int shl_ref_erf_quant(struct csinn_tensor *input, struct csinn_tensor *output,
388 struct csinn_siso_params *params);
389
390int shl_ref_exp_f32(struct csinn_tensor *input, struct csinn_tensor *output,
391 struct csinn_siso_params *params);
392
393int shl_ref_exp_quant(struct csinn_tensor *input, struct csinn_tensor *output,
394 struct csinn_siso_params *params);
395
396int shl_ref_expand_dims_f32(struct csinn_tensor *input, struct csinn_tensor *output,
397 struct csinn_expand_dims_params *params);
398
399int shl_ref_expand_dims_quant(struct csinn_tensor *input, struct csinn_tensor *output,
400 struct csinn_expand_dims_params *params);
401
402int shl_ref_expm1_f32(struct csinn_tensor *input, struct csinn_tensor *output,
403 struct csinn_siso_params *params);
404
405int shl_ref_expm1_quant(struct csinn_tensor *input, struct csinn_tensor *output,
406 struct csinn_siso_params *params);
407
408int shl_ref_flatten(struct csinn_tensor *input, struct csinn_tensor *output,
409 struct csinn_flatten_params *params);
410
411int shl_ref_flatten_quant(struct csinn_tensor *input, struct csinn_tensor *output,
412 struct csinn_flatten_params *params);
413
414int shl_ref_floor_divide_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
415 struct csinn_tensor *output, struct csinn_diso_params *params);
416
417int shl_ref_floor_divide_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
418 struct csinn_tensor *output, struct csinn_diso_params *params);
419
420int shl_ref_floor_mod_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
421 struct csinn_tensor *output, struct csinn_diso_params *params);
422
423int shl_ref_floor_mod_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
424 struct csinn_tensor *output, struct csinn_diso_params *params);
425
426int shl_ref_floor_f32(struct csinn_tensor *input, struct csinn_tensor *output,
427 struct csinn_siso_params *params);
428
429int shl_ref_floor_quant(struct csinn_tensor *input, struct csinn_tensor *output,
430 struct csinn_siso_params *params);
431
432int shl_ref_fullyconnected_f32(struct csinn_tensor *input, struct csinn_tensor *output,
433 struct csinn_tensor *weights, struct csinn_tensor *bias,
434 struct csinn_fc_params *params);
435
436int shl_ref_fullyconnected_quant(struct csinn_tensor *input, struct csinn_tensor *output,
437 struct csinn_tensor *weights, struct csinn_tensor *bias,
438 struct csinn_fc_params *params);
439
440int shl_ref_gather_nd_f32(struct csinn_tensor *input, struct csinn_tensor *indices,
441 struct csinn_tensor *output, struct csinn_gather_nd_params *params);
442
443int shl_ref_gather_nd_quant(struct csinn_tensor *input, struct csinn_tensor *indices,
444 struct csinn_tensor *output, struct csinn_gather_nd_params *params);
445
446int shl_ref_gather_f32(struct csinn_tensor *input, struct csinn_tensor *indices,
447 struct csinn_tensor *output, struct csinn_gather_params *params);
448
449int shl_ref_gather_f16(struct csinn_tensor *input, struct csinn_tensor *indices,
450 struct csinn_tensor *output, struct csinn_gather_params *params);
451
452int shl_ref_gather_int8(struct csinn_tensor *input, struct csinn_tensor *indices,
453 struct csinn_tensor *output, struct csinn_gather_params *params);
454
455int shl_ref_gather_quant(struct csinn_tensor *input, struct csinn_tensor *indices,
456 struct csinn_tensor *output, struct csinn_gather_params *params);
457
458int shl_ref_global_avgpool2d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
459 struct csinn_pool_params *params);
460
461int shl_ref_global_avgpool2d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
462 struct csinn_pool_params *params);
463
464int shl_ref_global_maxpool2d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
465 struct csinn_pool_params *params);
466
467int shl_ref_global_maxpool2d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
468 struct csinn_pool_params *params);
469
470int shl_ref_greater_equal_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
471 struct csinn_tensor *output, struct csinn_diso_params *params);
472
473int shl_ref_greater_equal_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
474 struct csinn_tensor *output, struct csinn_diso_params *params);
475
476int shl_ref_greater_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
477 struct csinn_tensor *output, struct csinn_diso_params *params);
478
479int shl_ref_greater_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
480 struct csinn_tensor *output, struct csinn_diso_params *params);
481
482int shl_ref_hard_sigmoid_f32(struct csinn_tensor *input, struct csinn_tensor *output,
483 struct csinn_sigmoid_params *params);
484
485int shl_ref_hard_sigmoid_quant(struct csinn_tensor *input, struct csinn_tensor *output,
486 struct csinn_sigmoid_params *params);
487
488int shl_ref_im2col_f32(struct csinn_tensor *input, struct csinn_tensor *output,
489 struct csinn_im2col_params *params);
490
491int shl_ref_im2col_quant(struct csinn_tensor *input, struct csinn_tensor *output,
492 struct csinn_im2col_params *params);
493
494int shl_ref_isnan_bool_f32(struct csinn_tensor *input, struct csinn_tensor *output,
495 struct csinn_siso_params *params);
496
497int shl_ref_l2_normalization_f32(struct csinn_tensor *input, struct csinn_tensor *output,
498 struct csinn_l2n_params *params);
499
500int shl_ref_l2_normalization_quant(struct csinn_tensor *input, struct csinn_tensor *output,
501 struct csinn_l2n_params *params);
502
503int shl_ref_l2pool_f32(struct csinn_tensor *input, struct csinn_tensor *output,
504 struct csinn_pool_params *params);
505
506int shl_ref_layer_norm_f32(struct csinn_tensor *input, struct csinn_tensor *output,
507 struct csinn_tensor *gamma, struct csinn_tensor *beta,
508 struct csinn_layer_norm_params *params);
509
510int shl_ref_layer_norm_quant(struct csinn_tensor *input, struct csinn_tensor *output,
511 struct csinn_tensor *gamma, struct csinn_tensor *beta,
512 struct csinn_layer_norm_params *params);
513
514int shl_ref_leaky_relu_f32(struct csinn_tensor *input, struct csinn_tensor *output,
515 struct csinn_relu_params *params);
516
517int shl_ref_leaky_relu_quant(struct csinn_tensor *input, struct csinn_tensor *output,
518 struct csinn_relu_params *params);
519
520int shl_ref_less_equal_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
521 struct csinn_tensor *output, struct csinn_diso_params *params);
522
523int shl_ref_less_equal_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
524 struct csinn_tensor *output, struct csinn_diso_params *params);
525
526int shl_ref_less_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
527 struct csinn_tensor *output, struct csinn_diso_params *params);
528
529int shl_ref_less_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
530 struct csinn_tensor *output, struct csinn_diso_params *params);
531
532int shl_ref_log_softmax_f32(struct csinn_tensor *input, struct csinn_tensor *output,
533 struct csinn_softmax_params *params);
534
535int shl_ref_log_softmax_quant(struct csinn_tensor *input, struct csinn_tensor *output,
536 struct csinn_softmax_params *params);
537
538int shl_ref_log_f32(struct csinn_tensor *input, struct csinn_tensor *output,
539 struct csinn_siso_params *params);
540
541int shl_ref_log_quant(struct csinn_tensor *input, struct csinn_tensor *output,
542 struct csinn_siso_params *params);
543
544int shl_ref_log1p_f32(struct csinn_tensor *input, struct csinn_tensor *output,
545 struct csinn_siso_params *params);
546
547int shl_ref_log1p_quant(struct csinn_tensor *input, struct csinn_tensor *output,
548 struct csinn_siso_params *params);
549
550int shl_ref_logical_and_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
551 struct csinn_tensor *output, struct csinn_diso_params *params);
552
553int shl_ref_logical_and_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
554 struct csinn_tensor *output, struct csinn_diso_params *params);
555
556int shl_ref_logical_not_f32(struct csinn_tensor *input, struct csinn_tensor *output,
557 struct csinn_siso_params *params);
558
559int shl_ref_logical_not_quant(struct csinn_tensor *input, struct csinn_tensor *output,
560 struct csinn_siso_params *params);
561
562int shl_ref_logical_or_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
563 struct csinn_tensor *output, struct csinn_diso_params *params);
564
565int shl_ref_logical_or_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
566 struct csinn_tensor *output, struct csinn_diso_params *params);
567
568int shl_ref_logical_xor_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
569 struct csinn_tensor *output, struct csinn_diso_params *params);
570
571int shl_ref_logical_xor_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
572 struct csinn_tensor *output, struct csinn_diso_params *params);
573
574int shl_ref_lrn_f32(struct csinn_tensor *input, struct csinn_tensor *output,
575 struct csinn_lrn_params *params);
576
577int shl_ref_lrn_quant(struct csinn_tensor *input, struct csinn_tensor *output,
578 struct csinn_lrn_params *params);
579
580int shl_ref_matmul_f32(struct csinn_tensor *mat0, struct csinn_tensor *mat1,
581 struct csinn_tensor *output, struct csinn_matmul_params *params);
582
583int shl_ref_matmul_quant(struct csinn_tensor *mat0, struct csinn_tensor *mat1,
584 struct csinn_tensor *output, struct csinn_matmul_params *params);
585
586int shl_ref_max_stride_f32(struct csinn_tensor *input, struct csinn_tensor *output,
587 struct csinn_reduce_params *params);
588
589int shl_ref_max_stride_quant(struct csinn_tensor *input, struct csinn_tensor *output,
590 struct csinn_reduce_params *params);
591
592int shl_ref_maximum_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
593 struct csinn_tensor *output, struct csinn_diso_params *params);
594
595int shl_ref_maximum_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
596 struct csinn_tensor *output, struct csinn_diso_params *params);
597
598int shl_ref_maxpool2d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
599 struct csinn_pool_params *params);
600
601int shl_ref_maxpool2d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
602 struct csinn_pool_params *params);
603
604int shl_ref_maxpool2d_locat_f32(struct csinn_tensor *input, struct csinn_tensor *output,
605 struct csinn_pool_params *params);
606
607int shl_ref_maxpool2d_locat_quant(struct csinn_tensor *input, struct csinn_tensor *output,
608 struct csinn_pool_params *params);
609
610int shl_ref_maxpool3d_f32(struct csinn_tensor *input, struct csinn_tensor *output,
611 struct csinn_pool_params *params);
612
613int shl_ref_maxpool3d_quant(struct csinn_tensor *input, struct csinn_tensor *output,
614 struct csinn_pool_params *params);
615
616int shl_ref_mean_stride_f32(struct csinn_tensor *input, struct csinn_tensor *output,
617 struct csinn_reduce_params *params);
618
619int shl_ref_mean_stride_quant(struct csinn_tensor *input, struct csinn_tensor *output,
620 struct csinn_reduce_params *params);
621
622int shl_ref_mean_quant(struct csinn_tensor *input, struct csinn_tensor *output,
623 struct csinn_reduce_params *params);
624
625int shl_ref_min_stride_f32(struct csinn_tensor *input, struct csinn_tensor *output,
626 struct csinn_reduce_params *params);
627
628int shl_ref_min_stride_quant(struct csinn_tensor *input, struct csinn_tensor *output,
629 struct csinn_reduce_params *params);
630
631int shl_ref_minimum_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
632 struct csinn_tensor *output, struct csinn_diso_params *params);
633
634int shl_ref_minimum_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
635 struct csinn_tensor *output, struct csinn_diso_params *params);
636
637int shl_ref_mod_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
638 struct csinn_tensor *output, struct csinn_diso_params *params);
639
640int shl_ref_mod_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
641 struct csinn_tensor *output, struct csinn_diso_params *params);
642
643int shl_ref_mul_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
644 struct csinn_tensor *output, struct csinn_diso_params *params);
645
646int shl_ref_mul_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
647 struct csinn_tensor *output, struct csinn_diso_params *params);
648
649int shl_ref_ndarray_size_f32(struct csinn_tensor *input, struct csinn_tensor *output,
650 struct csinn_ndarray_size_params *params);
651
652int shl_ref_ndarray_size_u8(struct csinn_tensor *input, struct csinn_tensor *output,
653 struct csinn_ndarray_size_params *params);
654
655int shl_ref_ndarray_size_i8(struct csinn_tensor *input, struct csinn_tensor *output,
656 struct csinn_ndarray_size_params *params);
657
658int shl_ref_ndarray_size_i32(struct csinn_tensor *input, struct csinn_tensor *output,
659 struct csinn_ndarray_size_params *params);
660
661int shl_ref_negative_f32(struct csinn_tensor *input, struct csinn_tensor *output,
662 struct csinn_siso_params *params);
663
664int shl_ref_negative_quant(struct csinn_tensor *input, struct csinn_tensor *output,
665 struct csinn_siso_params *params);
666
667int shl_ref_non_max_suppression_std(struct csinn_tensor *input0, struct csinn_tensor *input1,
668 struct csinn_tensor *output,
669 struct csinn_non_max_suppression_params *params);
670
671int shl_ref_not_equal_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
672 struct csinn_tensor *output, struct csinn_diso_params *params);
673
674int shl_ref_not_equal_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
675 struct csinn_tensor *output, struct csinn_diso_params *params);
676
677int shl_ref_not_u32(struct csinn_tensor *input, struct csinn_tensor *output,
678 struct csinn_siso_params *params);
679
680int shl_ref_not_u8(struct csinn_tensor *input, struct csinn_tensor *output,
681 struct csinn_siso_params *params);
682
683int shl_ref_not_i8(struct csinn_tensor *input, struct csinn_tensor *output,
684 struct csinn_siso_params *params);
685
686int shl_ref_or_u32(struct csinn_tensor *input0, struct csinn_tensor *input1,
687 struct csinn_tensor *output, struct csinn_diso_params *params);
688
689int shl_ref_or_u8(struct csinn_tensor *input0, struct csinn_tensor *input1,
690 struct csinn_tensor *output, struct csinn_diso_params *params);
691
692int shl_ref_or_i8(struct csinn_tensor *input0, struct csinn_tensor *input1,
693 struct csinn_tensor *output, struct csinn_diso_params *params);
694
695int shl_ref_pad_f32(struct csinn_tensor *input, struct csinn_tensor *output,
696 struct csinn_pad_params *params);
697
698int shl_ref_pad_quant(struct csinn_tensor *input, struct csinn_tensor *output,
699 struct csinn_pad_params *params);
700
701int shl_ref_power_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
702 struct csinn_tensor *output, struct csinn_diso_params *params);
703
704int shl_ref_power_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
705 struct csinn_tensor *output, struct csinn_diso_params *params);
706
707int shl_ref_prelu_f32(struct csinn_tensor *input, struct csinn_tensor *alpha,
708 struct csinn_tensor *output, struct csinn_prelu_params *params);
709
710int shl_ref_prelu_quant(struct csinn_tensor *input, struct csinn_tensor *alpha,
711 struct csinn_tensor *output, struct csinn_prelu_params *params);
712
713int shl_ref_prod_stride_f32(struct csinn_tensor *input, struct csinn_tensor *output,
714 struct csinn_reduce_params *params);
715
716int shl_ref_prod_stride_quant(struct csinn_tensor *input, struct csinn_tensor *output,
717 struct csinn_reduce_params *params);
718
719int shl_ref_proposal_f32(struct csinn_tensor *cls_prob, struct csinn_tensor *bbox_pred,
720 struct csinn_tensor *im_info, struct csinn_tensor *output,
721 struct csinn_proposal_params *params);
722
723int shl_ref_proposal_quant(struct csinn_tensor *cls_prob, struct csinn_tensor *bbox_pred,
724 struct csinn_tensor *im_info, struct csinn_tensor *output,
725 struct csinn_proposal_params *params);
726
727int shl_ref_psroipooling_f32(struct csinn_tensor *data, struct csinn_tensor *rois,
728 struct csinn_tensor *output, struct csinn_psroipooling_params *params);
729
730int shl_ref_psroipooling_quant(struct csinn_tensor *data, struct csinn_tensor *rois,
731 struct csinn_tensor *output,
732 struct csinn_psroipooling_params *params);
733
734int shl_ref_reduce_logsumexp_f32(struct csinn_tensor *input, struct csinn_tensor *output,
735 struct csinn_reduce_params *params);
736
737int shl_ref_reduce_logsumexp_quant(struct csinn_tensor *input, struct csinn_tensor *output,
738 struct csinn_reduce_params *params);
739
740int shl_ref_reduce_max_f32(struct csinn_tensor *input, struct csinn_tensor *output,
741 struct csinn_reduce_params *params);
742
743int shl_ref_reduce_max_quant(struct csinn_tensor *input, struct csinn_tensor *output,
744 struct csinn_reduce_params *params);
745
746int shl_ref_reduce_mean_f32(struct csinn_tensor *input, struct csinn_tensor *output,
747 struct csinn_reduce_params *params);
748
749int shl_ref_reduce_mean_quant(struct csinn_tensor *input, struct csinn_tensor *output,
750 struct csinn_reduce_params *params);
751
752int shl_ref_reduce_min_f32(struct csinn_tensor *input, struct csinn_tensor *output,
753 struct csinn_reduce_params *params);
754
755int shl_ref_reduce_min_quant(struct csinn_tensor *input, struct csinn_tensor *output,
756 struct csinn_reduce_params *params);
757
758int shl_ref_reduce_prod_f32(struct csinn_tensor *input, struct csinn_tensor *output,
759 struct csinn_reduce_params *params);
760
761int shl_ref_reduce_prod_quant(struct csinn_tensor *input, struct csinn_tensor *output,
762 struct csinn_reduce_params *params);
763
764int shl_ref_reduce_sum_f32(struct csinn_tensor *input, struct csinn_tensor *output,
765 struct csinn_reduce_params *params);
766
767int shl_ref_reduce_sum_quant(struct csinn_tensor *input, struct csinn_tensor *output,
768 struct csinn_reduce_params *params);
769
770int shl_ref_relu_f32(struct csinn_tensor *input, struct csinn_tensor *output,
771 struct csinn_relu_params *params);
772
773int shl_ref_relu_quant(struct csinn_tensor *input, struct csinn_tensor *output,
774 struct csinn_relu_params *params);
775
776int shl_ref_relu1_f32(struct csinn_tensor *input, struct csinn_tensor *output,
777 struct csinn_relu_params *params);
778
779int shl_ref_relu1_quant(struct csinn_tensor *input, struct csinn_tensor *output,
780 struct csinn_relu_params *params);
781
782int shl_ref_relu6_f32(struct csinn_tensor *input, struct csinn_tensor *output,
783 struct csinn_relu_params *params);
784
785int shl_ref_relu6_quant(struct csinn_tensor *input, struct csinn_tensor *output,
786 struct csinn_relu_params *params);
787
788int shl_ref_relun_f32(struct csinn_tensor *input, struct csinn_tensor *output,
789 struct csinn_relu_params *params);
790
791int shl_ref_relun_quant(struct csinn_tensor *input, struct csinn_tensor *output,
792 struct csinn_relu_params *params);
793
794int shl_ref_reshape(struct csinn_tensor *input, struct csinn_tensor *output,
795 struct csinn_reshape_params *params);
796
797int shl_ref_reshape_quant(struct csinn_tensor *input, struct csinn_tensor *output,
798 struct csinn_reshape_params *params);
799
800int shl_ref_resize_f32(struct csinn_tensor *input, struct csinn_tensor *output,
801 struct csinn_resize_params *params);
802
803int shl_ref_resize_f16(struct csinn_tensor *input, struct csinn_tensor *output,
804 struct csinn_resize_params *params);
805
806int shl_ref_resize_i8(struct csinn_tensor *input, struct csinn_tensor *output,
807 struct csinn_resize_params *params);
808
809int shl_ref_resize_quant(struct csinn_tensor *input, struct csinn_tensor *output,
810 struct csinn_resize_params *params);
811
812int shl_ref_reverse_f32(struct csinn_tensor *input, struct csinn_tensor *output,
813 struct csinn_reverse_params *params);
814
815int shl_ref_reverse_quant(struct csinn_tensor *input, struct csinn_tensor *output,
816 struct csinn_reverse_params *params);
817
818int shl_ref_roi_align_f32(struct csinn_tensor *data, struct csinn_tensor *rois,
819 struct csinn_tensor *output, struct csinn_roi_align_params *params);
820
821int shl_ref_roipool_f32(struct csinn_tensor *data, struct csinn_tensor *rois,
822 struct csinn_tensor *output, struct csinn_roi_pool_params *params);
823
824int shl_ref_roipool_quant(struct csinn_tensor *data, struct csinn_tensor *rois,
825 struct csinn_tensor *output, struct csinn_roi_pool_params *params);
826
827int shl_ref_round_f32(struct csinn_tensor *input, struct csinn_tensor *output,
828 struct csinn_siso_params *params);
829
830int shl_ref_round_quant(struct csinn_tensor *input, struct csinn_tensor *output,
831 struct csinn_siso_params *params);
832
833int shl_ref_rsqrt_f32(struct csinn_tensor *input, struct csinn_tensor *output,
834 struct csinn_siso_params *params);
835
836int shl_ref_rsqrt_quant(struct csinn_tensor *input, struct csinn_tensor *output,
837 struct csinn_siso_params *params);
838
839int shl_ref_scatter_nd_f32(struct csinn_tensor *input, struct csinn_tensor *indices,
840 struct csinn_tensor *updates, struct csinn_tensor *output,
841 struct csinn_scatter_nd_params *params);
842
843int shl_ref_scatter_nd_quant(struct csinn_tensor *input, struct csinn_tensor *indices,
844 struct csinn_tensor *updates, struct csinn_tensor *output,
845 struct csinn_scatter_nd_params *params);
846
847int shl_ref_unsorted_segment_max_f32(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
848 struct csinn_tensor *output,
849 struct csinn_segment_params *params);
850
851int shl_ref_segment_max_f32(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
852 struct csinn_tensor *output, struct csinn_segment_params *params);
853
854int shl_ref_unsorted_segment_max_quant(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
855 struct csinn_tensor *output,
856 struct csinn_segment_params *params);
857
858int shl_ref_segment_max_quant(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
859 struct csinn_tensor *output, struct csinn_segment_params *params);
860
861int shl_ref_unsorted_segment_mean_f32(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
862 struct csinn_tensor *output,
863 struct csinn_segment_params *params);
864
865int shl_ref_segment_mean_f32(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
866 struct csinn_tensor *output, struct csinn_segment_params *params);
867
868int shl_ref_unsorted_segment_mean_quant(struct csinn_tensor *input,
869 struct csinn_tensor *segment_ids,
870 struct csinn_tensor *output,
871 struct csinn_segment_params *params);
872
873int shl_ref_segment_mean_quant(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
874 struct csinn_tensor *output, struct csinn_segment_params *params);
875
876int shl_ref_unsorted_segment_min_f32(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
877 struct csinn_tensor *output,
878 struct csinn_segment_params *params);
879
880int shl_ref_segment_min_f32(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
881 struct csinn_tensor *output, struct csinn_segment_params *params);
882
883int shl_ref_unsorted_segment_min_quant(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
884 struct csinn_tensor *output,
885 struct csinn_segment_params *params);
886
887int shl_ref_segment_min_quant(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
888 struct csinn_tensor *output, struct csinn_segment_params *params);
889
890int shl_ref_unsorted_segment_prod_f32(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
891 struct csinn_tensor *output,
892 struct csinn_segment_params *params);
893
894int shl_ref_segment_prod_f32(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
895 struct csinn_tensor *output, struct csinn_segment_params *params);
896
897int shl_ref_unsorted_segment_prod_quant(struct csinn_tensor *input,
898 struct csinn_tensor *segment_ids,
899 struct csinn_tensor *output,
900 struct csinn_segment_params *params);
901
902int shl_ref_segment_prod_quant(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
903 struct csinn_tensor *output, struct csinn_segment_params *params);
904
905int shl_ref_unsorted_segment_sum_f32(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
906 struct csinn_tensor *output,
907 struct csinn_segment_params *params);
908
909int shl_ref_segment_sum_f32(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
910 struct csinn_tensor *output, struct csinn_segment_params *params);
911
912int shl_ref_unsorted_segment_sum_quant(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
913 struct csinn_tensor *output,
914 struct csinn_segment_params *params);
915
916int shl_ref_segment_sum_quant(struct csinn_tensor *input, struct csinn_tensor *segment_ids,
917 struct csinn_tensor *output, struct csinn_segment_params *params);
918
919int shl_ref_select_f32(struct csinn_tensor *condition, struct csinn_tensor *input0,
920 struct csinn_tensor *input1, struct csinn_tensor *output,
921 struct csinn_select_params *params);
922
923int shl_ref_select_u8(struct csinn_tensor *condition, struct csinn_tensor *input0,
924 struct csinn_tensor *input1, struct csinn_tensor *output,
925 struct csinn_select_params *params);
926
927int shl_ref_select_i8(struct csinn_tensor *condition, struct csinn_tensor *input0,
928 struct csinn_tensor *input1, struct csinn_tensor *output,
929 struct csinn_select_params *params);
930
931int shl_ref_shape_i32(struct csinn_tensor *input, struct csinn_tensor *output,
932 struct csinn_shape_params *params);
933
934int shl_ref_shape_u8(struct csinn_tensor *input, struct csinn_tensor *output,
935 struct csinn_shape_params *params);
936
937int shl_ref_shape_i8(struct csinn_tensor *input, struct csinn_tensor *output,
938 struct csinn_shape_params *params);
939
940int shl_ref_shuffle_channel_f32(struct csinn_tensor *input, struct csinn_tensor *output,
941 struct csinn_shuffle_channel_params *params);
942
943int shl_ref_shuffle_channel_quant(struct csinn_tensor *input, struct csinn_tensor *output,
944 struct csinn_shuffle_channel_params *params);
945
946int shl_ref_sigmoid_f32(struct csinn_tensor *input, struct csinn_tensor *output,
947 struct csinn_sigmoid_params *params);
948
949int shl_ref_sigmoid_quant(struct csinn_tensor *input, struct csinn_tensor *output,
950 struct csinn_sigmoid_params *params);
951
952int shl_ref_sign_f32(struct csinn_tensor *input, struct csinn_tensor *output,
953 struct csinn_siso_params *params);
954
955int shl_ref_sign_quant(struct csinn_tensor *input, struct csinn_tensor *output,
956 struct csinn_siso_params *params);
957
958int shl_ref_sin_f32(struct csinn_tensor *input, struct csinn_tensor *output,
959 struct csinn_siso_params *params);
960
961int shl_ref_sin_quant(struct csinn_tensor *input, struct csinn_tensor *output,
962 struct csinn_siso_params *params);
963
964int shl_ref_sinh_f32(struct csinn_tensor *input, struct csinn_tensor *output,
965 struct csinn_siso_params *params);
966
967int shl_ref_sinh_quant(struct csinn_tensor *input, struct csinn_tensor *output,
968 struct csinn_siso_params *params);
969
970int shl_ref_slice_f32(struct csinn_tensor *input, struct csinn_tensor *output,
971 struct csinn_slice_params *params);
972
973int shl_ref_slice_quant(struct csinn_tensor *input, struct csinn_tensor *output,
974 struct csinn_slice_params *params);
975
976int shl_ref_softmax_f32(struct csinn_tensor *input, struct csinn_tensor *output,
977 struct csinn_softmax_params *params);
978
979int shl_ref_softmax_quant(struct csinn_tensor *input, struct csinn_tensor *output,
980 struct csinn_softmax_params *params);
981
982int shl_ref_softplus_f32(struct csinn_tensor *input, struct csinn_tensor *output,
983 struct csinn_siso_params *params);
984
985int shl_ref_softplus_quant(struct csinn_tensor *input, struct csinn_tensor *output,
986 struct csinn_siso_params *params);
987
988int shl_ref_softrelu_f32(struct csinn_tensor *input, struct csinn_tensor *output,
989 struct csinn_relu_params *params);
990
991int shl_ref_softrelu_quant(struct csinn_tensor *input, struct csinn_tensor *output,
992 struct csinn_relu_params *params);
993
994int shl_ref_softsign_f32(struct csinn_tensor *input, struct csinn_tensor *output,
995 struct csinn_siso_params *params);
996
997int shl_ref_softsign_quant(struct csinn_tensor *input, struct csinn_tensor *output,
998 struct csinn_siso_params *params);
999
1000int shl_ref_space_to_batch_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1001 struct csinn_space_to_batch_params *params);
1002
1003int shl_ref_space_to_batch_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1004 struct csinn_space_to_batch_params *params);
1005
1006int shl_ref_space_to_depth_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1007 struct csinn_space_to_depth_params *params);
1008
1009int shl_ref_space_to_depth_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1010 struct csinn_space_to_depth_params *params);
1011
1012int shl_ref_split_f32(struct csinn_tensor *input, struct csinn_tensor **output,
1013 struct csinn_split_params *params);
1014
1015int shl_ref_split_quant(struct csinn_tensor *input, struct csinn_tensor **output,
1016 struct csinn_split_params *params);
1017
1018int shl_ref_sqrt_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1019 struct csinn_siso_params *params);
1020
1021int shl_ref_sqrt_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1022 struct csinn_siso_params *params);
1023
1024int shl_ref_square_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1025 struct csinn_siso_params *params);
1026
1027int shl_ref_square_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1028 struct csinn_siso_params *params);
1029
1030int shl_ref_squeeze(struct csinn_tensor *input, struct csinn_tensor *output,
1031 struct csinn_squeeze_params *params);
1032
1033int shl_ref_squeeze_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1034 struct csinn_squeeze_params *params);
1035
1036int shl_ref_stack_f32(struct csinn_tensor **input, struct csinn_tensor *output,
1037 struct csinn_stack_params *params);
1038
1039int shl_ref_stack_quant(struct csinn_tensor **input, struct csinn_tensor *output,
1040 struct csinn_stack_params *params);
1041
1042int shl_ref_strided_slice(struct csinn_tensor *input, struct csinn_tensor *output,
1043 struct csinn_strided_slice_params *params);
1044
1045int shl_ref_strided_slice_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1046 struct csinn_strided_slice_params *params);
1047
1048int shl_ref_strided_slice_f16(struct csinn_tensor *input, struct csinn_tensor *output,
1049 struct csinn_strided_slice_params *params);
1050
1051int shl_ref_strided_slice_i8(struct csinn_tensor *input, struct csinn_tensor *output,
1052 struct csinn_strided_slice_params *params);
1053
1054int shl_ref_strided_slice_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1055 struct csinn_strided_slice_params *params);
1056
1057int shl_ref_sub_f32(struct csinn_tensor *input0, struct csinn_tensor *input1,
1058 struct csinn_tensor *output, struct csinn_diso_params *params);
1059
1060int shl_ref_sub_quant(struct csinn_tensor *input0, struct csinn_tensor *input1,
1061 struct csinn_tensor *output, struct csinn_diso_params *params);
1062
1063int shl_ref_sum_stride_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1064 struct csinn_reduce_params *params);
1065
1066int shl_ref_sum_stride_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1067 struct csinn_reduce_params *params);
1068
1069int shl_ref_tan_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1070 struct csinn_siso_params *params);
1071
1072int shl_ref_tan_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1073 struct csinn_siso_params *params);
1074
1075int shl_ref_tanh_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1076 struct csinn_siso_params *params);
1077
1078int shl_ref_tanh_f64(struct csinn_tensor *input, struct csinn_tensor *output,
1079 struct csinn_siso_params *params);
1080
1081int shl_ref_tanh_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1082 struct csinn_siso_params *params);
1083
1084int shl_ref_threshold_relu_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1085 struct csinn_relu_params *params);
1086
1087int shl_ref_threshold_relu_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1088 struct csinn_relu_params *params);
1089
1090int shl_ref_tile_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1091 struct csinn_tile_params *params);
1092
1093int shl_ref_tile_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1094 struct csinn_tile_params *params);
1095
1096int shl_ref_topk_f32(struct csinn_tensor *input, struct csinn_tensor *output1,
1097 struct csinn_tensor *output2, struct csinn_topk_params *params);
1098
1099int shl_ref_topk_quant(struct csinn_tensor *input, struct csinn_tensor *output1,
1100 struct csinn_tensor *output2, struct csinn_topk_params *params);
1101
1102int shl_ref_transpose(struct csinn_tensor *input, struct csinn_tensor *output,
1103 struct csinn_transpose_params *params);
1104
1105int shl_ref_transpose_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1106 struct csinn_transpose_params *params);
1107
1108int shl_ref_trunc_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1109 struct csinn_siso_params *params);
1110
1111int shl_ref_trunc_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1112 struct csinn_siso_params *params);
1113
1114int shl_ref_unpooling_f32(struct csinn_tensor *input, struct csinn_tensor *mask,
1115 struct csinn_tensor *output, struct csinn_unpooling_params *params);
1116
1117int shl_ref_unpooling_quant(struct csinn_tensor *input, struct csinn_tensor *mask,
1118 struct csinn_tensor *output, struct csinn_unpooling_params *params);
1119
1120int shl_ref_unstack_f32(struct csinn_tensor *input, struct csinn_tensor **output,
1121 struct csinn_unstack_params *params);
1122
1123int shl_ref_unstack_qunat(struct csinn_tensor *input, struct csinn_tensor **output,
1124 struct csinn_unstack_params *params);
1125
1126int shl_ref_xor_u32(struct csinn_tensor *input0, struct csinn_tensor *input1,
1127 struct csinn_tensor *output, struct csinn_diso_params *params);
1128
1129int shl_ref_xor_u8(struct csinn_tensor *input0, struct csinn_tensor *input1,
1130 struct csinn_tensor *output, struct csinn_diso_params *params);
1131
1132int shl_ref_xor_i8(struct csinn_tensor *input0, struct csinn_tensor *input1,
1133 struct csinn_tensor *output, struct csinn_diso_params *params);
1134
1135int shl_ref_yuv_rgb_scale_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1136 struct csinn_siso_params *params);
1137
1138int shl_ref_yuv_rgb_scale_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1139 struct csinn_siso_params *params);
1140
1141int shl_ref_one_hot_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1142 struct csinn_one_hot_params *params);
1143
1144int shl_ref_one_hot_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1145 struct csinn_one_hot_params *params);
1146
1147int shl_ref_where_f32(struct csinn_tensor *condition, struct csinn_tensor *x,
1148 struct csinn_tensor *y, struct csinn_tensor *output,
1149 struct csinn_where_params *params);
1150
1151int shl_ref_where_quant(struct csinn_tensor *condition, struct csinn_tensor *x,
1152 struct csinn_tensor *y, struct csinn_tensor *output,
1153 struct csinn_where_params *params);
1154
1155int shl_ref_where_softmax_f32(struct csinn_tensor *condition, struct csinn_tensor *y,
1156 struct csinn_tensor *output,
1157 struct csinn_where_softmax_params *params);
1158
1159int shl_ref_where_softmax_quant(struct csinn_tensor *condition, struct csinn_tensor *y,
1160 struct csinn_tensor *output,
1161 struct csinn_where_softmax_params *params);
1162
1163int shl_ref_cast_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1164 struct csinn_cast_params *params);
1165
1166int shl_ref_cast_bool(struct csinn_tensor *input, struct csinn_tensor *output,
1167 struct csinn_cast_params *params);
1168
1169int shl_ref_cast_i64(struct csinn_tensor *input, struct csinn_tensor *output,
1170 struct csinn_cast_params *params);
1171
1172int shl_ref_cast_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1173 struct csinn_cast_params *params);
1174
1175int32_t shl_ref_max_internal_s32(int32_t a, int32_t b);
1176int32_t shl_ref_min_internal_s32(int32_t a, int32_t b);
1177int32_t shl_ref_get_index(int32_t *dim, int32_t index0, int32_t index1, int32_t index2,
1178 int32_t index3);
1179int32_t shl_ref_get_index_5(int32_t *dim, int32_t index0, int32_t index1, int32_t index2,
1180 int32_t index3, int32_t index4);
1181int32_t shl_ref_get_index_iter(int32_t *dim, int dim_count, int32_t *index);
1182float shl_ref_get_scale(int32_t multiplier, int32_t shift);
1183float shl_ref_dequantize_u8_to_f32(uint8_t input, struct csinn_quant_info *qinfo);
1184float shl_ref_dequantize_i8_to_f32(int8_t input, struct csinn_quant_info *qinfo);
1185uint8_t shl_ref_quantize_f32_to_u8(float input, struct csinn_quant_info *qinfo);
1186int8_t shl_ref_quantize_f32_to_i8(float input, struct csinn_quant_info *qinfo);
1187uint8_t shl_ref_quantize_channel_u8(int32_t data, struct csinn_tensor *input,
1188 struct csinn_tensor *output, float wscale);
1189int8_t shl_ref_quantize_channel_i8(int32_t data, struct csinn_tensor *input,
1190 struct csinn_tensor *output, float wscale);
1191float shl_ref_uint8_to_float(uint8_t i, struct csinn_tensor *t);
1192float shl_ref_int8_to_float(int8_t i, struct csinn_tensor *t);
1193int16_t shl_ref_float32_to_float16(float value);
1194float shl_ref_float16_to_float32(int16_t value);
1195int16_t shl_ref_float32_to_bfloat16(float value);
1196float shl_ref_bfloat16_to_float32(int16_t value);
1197struct csinn_tensor *shl_ref_nchw_to_nhwc_8(struct csinn_tensor *t);
1198void shl_ref_nhwc_to_nchw_8(struct csinn_tensor *nt, struct csinn_tensor *t);
1199struct csinn_tensor *shl_ref_deconv_kernel_nchw_to_nhwc_f32(struct csinn_tensor *t,
1200 int32_t permute[4]);
1201struct csinn_tensor *shl_ref_nchw_to_nhwc_f32(struct csinn_tensor *t);
1202void shl_ref_nhwc_to_nchw_f32(struct csinn_tensor *nt, struct csinn_tensor *t);
1203int32_t shl_ref_get_reduction_index(int32_t k, const int32_t *strides, const int32_t *extents,
1204 int32_t n);
1205struct csinn_tensor *shl_ref_alloc_float_tensor(struct csinn_tensor *src);
1206void shl_ref_free_float_tensor(struct csinn_tensor *src);
1207struct csinn_tensor *shl_ref_convert_float_tensor(struct csinn_tensor *src);
1208void shl_ref_conv_free_float_tensor(struct csinn_tensor *input, struct csinn_tensor *output,
1209 struct csinn_tensor *kernel, struct csinn_tensor *bias);
1210struct csinn_tensor *shl_ref_tensor_transform_f32(struct csinn_tensor *input);
1211int shl_ref_tensor_transform_free_f32(struct csinn_tensor *input);
1212uint8_t *shl_ref_f32_to_input_dtype(uint32_t index, float *data, struct csinn_session *sess);
1213
1214struct shl_ref_diso_callback {
1215 void (*bc)();
1216 struct csinn_tensor *input0;
1217 struct csinn_tensor *input1;
1218 struct csinn_tensor *output;
1219 int32_t *input_dim;
1220};
1221
1222int shl_ref_diso_broadcast_base(struct csinn_tensor *input0, struct csinn_tensor *input1,
1223 struct csinn_tensor *output, struct csinn_diso_params *params,
1224 struct shl_ref_diso_callback *cb);
1225int shl_ref_broadcast_to_shape(struct csinn_tensor *input, struct csinn_tensor *output,
1226 int32_t *shape, int32_t shape_count);
1227int shl_ref_broadcast_to_shape_f32(struct csinn_tensor *input, struct csinn_tensor *output,
1228 int32_t *shape, int32_t shape_count);
1229int shl_ref_broadcast_to_shape_quant(struct csinn_tensor *input, struct csinn_tensor *output,
1230 int32_t *shape, int32_t shape_count);
1231
1232int shl_ref_siso_callback_base(struct csinn_tensor *input, struct csinn_tensor *output,
1233 void *params, void *cb);
1234int shl_ref_diso_callback_base(struct csinn_tensor *input0, struct csinn_tensor *input1,
1235 struct csinn_tensor *output, void *params, void *cb);
1236int shl_ref_conv_callback_base(struct csinn_tensor *input, struct csinn_tensor *output,
1237 struct csinn_tensor *kernel, struct csinn_tensor *bias, void *params,
1238 void *cb);
1239
1240void shl_ref_nn_init(struct csinn_tensor *input, struct csinn_tensor *output);
1241
1242void shl_ref_nn_deinit(struct csinn_tensor *input, struct csinn_tensor *output);
1243
1244int shl_ref_flatten_init(struct csinn_tensor *input, struct csinn_tensor *output,
1245 struct csinn_reshape_params *params);
1246
1247int shl_ref_reshape_init(struct csinn_tensor *input, struct csinn_tensor *output,
1248 struct csinn_reshape_params *params);
1249
1250int shl_ref_transpose_init(struct csinn_tensor *input, struct csinn_tensor *output,
1251 struct csinn_transpose_params *params);
1252
1253void asr_buffer_init(struct csinn_asr_buffer_t *buffer, size_t buffer_size, size_t data_lenth);
1254
1255void *asr_buffer_insert_front(struct csinn_asr_buffer_t *buffer, void *input, size_t len);
1256
1257void *asr_buffer_insert_back(struct csinn_asr_buffer_t *buffer, void *input, size_t len);
1258
1259void *asr_buffer_get_buffer(struct csinn_asr_buffer_t *buffer);
1260
1261void asr_buffer_reset(struct csinn_asr_buffer_t *buffer);
1262
1263#ifdef __cplusplus
1264}
1265#endif
1266
1267#endif // INCLUDE_SHL_REF_H_
Definition: csinn_data_structure.h:893
Definition: csinn_data_structure.h:959
Definition: csinn_data_structure.h:705
Definition: csinn_data_structure.h:1074
Definition: csinn_data_structure.h:1117
Definition: csinn_data_structure.h:1081
Definition: csinn_data_structure.h:1024
Definition: csinn_data_structure.h:780
Definition: csinn_data_structure.h:1162
Definition: csinn_data_structure.h:553
Definition: csinn_data_structure.h:575
Definition: csinn_data_structure.h:1067
Definition: csinn_data_structure.h:1060
Definition: csinn_data_structure.h:984
Definition: csinn_data_structure.h:753
Definition: csinn_data_structure.h:837
Definition: csinn_data_structure.h:596
Definition: csinn_data_structure.h:849
Definition: csinn_data_structure.h:543
Definition: csinn_data_structure.h:924
Definition: csinn_data_structure.h:919
Definition: csinn_data_structure.h:1011
Definition: csinn_data_structure.h:715
Definition: csinn_data_structure.h:727
Definition: csinn_data_structure.h:746
Definition: csinn_data_structure.h:936
Definition: csinn_data_structure.h:1109
Definition: csinn_data_structure.h:991
Definition: csinn_data_structure.h:763
Definition: csinn_data_structure.h:605
Definition: csinn_data_structure.h:686
Definition: csinn_data_structure.h:787
Definition: csinn_data_structure.h:808
Definition: csinn_data_structure.h:464
Definition: csinn_data_structure.h:1033
Definition: csinn_data_structure.h:676
Definition: csinn_data_structure.h:825
Definition: csinn_data_structure.h:773
Definition: csinn_data_structure.h:843
Definition: csinn_data_structure.h:636
Definition: csinn_data_structure.h:649
Definition: csinn_data_structure.h:666
Definition: csinn_data_structure.h:1053
Definition: csinn_data_structure.h:758
Definition: csinn_data_structure.h:502
Definition: csinn_data_structure.h:832
Definition: csinn_data_structure.h:1097
Definition: csinn_data_structure.h:671
Definition: csinn_data_structure.h:661
Definition: csinn_data_structure.h:862
Definition: csinn_data_structure.h:692
Definition: csinn_data_structure.h:941
Definition: csinn_data_structure.h:978
Definition: csinn_data_structure.h:871
Definition: csinn_data_structure.h:929
Definition: csinn_data_structure.h:879
Definition: csinn_data_structure.h:1088
Definition: csinn_data_structure.h:475
struct csinn_session * sess
Definition: csinn_data_structure.h:489
void * data
Definition: csinn_data_structure.h:476
Definition: csinn_data_structure.h:886
Definition: csinn_data_structure.h:1103
Definition: csinn_data_structure.h:818
Definition: csinn_data_structure.h:627
Definition: csinn_data_structure.h:912
Definition: csinn_data_structure.h:907
Definition: csinn_data_structure.h:698