Skip to content

Commit 813e43e

Browse files
authored
Merge pull request #38 from Xilinx/tiagot.lit_test_tosa_custom_op
Adds lit_tests for tosa.custom_op lowering to LinAlg.
2 parents e42a0b8 + 88b3950 commit 813e43e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,3 +1410,25 @@ func.func @select_fp32(%arg0: tensor<1x1x5x5xi1>, %arg1: tensor<1x12x5x5xf32>, %
14101410
return %0 : tensor<1x12x5x5xf32>
14111411
}
14121412

1413+
// -----
1414+
1415+
// CHECK-LABEL: @test_custom_ops
1416+
func.func @test_custom_ops(%arg0: tensor<1xf32>, %arg1: tensor<1xf32>) -> () {
1417+
// CHECK: linalg.generic
1418+
// CHECK: math.atan2
1419+
%2 = "tosa.custom"(%arg0, %arg1) <{config = "UNDEF", identifier = "atan2", implementation_attrs = "UNDEF"}> : (tensor<1xf32>, tensor<1xf32>) -> tensor<1xf32>
1420+
1421+
return
1422+
}
1423+
1424+
1425+
// -----
1426+
1427+
// CHECK-LABEL: @test_custom_ops_dyn
1428+
func.func @test_custom_ops_dyn(%arg0: tensor<?xf32>, %arg1: tensor<?xf32>) -> () {
1429+
// CHECK: linalg.generic
1430+
// CHECK: math.atan2
1431+
%2 = "tosa.custom"(%arg0, %arg1) <{config = "UNDEF", identifier = "atan2", implementation_attrs = "UNDEF"}> : (tensor<?xf32>, tensor<?xf32>) -> tensor<?xf32>
1432+
1433+
return
1434+
}

0 commit comments

Comments
 (0)