1/*
2 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted (subject to the limitations in the
6 * disclaimer below) provided that the following conditions are met:
7 *
8 *    * Redistributions of source code must retain the above copyright
9 *      notice, this list of conditions and the following disclaimer.
10 *
11 *    * Redistributions in binary form must reproduce the above
12 *      copyright notice, this list of conditions and the following
13 *      disclaimer in the documentation and/or other materials provided
14 *      with the distribution.
15 *
16 *    * Neither the name of The Linux Foundation nor the names of its
17 *      contributors may be used to endorse or promote products derived
18 *      from this software without specific prior written permission.
19 * '
20 * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
21 * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
22 * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
26 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
28 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
30 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
31 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
32 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
35
36/*
37 * You probably want to
38 *
39 *    ##    #####   #####
40 *   #  #   #    #  #    #
41 *  #    #  #    #  #    #
42 *  ######  #    #  #    #
43 *  #    #  #    #  #    #
44 *  #    #  #####   #####
45 *
46 *
47 *  #    #   ####   #####   ######   ####
48 *  ##   #  #    #  #    #  #       #
49 *  # #  #  #    #  #    #  #####    ####
50 *  #  # #  #    #  #    #  #            #
51 *  #   ##  #    #  #    #  #       #    #
52 *  #    #   ####   #####   ######   ####
53 *
54 *
55 *    ##     #####
56 *   #  #      #
57 *  #    #     #
58 *  ######     #
59 *  #    #     #
60 *  #    #     #
61 *
62 *
63 *   #####  #    #  ######
64 *     #    #    #  #
65 *     #    ######  #####
66 *     #    #    #  #
67 *     #    #    #  #
68 *     #    #    #  ######
69 *
70 *
71 *  ######  #    #  #####
72 *  #       ##   #  #    #
73 *  #####   # #  #  #    #
74 *  #       #  # #  #    #
75 *  #       #   ##  #    #
76 *  ######  #    #  #####
77 *
78 * otherwise the interface becomes incompatible.
79 */
80
81/**
82 * This file comes from:
83 * https://source.codeaurora.org/quic/hexagon_nn/nnlib/tree/interface/ops.def
84 */
85
86DEF_OP(INPUT)
87DEF_OP(OUTPUT)
88DEF_OP(Nop)
89DEF_OP(Const)
90DEF_OP(Check)
91DEF_OP(Close_f)
92DEF_OP(Close_quint8)
93DEF_OP(Close_q_quint8)
94DEF_OP(Close_int32)
95DEF_OP(Close_qint32)
96DEF_OP(PPrint_8)
97DEF_OP(PPrint_32)
98DEF_OP(PPrint_f)
99DEF_OP(PreFree)
100DEF_OP(Flatten)
101
102#ifndef DEF_OP_WREF
103#define DEF_OP_WREF(NAME) DEF_OP(NAME) DEF_OP(NAME##_ref)
104#define __SELF_DEF_OP_WREF
105#endif
106
107DEF_OP_WREF(QuantizedConv2d_8x8to32)
108DEF_OP_WREF(QuantizedMatMul_8x8to32)
109DEF_OP_WREF(QuantizeDownAndShrinkRange_32to8)
110DEF_OP_WREF(QuantizedRelu_8)
111DEF_OP_WREF(QuantizedReluX_8)
112DEF_OP_WREF(QuantizedMaxPool_8)
113DEF_OP_WREF(QuantizedAvgPool_8)
114DEF_OP_WREF(QuantizedL2Pool_8)
115DEF_OP_WREF(QuantizedConcat_8)
116DEF_OP_WREF(QuantizedBiasAdd_8p8to32)
117DEF_OP_WREF(Min_f)
118DEF_OP_WREF(Max_f)
119DEF_OP_WREF(Quantize)
120DEF_OP_WREF(Dequantize)
121DEF_OP_WREF(Supernode_8x8p8to8)
122
123DEF_OP(QuantizedFlatten)
124DEF_OP(Softmax_f)
125DEF_OP(Conv2d_f)
126DEF_OP(MatMul_f)
127DEF_OP(Relu_f)
128DEF_OP(ReluX_f)
129DEF_OP(AvgPool_f)
130DEF_OP(L2Pool_f)
131DEF_OP(MaxPool_f)
132DEF_OP(Concat_f)
133DEF_OP(BiasAdd_f)
134DEF_OP(LRN_f)
135
136DEF_OP(Variable)
137DEF_OP(Assign)
138DEF_OP(Reshape)
139DEF_OP(QuantizedReshape)
140DEF_OP(Tanh_f)
141DEF_OP(Sigmoid_f)
142DEF_OP(Slice_8)
143DEF_OP(Slice_f)
144DEF_OP(QuantizedSlice_8)
145DEF_OP(Add_f)
146DEF_OP(Mul_f)
147DEF_OP(Minimum_f)
148DEF_OP(Maximum_f)
149
150DEF_OP_WREF(Requantize_32to8)
151DEF_OP_WREF(RequantizationRange_32)
152
153DEF_OP(Neg_f)
154DEF_OP(Sub_f)
155DEF_OP(AddN_f)
156DEF_OP(Range_int32)
157DEF_OP(Rank_int32)
158DEF_OP(Transpose_int32)
159DEF_OP(Transpose_f)
160DEF_OP(InstanceNorm_f)
161DEF_OP_WREF(QuantizedInstanceNorm_8)
162DEF_OP(Sub_int32)
163DEF_OP(Add_int32)
164DEF_OP(Split_f)
165DEF_OP(Dequantize_qint32_f)
166DEF_OP(PRelu_f)
167DEF_OP_WREF(QuantizedPRelu_8)
168DEF_OP(Sum_f)
169DEF_OP(Prod_f)
170DEF_OP(Mul_int32)
171DEF_OP(LogicalAnd_int32)
172DEF_OP(LogicalOr_int32)
173DEF_OP(LogicalXor_int32)
174DEF_OP(Shape_int32)
175DEF_OP(Pack_int32)
176DEF_OP(MirrorPad_f)
177DEF_OP(ResizeNearestNeighbor_f)
178DEF_OP(StridedSlice_int32)
179DEF_OP(StridedSlice_f)
180DEF_OP(ExpandDims_int32)
181DEF_OP(ExpandDims_f)
182
183DEF_OP(LogSoftmax_f)
184DEF_OP(Split_int32)
185DEF_OP(QuantizedSplit_8)
186
187DEF_OP(Deconv_f)
188DEF_OP_WREF(QuantizedDeconv_8x8to32)
189
190DEF_OP_WREF(QuantizedMul_8x8to32)
191DEF_OP_WREF(QuantizedAdd_8p8to32)
192DEF_OP_WREF(QuantizedSigmoid_8)
193DEF_OP_WREF(QuantizedTanh_8)
194DEF_OP_WREF(QuantizedSoftmax_8)
195DEF_OP_WREF(QuantizedLRN_8)
196DEF_OP_WREF(Quantizedpad2d_frame_8p)
197DEF_OP_WREF(QuantizedSub_8p8to32)
198DEF_OP_WREF(QuantizedMaximum_8)
199DEF_OP_WREF(QuantizedMinimum_8)
200
201DEF_OP(Pad_f)
202DEF_OP(SpaceToBatchND_f)
203DEF_OP(BatchToSpaceND_f)
204DEF_OP(QuantizedPad_8)
205DEF_OP(ResizeBilinear_f)
206DEF_OP(ConcatV2_f)
207DEF_OP(ConcatV2_int32)
208DEF_OP(Prod_int32)
209DEF_OP(Slice_int32)
210
211DEF_OP(QuantizedAdd_8p8to8)
212DEF_OP(QuantizedResizeBilinear_8)
213DEF_OP(Supernode_8x8p8to8_d32)
214DEF_OP(Convert_to_d32)
215DEF_OP(Convert_from_d32)
216DEF_OP_WREF(QuantizedMaxPool_8_d32)
217DEF_OP_WREF(QuantizedConcat_8_d32)
218DEF_OP_WREF(QuantizedAvgPool_8_d32)
219
220DEF_OP(Sink)
221
222DEF_OP_WREF(QuantizedPRelu_8_d32)
223DEF_OP_WREF(AutoQuantize)
224DEF_OP_WREF(QuantizedDepthwiseConv2d_8x8to32)
225DEF_OP_WREF(DepthwiseConv2d_f)
226DEF_OP(DepthwiseSupernode_8x8p8to8)
227DEF_OP(DepthwiseSupernode_8x8p8to8_d32)
228
229DEF_OP_WREF(QuantizedMul_8x8to8_d32)
230
231DEF_OP(FullyConnected_u8)
232#if 0
233DEF_OP_WREF(QuantizedFC_8x8p8to8)
234#endif
235
236DEF_OP_WREF(QuantizedAdd_8p8to8_d32)
237
238DEF_OP_WREF(QuantizedClamp_8)
239DEF_OP(Clamp_f)
240DEF_OP(QuantizeForTest_d32)
241DEF_OP(Close_d32)
242DEF_OP_WREF(QuantizedSub_8p8to8_d32)
243
244DEF_OP(InputSupernode_8x8p8to8_outd32)
245DEF_OP(QuantizedLRN_8_d32)
246DEF_OP_WREF(QuantizedBiasAdd_32p32to32)
247DEF_OP_WREF(Quantize_int32)
248
249DEF_OP(Supernode_8x8p32to8)
250DEF_OP(DepthwiseSupernode_8x8p32to8)
251DEF_OP(Supernode_8x8p32to8_d32)
252DEF_OP(DepthwiseSupernode_8x8p32to8_d32)
253DEF_OP(InputSupernode_8x8p32to8_outd32)
254
255DEF_OP(PPrint_8_d32)
256DEF_OP(PPrintWithPadding_8_d32)
257DEF_OP_WREF(AutoQuantize_d32)
258
259DEF_OP_WREF(QuantizedTanh_8_d32)
260DEF_OP_WREF(QuantizedSigmoid_8_d32)
261DEF_OP_WREF(QuantizedSoftmax_8_d32)
262
263
264DEF_OP_WREF(QuantizedL2Pool_8_d32)
265
266DEF_OP(Gather_f)
267DEF_OP(Gather_int32)
268DEF_OP(Gather_8)
269DEF_OP(Table_f)
270DEF_OP(Table_int32)
271DEF_OP(Table_8)
272
273DEF_OP(FillPadding_8_d32)
274DEF_OP(QuantizedResizeBilinear_8_d32)
275
276DEF_OP(QuantizeINPUT_f_to_8)
277DEF_OP_WREF(DeconvBias_8x8to32)
278
279DEF_OP(SpaceToBatchND_8)
280DEF_OP(BatchToSpaceND_8)
281
282
283DEF_OP(SpaceToDepth_f)
284DEF_OP(DepthToSpace_f)
285DEF_OP(SpaceToDepth_8)
286DEF_OP(DepthToSpace_8)
287
288#ifdef __SELF_DEF_OP_WREF
289#undef __SELF_DEF_OP_WREF
290#undef DEF_OP_WREF
291#endif
292
293