Skip to content

Commit 5c2f632

Browse files
Jerry-GeTai78641lhutton1
committed
[mlir][tosa] Add additional input output dtype verifiers for the following operators
- CastOp - ConcatOp - MatMulOp - PadOp - SliceOp - TileOp - ReshapeOp - TransposeOp - GatherOp - ScatterOp - MaxPool2dOp - ReverseOp - SelectOp Change-Id: I1e8a1017f21f617443bc40bae42189915048c750 Co-authored-by: Tai Ly <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Signed-off-by: Jerry Ge <[email protected]>
1 parent 2a7d3f0 commit 5c2f632

File tree

3 files changed

+373
-13
lines changed

3 files changed

+373
-13
lines changed

mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ def Tosa_MatMulOp : Tosa_InferShapedTypeOp<"matmul"> {
248248
);
249249

250250
let builders = [Tosa_MatMulOpQuantInfoBuilder];
251+
let hasVerifier = 1;
251252
}
252253

253254
//===----------------------------------------------------------------------===//
@@ -277,6 +278,7 @@ def Tosa_MaxPool2dOp : Tosa_InferShapedTypeOp<"max_pool2d"> {
277278
);
278279

279280
let hasCanonicalizer = 1;
281+
let hasVerifier = 1;
280282
}
281283

282284
//===----------------------------------------------------------------------===//
@@ -1200,6 +1202,7 @@ def Tosa_SelectOp : Tosa_ElementwiseOp<"select"> {
12001202
);
12011203
let hasCanonicalizeMethod = 1;
12021204
let hasFolder = 1;
1205+
let hasVerifier = 1;
12031206

12041207
let assemblyFormat = [{
12051208
operands attr-dict `:` `(` type($input1) `,` type($input2) `,` type($input3)
@@ -1528,6 +1531,7 @@ def Tosa_ConcatOp : Tosa_InferTensorTypeOp<"concat"> {
15281531

15291532
let hasCanonicalizer = 1;
15301533
let hasFolder = 1;
1534+
let hasVerifier = 1;
15311535

15321536
let extraClassDeclaration = [{
15331537
/// Returns true when two result types are compatible for this op;
@@ -1750,6 +1754,8 @@ def Tosa_GatherOp : Tosa_InferShapedTypeOp<"gather"> {
17501754
let results = (outs
17511755
Tosa_Tensor3D:$output
17521756
);
1757+
1758+
let hasVerifier = 1;
17531759
}
17541760

17551761
//===----------------------------------------------------------------------===//
@@ -1772,6 +1778,8 @@ def Tosa_ScatterOp : Tosa_InferShapedTypeOp<"scatter"> {
17721778
let results = (outs
17731779
Tosa_Tensor3D:$values_out
17741780
);
1781+
1782+
let hasVerifier = 1;
17751783
}
17761784

17771785
//===----------------------------------------------------------------------===//
@@ -1860,6 +1868,7 @@ def Tosa_CastOp: Tosa_Op<"cast", [Pure,
18601868
let assemblyFormat = "operands attr-dict `:` functional-type(operands, results)";
18611869

18621870
let hasFolder = 1;
1871+
let hasVerifier = 1;
18631872
}
18641873

18651874
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)