@@ -32,10 +32,7 @@ include "mlir/Dialect/Tosa/IR/TosaOpBase.td"
32
32
//===----------------------------------------------------------------------===//
33
33
// Operator: argmax
34
34
//===----------------------------------------------------------------------===//
35
- def Tosa_ArgMaxOp : Tosa_Op<"argmax", [
36
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
37
- ["inferReturnTypeComponents"]>,
38
- Pure]> {
35
+ def Tosa_ArgMaxOp : Tosa_Op<"argmax", [InferShapedTypeOpAdaptor, Pure]> {
39
36
let summary = "Perform argmax on the input.";
40
37
41
38
let description = [{
@@ -62,10 +59,7 @@ def Tosa_AccType : AnyTypeOf<[I<32>, SI<32>, F16, F32]>;
62
59
//===----------------------------------------------------------------------===//
63
60
// Operator: avg_pool2d
64
61
//===----------------------------------------------------------------------===//
65
- def Tosa_AvgPool2dOp : Tosa_Op<"avg_pool2d", [
66
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
67
- ["inferReturnTypeComponents"]>,
68
- Pure]> {
62
+ def Tosa_AvgPool2dOp : Tosa_Op<"avg_pool2d", [InferShapedTypeOpAdaptor, Pure]> {
69
63
let summary = "Performs max pooling on the input.";
70
64
71
65
let description = [{
@@ -95,10 +89,7 @@ def Tosa_AvgPool2dOp : Tosa_Op<"avg_pool2d", [
95
89
//===----------------------------------------------------------------------===//
96
90
// Operator: conv2d
97
91
//===----------------------------------------------------------------------===//
98
- def Tosa_Conv2DOp : Tosa_Op<"conv2d", [
99
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
100
- ["inferReturnTypeComponents"]>,
101
- Pure]> {
92
+ def Tosa_Conv2DOp : Tosa_Op<"conv2d", [InferShapedTypeOpAdaptor, Pure]> {
102
93
let summary = "2D Convolution Operator";
103
94
104
95
let description = [{
@@ -128,10 +119,7 @@ def Tosa_Conv2DOp : Tosa_Op<"conv2d", [
128
119
//===----------------------------------------------------------------------===//
129
120
// Operator: conv3d
130
121
//===----------------------------------------------------------------------===//
131
- def Tosa_Conv3DOp : Tosa_Op<"conv3d", [
132
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
133
- ["inferReturnTypeComponents"]>,
134
- Pure]> {
122
+ def Tosa_Conv3DOp : Tosa_Op<"conv3d", [InferShapedTypeOpAdaptor, Pure]> {
135
123
let summary = "3D Convolution operator";
136
124
137
125
let description = [{
@@ -160,10 +148,8 @@ def Tosa_Conv3DOp : Tosa_Op<"conv3d", [
160
148
//===----------------------------------------------------------------------===//
161
149
// Operator: depthwise_conv2d
162
150
//===----------------------------------------------------------------------===//
163
- def Tosa_DepthwiseConv2DOp : Tosa_Op<"depthwise_conv2d", [
164
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
165
- ["inferReturnTypeComponents"]>,
166
- Pure]> {
151
+ def Tosa_DepthwiseConv2DOp : Tosa_Op<"depthwise_conv2d",
152
+ [InferShapedTypeOpAdaptor, Pure]> {
167
153
let summary = "Depthwise 2D Convolution operator";
168
154
169
155
let description = [{
@@ -193,10 +179,7 @@ def Tosa_DepthwiseConv2DOp : Tosa_Op<"depthwise_conv2d", [
193
179
//===----------------------------------------------------------------------===//
194
180
// Operator: fft2d
195
181
//===----------------------------------------------------------------------===//
196
- def Tosa_FFT2dOp : Tosa_Op<"fft2d", [
197
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
198
- ["inferReturnTypeComponents"]>,
199
- Pure]> {
182
+ def Tosa_FFT2dOp : Tosa_Op<"fft2d", [InferShapedTypeOpAdaptor, Pure]> {
200
183
let summary = "Performs FFT2D operation on the input.";
201
184
202
185
let description = [{
@@ -224,9 +207,7 @@ def Tosa_FFT2dOp : Tosa_Op<"fft2d", [
224
207
// Operator: fully_connected
225
208
//===----------------------------------------------------------------------===//
226
209
def Tosa_FullyConnectedOp : Tosa_Op<"fully_connected", [
227
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
228
- ["inferReturnTypeComponents"]>,
229
- Pure]> {
210
+ InferShapedTypeOpAdaptor, Pure]> {
230
211
let summary = "Fully Connected operator";
231
212
232
213
let description = [{
@@ -251,10 +232,7 @@ def Tosa_FullyConnectedOp : Tosa_Op<"fully_connected", [
251
232
//===----------------------------------------------------------------------===//
252
233
// Operator: matmul
253
234
//===----------------------------------------------------------------------===//
254
- def Tosa_MatMulOp : Tosa_Op<"matmul", [
255
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
256
- ["inferReturnTypeComponents"]>,
257
- Pure]> {
235
+ def Tosa_MatMulOp : Tosa_Op<"matmul", [InferShapedTypeOpAdaptor, Pure]> {
258
236
let summary = "Matrix multiplication with bias";
259
237
260
238
let description = [{
@@ -279,10 +257,7 @@ def Tosa_MatMulOp : Tosa_Op<"matmul", [
279
257
//===----------------------------------------------------------------------===//
280
258
// Operator: max_pool2d
281
259
//===----------------------------------------------------------------------===//
282
- def Tosa_MaxPool2dOp : Tosa_Op<"max_pool2d", [
283
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
284
- ["inferReturnTypeComponents"]>,
285
- Pure]> {
260
+ def Tosa_MaxPool2dOp : Tosa_Op<"max_pool2d", [InferShapedTypeOpAdaptor, Pure]> {
286
261
let summary = "Performs max pooling on the input.";
287
262
288
263
let description = [{
@@ -310,10 +285,7 @@ def Tosa_MaxPool2dOp : Tosa_Op<"max_pool2d", [
310
285
//===----------------------------------------------------------------------===//
311
286
// Operator: rfft2d
312
287
//===----------------------------------------------------------------------===//
313
- def Tosa_RFFT2dOp : Tosa_Op<"rfft2d", [
314
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
315
- ["inferReturnTypeComponents"]>,
316
- Pure]> {
288
+ def Tosa_RFFT2dOp : Tosa_Op<"rfft2d", [InferShapedTypeOpAdaptor, Pure]> {
317
289
let summary = "Performs RFFT2D operation on the input.";
318
290
319
291
let description = [{
@@ -338,10 +310,8 @@ def Tosa_RFFT2dOp : Tosa_Op<"rfft2d", [
338
310
//===----------------------------------------------------------------------===//
339
311
// Operator: transpose_conv2d
340
312
//===----------------------------------------------------------------------===//
341
- def Tosa_TransposeConv2DOp : Tosa_Op<"transpose_conv2d", [
342
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
343
- ["inferReturnTypeComponents"]>,
344
- Pure]> {
313
+ def Tosa_TransposeConv2DOp : Tosa_Op<"transpose_conv2d",
314
+ [InferShapedTypeOpAdaptor, Pure]> {
345
315
let summary = "Transpose 2D Convolution operator.";
346
316
347
317
let description = [{
@@ -828,10 +798,7 @@ def Tosa_SubOp : Tosa_ElemWiseBinaryOp<"sub"> {
828
798
//===----------------------------------------------------------------------===//
829
799
// Operator: table
830
800
//===----------------------------------------------------------------------===//
831
- def Tosa_TableOp : Tosa_Op<"table", [
832
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
833
- ["inferReturnTypeComponents"]>,
834
- Pure]> {
801
+ def Tosa_TableOp : Tosa_Op<"table", [InferShapedTypeOpAdaptor, Pure]> {
835
802
let summary = "Table lookup op";
836
803
837
804
let description = [{
@@ -1214,7 +1181,7 @@ def Tosa_GreaterEqualOp : Tosa_Op<"greater_equal", [
1214
1181
// Operator: reduce_all
1215
1182
//===----------------------------------------------------------------------===//
1216
1183
def Tosa_ReduceAllOp : Tosa_Op<"reduce_all", [
1217
- InferTensorType , Pure]> {
1184
+ InferTensorTypeAdaptor , Pure]> {
1218
1185
let summary = "Reduce All operator";
1219
1186
1220
1187
let description = [{
@@ -1243,7 +1210,7 @@ def Tosa_ReduceAllOp : Tosa_Op<"reduce_all", [
1243
1210
// Operator: reduce_any
1244
1211
//===----------------------------------------------------------------------===//
1245
1212
def Tosa_ReduceAnyOp : Tosa_Op<"reduce_any", [
1246
- InferTensorType , Pure]> {
1213
+ InferTensorTypeAdaptor , Pure]> {
1247
1214
let summary = "Reduce Any operator";
1248
1215
1249
1216
let description = [{
@@ -1272,7 +1239,7 @@ def Tosa_ReduceAnyOp : Tosa_Op<"reduce_any", [
1272
1239
// Operator: reduce_max
1273
1240
//===----------------------------------------------------------------------===//
1274
1241
def Tosa_ReduceMaxOp : Tosa_Op<"reduce_max", [
1275
- InferTensorType , Pure]> {
1242
+ InferTensorTypeAdaptor , Pure]> {
1276
1243
let summary = "Reduce Max operator";
1277
1244
1278
1245
let description = [{
@@ -1301,7 +1268,7 @@ def Tosa_ReduceMaxOp : Tosa_Op<"reduce_max", [
1301
1268
// Operator: reduce_min
1302
1269
//===----------------------------------------------------------------------===//
1303
1270
def Tosa_ReduceMinOp : Tosa_Op<"reduce_min", [
1304
- InferTensorType , Pure]> {
1271
+ InferTensorTypeAdaptor , Pure]> {
1305
1272
let summary = "Reduce Min operator";
1306
1273
1307
1274
let description = [{
@@ -1330,7 +1297,7 @@ def Tosa_ReduceMinOp : Tosa_Op<"reduce_min", [
1330
1297
// Operator: reduce_prod
1331
1298
//===----------------------------------------------------------------------===//
1332
1299
def Tosa_ReduceProdOp : Tosa_Op<"reduce_prod", [
1333
- InferTensorType , Pure]> {
1300
+ InferTensorTypeAdaptor , Pure]> {
1334
1301
let summary = "Reduce Prod operator";
1335
1302
1336
1303
let description = [{
@@ -1359,7 +1326,7 @@ def Tosa_ReduceProdOp : Tosa_Op<"reduce_prod", [
1359
1326
// Operator: reduce_sum
1360
1327
//===----------------------------------------------------------------------===//
1361
1328
def Tosa_ReduceSumOp : Tosa_Op<"reduce_sum", [
1362
- InferTensorType , Pure]> {
1329
+ InferTensorTypeAdaptor , Pure]> {
1363
1330
let summary = "Reduce Sum operator";
1364
1331
1365
1332
let description = [{
@@ -1393,7 +1360,7 @@ def Tosa_ReduceSumOp : Tosa_Op<"reduce_sum", [
1393
1360
// Operator: concat
1394
1361
//===----------------------------------------------------------------------===//
1395
1362
def Tosa_ConcatOp : Tosa_Op<"concat", [
1396
- InferTensorType , Pure]> {
1363
+ InferTensorTypeAdaptor , Pure]> {
1397
1364
let summary = "Concatenates tensors along one dimension.";
1398
1365
1399
1366
let description = [{
@@ -1423,10 +1390,7 @@ def Tosa_ConcatOp : Tosa_Op<"concat", [
1423
1390
//===----------------------------------------------------------------------===//
1424
1391
// Operator: pad
1425
1392
//===----------------------------------------------------------------------===//
1426
- def Tosa_PadOp : Tosa_Op<"pad", [
1427
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
1428
- ["inferReturnTypeComponents"]>,
1429
- Pure]> {
1393
+ def Tosa_PadOp : Tosa_Op<"pad", [InferShapedTypeOpAdaptor, Pure]> {
1430
1394
let summary = "Pads a tensor with value specified.";
1431
1395
1432
1396
let description = [{
@@ -1471,7 +1435,7 @@ def Tosa_PadOp : Tosa_Op<"pad", [
1471
1435
// Operator: reshape
1472
1436
//===----------------------------------------------------------------------===//
1473
1437
def Tosa_ReshapeOp: Tosa_Op<"reshape", [
1474
- InferTensorType , Pure]> {
1438
+ InferTensorTypeAdaptor , Pure]> {
1475
1439
let summary = "Reshape operator";
1476
1440
1477
1441
let description = [{
@@ -1528,9 +1492,7 @@ def Tosa_ReverseOp: Tosa_Op<"reverse", [
1528
1492
//===----------------------------------------------------------------------===//
1529
1493
// Operator: slice
1530
1494
//===----------------------------------------------------------------------===//
1531
- def Tosa_SliceOp: Tosa_Op<"slice", [
1532
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
1533
- ["inferReturnTypeComponents"]>, Pure]> {
1495
+ def Tosa_SliceOp: Tosa_Op<"slice", [InferShapedTypeOpAdaptor, Pure]> {
1534
1496
let summary = "Slice operator";
1535
1497
1536
1498
let description = [{
@@ -1556,10 +1518,7 @@ def Tosa_SliceOp: Tosa_Op<"slice", [
1556
1518
//===----------------------------------------------------------------------===//
1557
1519
// Operator: tile
1558
1520
//===----------------------------------------------------------------------===//
1559
- def Tosa_TileOp: Tosa_Op<"tile", [
1560
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
1561
- ["inferReturnTypeComponents"]>,
1562
- Pure]> {
1521
+ def Tosa_TileOp: Tosa_Op<"tile", [InferShapedTypeOpAdaptor, Pure]> {
1563
1522
let summary = "Tile operator";
1564
1523
1565
1524
let description = [{
@@ -1580,10 +1539,7 @@ def Tosa_TileOp: Tosa_Op<"tile", [
1580
1539
//===----------------------------------------------------------------------===//
1581
1540
// Operator: transpose
1582
1541
//===----------------------------------------------------------------------===//
1583
- def Tosa_TransposeOp : Tosa_Op<"transpose", [
1584
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
1585
- ["inferReturnTypeComponents"]>,
1586
- Pure]> {
1542
+ def Tosa_TransposeOp : Tosa_Op<"transpose", [InferShapedTypeOpAdaptor, Pure]> {
1587
1543
let summary = "Transpose operator";
1588
1544
1589
1545
let description = [{
@@ -1615,10 +1571,7 @@ def Tosa_TransposeOp : Tosa_Op<"transpose", [
1615
1571
//===----------------------------------------------------------------------===//
1616
1572
// Operator: gather
1617
1573
//===----------------------------------------------------------------------===//
1618
- def Tosa_GatherOp : Tosa_Op<"gather", [
1619
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
1620
- ["inferReturnTypeComponents"]>,
1621
- Pure]> {
1574
+ def Tosa_GatherOp : Tosa_Op<"gather", [InferShapedTypeOpAdaptor, Pure]> {
1622
1575
let summary = "Gather operation,";
1623
1576
1624
1577
let description = [{
@@ -1639,10 +1592,7 @@ def Tosa_GatherOp : Tosa_Op<"gather", [
1639
1592
//===----------------------------------------------------------------------===//
1640
1593
// Operator: scatter
1641
1594
//===----------------------------------------------------------------------===//
1642
- def Tosa_ScatterOp : Tosa_Op<"scatter", [
1643
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
1644
- ["inferReturnTypeComponents"]>,
1645
- Pure]> {
1595
+ def Tosa_ScatterOp : Tosa_Op<"scatter", [InferShapedTypeOpAdaptor, Pure]> {
1646
1596
let summary = "Scatter operation,";
1647
1597
1648
1598
let description = [{
@@ -1669,10 +1619,7 @@ def Tosa_ScatterOp : Tosa_Op<"scatter", [
1669
1619
//===----------------------------------------------------------------------===//
1670
1620
// Operator: resize
1671
1621
//===----------------------------------------------------------------------===//
1672
- def Tosa_ResizeOp : Tosa_Op<"resize", [
1673
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
1674
- ["inferReturnTypeComponents"]>,
1675
- Pure]> {
1622
+ def Tosa_ResizeOp : Tosa_Op<"resize", [InferShapedTypeOpAdaptor, Pure]> {
1676
1623
1677
1624
let summary = "Resize operation, supports various resize/upsample modes";
1678
1625
@@ -1898,9 +1845,8 @@ def Tosa_CustomOp : Tosa_Op<"custom"> {
1898
1845
//===----------------------------------------------------------------------===//
1899
1846
// Further described in docs/Rationale/RationaleTOSADialect.md .
1900
1847
//===----------------------------------------------------------------------===//
1901
- def Tosa_IfOp : Tosa_Op<"cond_if", [
1902
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
1903
- ["inferReturnTypeComponents"]>,
1848
+ def Tosa_IfOp : Tosa_Op<"cond_if",
1849
+ [InferShapedTypeOpAdaptor,
1904
1850
SingleBlockImplicitTerminator<"YieldOp">,
1905
1851
RecursiveMemoryEffects]> {
1906
1852
let summary = "Conditional if operator";
@@ -1933,8 +1879,7 @@ def Tosa_IfOp : Tosa_Op<"cond_if", [
1933
1879
//===----------------------------------------------------------------------===//
1934
1880
def Tosa_WhileOp : Tosa_Op<"while_loop", [
1935
1881
DeclareOpInterfaceMethods<LoopLikeOpInterface>,
1936
- DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
1937
- ["inferReturnTypeComponents"]>,
1882
+ InferShapedTypeOpAdaptor,
1938
1883
SingleBlockImplicitTerminator<"YieldOp">,
1939
1884
RecursiveMemoryEffects]> {
1940
1885
let summary = "output = input; While (Cond(output)) {output = Body(output)}";
0 commit comments