Skip to content

Commit 9cc942f

Browse files
authored
Enable I8 and I1 testcases (#536)
* add int8to32 cast * enable int8 test cases * enable Logicalxxx (i1) and BitNot (i8) test cases * format fix
1 parent 0301bc3 commit 9cc942f

14 files changed

+270
-60
lines changed

test/PlaidML/CppEdsl.BitNot.mlir

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,26 @@ module @bit_not {
1111
func.func @main() {
1212
%0= arith.constant dense<[[0, 1, 2], [16, 17, 34], [240, 15, 255]]>:tensor<3x3xi8>
1313
%1 = call @test(%0) : (tensor<3x3xi8>) -> tensor<3x3xi8>
14-
%unranked = tensor.cast %1 : tensor<3x3xi8>to tensor<*xi8>
15-
call @printMemrefI32(%unranked) : (tensor<*xi8>) -> ()
14+
%2 = call @castI8toI32(%1): (tensor<3x3xi8>) -> tensor<3x3xi32>
15+
%unranked = tensor.cast %2 : tensor<3x3xi32> to tensor<*xi32>
16+
call @printMemrefI32(%unranked) : (tensor<*xi32>) -> ()
1617
return
1718
}
18-
func.func private @printMemrefI32(tensor<*xi8>)
19+
20+
func.func @castI8toI32(%arg0: tensor<3x3xi8>) -> tensor<3x3xi32> {
21+
%1 = tensor.empty() : tensor<3x3xi32>
22+
%2 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel", "parallel"]}
23+
ins(%arg0: tensor<3x3xi8>)
24+
outs(%1 : tensor<3x3xi32>)
25+
attrs = {iterator_ranges = [3, 3]} {
26+
^bb0(%arg1: i8, %arg2: i32):
27+
%3 = arith.extui %arg1: i8 to i32
28+
linalg.yield %3 : i32
29+
} -> tensor<3x3xi32>
30+
return %2: tensor<3x3xi32>
31+
}
32+
33+
func.func private @printMemrefI32(tensor<*xi32>)
1934
func.func @test(%arg0: tensor<3x3xi8>)->tensor<3x3xi8>{
2035
%0 = tensor.empty() : tensor<3x3xi8>
2136
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel", "parallel"]} ins(%arg0 : tensor<3x3xi8>) outs(%0 : tensor<3x3xi8>) {

test/PlaidML/CppEdsl.ConvI8.mlir

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#map2 = affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d4, d5, d6, d3)>
1212
#map3 = affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d0, d1, d2, d3)>
1313
module @convolution {
14-
func.func @test(%arg0: tensor<1x224x224x3xi8>, %arg1: tensor<3x3x3x32xi8>) -> tensor<1x224x224x32xi8> {
14+
func.func @test(%arg0: tensor<1x224x224x3xi8>, %arg1: tensor<3x3x3x32xi8>) -> tensor<1x224x224x32xi8> {
1515
%c0_i8 = arith.constant 0 : i8
1616
%0 = tensor.empty() : tensor<1x224x224x3xi8>
1717
%1 = linalg.generic {indexing_maps = [#map0, #map0], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%arg0 : tensor<1x224x224x3xi8>) outs(%0 : tensor<1x224x224x3xi8>) {
@@ -33,15 +33,31 @@ func.func @test(%arg0: tensor<1x224x224x3xi8>, %arg1: tensor<3x3x3x32xi8>) -> te
3333
} -> tensor<1x224x224x32xi8>
3434
return %5 : tensor<1x224x224x32xi8>
3535
}
36+
3637
func.func @main() {
3738
%0 = arith.constant dense<1> : tensor<1x224x224x3xi8>
3839
%1 = arith.constant dense<1> : tensor<3x3x3x32xi8>
3940
%2 = call @test(%0, %1) : (tensor<1x224x224x3xi8>, tensor<3x3x3x32xi8>) -> tensor<1x224x224x32xi8>
40-
%unranked = tensor.cast %2 : tensor<1x224x224x32xi8> to tensor<*xi8>
41-
call @printMemrefI8(%unranked) : (tensor<*xi8>) -> ()
41+
%3 = call @castI8toI32(%2): (tensor<1x224x224x32xi8>) -> tensor<1x224x224x32xi32>
42+
%unranked = tensor.cast %3 : tensor<1x224x224x32xi32> to tensor<*xi32>
43+
call @printMemrefI32(%unranked) : (tensor<*xi32>) -> ()
4244
return
4345
}
44-
// CHECK: Unranked Memref base@ = {{(0x)?[-9a-f]*}}
45-
// CHECK-NEXT:
46-
func.func private @printMemrefI8(tensor<*xi8>)
46+
47+
func.func @castI8toI32(%arg0: tensor<1x224x224x32xi8>) -> tensor<1x224x224x32xi32> {
48+
%1 = tensor.empty() : tensor<1x224x224x32xi32>
49+
%2 = linalg.generic {indexing_maps = [#map0, #map0], iterator_types = ["parallel", "parallel", "parallel", "parallel"]}
50+
ins(%arg0: tensor<1x224x224x32xi8>)
51+
outs(%1 : tensor<1x224x224x32xi32>)
52+
attrs = {iterator_ranges = [1, 224, 224, 32]} {
53+
^bb0(%arg1: i8, %arg2: i32):
54+
%3 = arith.extui %arg1: i8 to i32
55+
linalg.yield %3 : i32
56+
} -> tensor<1x224x224x32xi32>
57+
return %2: tensor<1x224x224x32xi32>
58+
}
59+
60+
// CHECK: Unranked Memref base@ = {{(0x)?[-9a-f]*}}
61+
// CHECK-NEXT: [12, 12]
62+
func.func private @printMemrefI32(tensor<*xi32>)
4763
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp \
2+
// RUN: --runner mlir-cpu-runner -e main \
3+
// RUN: --shared-libs=%mlir_runner_utils \
4+
// RUN: --entry-point-result=void | FileCheck %s
5+
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
6+
// RUN: --runner mlir-cpu-runner -e main \
7+
// RUN: --entry-point-result=void \
8+
// RUN: --shared-libs=%mlir_runner_utils,%sycl_runtime | FileCheck %s
9+
#map0 = affine_map<(d0, d1) -> (d0, d1)>
10+
#map1 = affine_map<(d0, d1) -> (d0 + 2, d1 + 1)>
11+
module @explicit_padding {
12+
func.func @main() {
13+
%0= arith.constant dense<[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]>:tensor<2x3xf32>
14+
%1 = call @test(%0) : (tensor<2x3xf32>) -> tensor<6x5xf32>
15+
%unranked = tensor.cast %1 : tensor<6x5xf32>to tensor<*xf32>
16+
call @printMemrefF32(%unranked) : (tensor<*xf32>) -> ()
17+
return
18+
}
19+
func.func private @printMemrefF32(tensor<*xf32>)
20+
func.func @test(%arg0: tensor<2x3xf32>)->tensor<6x5xf32>{
21+
%cst = arith.constant 0xFF800000 : f32
22+
%zero = arith.constant 0.0: f32
23+
%0 = tensor.empty() : tensor<6x5xf32>
24+
%1 = linalg.fill ins(%cst : f32) outs(%0 : tensor<6x5xf32>) -> tensor<6x5xf32>
25+
%2 = linalg.generic {indexing_maps = [#map0, #map1], iterator_types = ["parallel", "reduction"]} ins(%arg0 : tensor<2x3xf32>) outs(%1 : tensor<6x5xf32>) attrs = {iterator_ranges = [2, 3], name = "explicit_padding"} {
26+
^bb0(%arg1: f32, %arg2: f32):
27+
%m = arith.maxf %zero, %arg2: f32
28+
%o = arith.addf %m, %arg1: f32
29+
linalg.yield %o : f32
30+
} -> tensor<6x5xf32>
31+
return %2 : tensor<6x5xf32>
32+
}
33+
}
34+
// CHECK: Unranked Memref base@ = {{0x[-9a-f]*}}
35+
// CHECK-SAME: rank = {{.}} offset = {{.}} sizes = [6, 5] strides = {{.*}} data =
36+
// CHECK: -inf
37+
// CHECK: -inf
38+
// CHECK: -inf
39+
// CHECK: -inf
40+
// CHECK: -inf
41+
// CHECK: -inf
42+
// CHECK: -inf
43+
// CHECK: -inf
44+
// CHECK: -inf
45+
// CHECK: -inf
46+
// CHECK: -inf
47+
// CHECK: 1
48+
// CHECK: 2
49+
// CHECK: 3
50+
// CHECK: -inf
51+
// CHECK: -inf
52+
// CHECK: 4
53+
// CHECK: 5
54+
// CHECK: 6
55+
// CHECK: -inf
56+
// CHECK: -inf
57+
// CHECK: -inf
58+
// CHECK: -inf
59+
// CHECK: -inf
60+
// CHECK: -inf
61+
// CHECK: -inf
62+
// CHECK: -inf
63+
// CHECK: -inf
64+
// CHECK: -inf
65+
// CHECK: -inf

test/PlaidML/OpTest.GEMM_INT32.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func.func @main() {
1818
%3 = call @test(%0,%1,%2) : (tensor<3x3xi32>,tensor<3x3xi32>,tensor<3x3xi32>) -> tensor<3x3xi32>
1919
%unranked = tensor.cast %3 : tensor<3x3xi32>to tensor<*xi32>
2020
call @printMemrefI32(%unranked) : (tensor<*xi32>) -> ()
21-
// CHECK: Unranked Memref base@ = {{(0x)?[-9a-f]*}}
21+
// CHECK: Unranked Memref base@ = {{(0x)?[-9a-f]*}}
2222
// CHECK-NEXT: [40, 43, 46]
2323
// CHECK-NEXT: [56, 60, 64]
2424
// CHECK-NEXT: [118, 127, 136]

test/PlaidML/OpTest.GEMM_INT8.mlir

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,34 @@
1313
#map3 = affine_map<(d0, d1) -> (d0, d1)>
1414
module @gemm {
1515
func.func @main() {
16-
%0= arith.constant dense<[[1, 2, 3], [1, 1, 1], [1, 1, 1]]>:tensor<3x3xi8>
17-
%1 = arith.constant dense<[[1, 1, 1], [1, 2, 3], [1, 1, 1]]>:tensor<3x3xi8>
16+
%0= arith.constant dense<[[1, 1, 1], [1, 1, 2], [3, 3, 3]]>:tensor<3x3xi8>
17+
%1 = arith.constant dense<[[10, 11, 12], [13, 14, 15], [16, 17, 18]]>:tensor<3x3xi8>
1818
%2= arith.constant dense<[[1, 1, 1], [1, 1, 1], [1, 2, 3]]>:tensor<3x3xi8>
1919
%3 = call @test(%0,%1,%2) : (tensor<3x3xi8>,tensor<3x3xi8>,tensor<3x3xi8>) -> tensor<3x3xi8>
20-
%unranked = tensor.cast %3 : tensor<3x3xi8>to tensor<*xi8>
21-
call @printMemrefI8(%unranked) : (tensor<*xi8>) -> ()
22-
// CHECK:
20+
%4 = call @castI8toI32(%3): (tensor<3x3xi8>) -> tensor<3x3xi32>
21+
%unranked = tensor.cast %4 : tensor<3x3xi32>to tensor<*xi32>
22+
call @printMemrefI32(%unranked) : (tensor<*xi32>) -> ()
23+
// CHECK: Unranked Memref base@ = {{(0x)?[-9a-f]*}}
24+
// CHECK-NEXT: [40, 43, 46]
25+
// CHECK-NEXT: [56, 60, 64]
26+
// CHECK-NEXT: [118, 128, 138]
2327
return
2428
}
25-
func.func private @printMemrefI8(tensor<*xi8>)
29+
30+
func.func @castI8toI32(%arg0: tensor<3x3xi8>) -> tensor<3x3xi32> {
31+
%1 = tensor.empty() : tensor<3x3xi32>
32+
%2 = linalg.generic {indexing_maps = [#map3, #map3], iterator_types = ["parallel", "parallel"]}
33+
ins(%arg0: tensor<3x3xi8>)
34+
outs(%1 : tensor<3x3xi32>)
35+
attrs = {iterator_ranges = [3, 3]} {
36+
^bb0(%arg1: i8, %arg2: i32):
37+
%3 = arith.extui %arg1: i8 to i32
38+
linalg.yield %3 : i32
39+
} -> tensor<3x3xi32>
40+
return %2: tensor<3x3xi32>
41+
}
42+
43+
func.func private @printMemrefI32(tensor<*xi32>) attributes { llvm.emit_c_interface }
2644
func.func @test(%arg0: tensor<3x3xi8>, %arg1: tensor<3x3xi8>, %arg2: tensor<3x3xi8>) -> tensor<3x3xi8> {
2745
%c0_i8 = arith.constant 0 : i8
2846
%0 = tensor.empty() : tensor<3x3xi8>

test/PlaidML/OpTest.GEMV_INT8.mlir

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,26 @@ func.func @main() {
1717
%1= arith.constant dense<[1, 1, 1]>:tensor<3xi8>
1818
%2= arith.constant dense<[1, 1, 1]>:tensor<3xi8>
1919
%3 = call @test(%0,%1,%2) : (tensor<3x3xi8>,tensor<3xi8>,tensor<3xi8>) -> tensor<3xi8>
20-
%unranked = tensor.cast %3 : tensor<3xi8>to tensor<*xi8>
21-
call @printMemrefI8(%unranked) : (tensor<*xi8>) -> ()
22-
// CHECK:
20+
%4 = call @castI8toI32(%3): (tensor<3xi8>) -> tensor<3xi32>
21+
%unranked = tensor.cast %4 : tensor<3xi32>to tensor<*xi32>
22+
call @printMemrefI32(%unranked) : (tensor<*xi32>) -> ()
23+
// CHECK: Unranked Memref base@ = {{(0x)?[-9a-f]*}}
24+
// CHECK-NEXT: [7, 4, 4]
2325
return
2426
}
25-
func.func private @printMemrefI8(tensor<*xi8>)
27+
func.func @castI8toI32(%arg0: tensor<3xi8>) -> tensor<3xi32> {
28+
%1 = tensor.empty() : tensor<3xi32>
29+
%2 = linalg.generic {indexing_maps = [#map3, #map3], iterator_types = ["parallel"]}
30+
ins(%arg0: tensor<3xi8>)
31+
outs(%1 : tensor<3xi32>)
32+
attrs = {iterator_ranges = [3]} {
33+
^bb0(%arg1: i8, %arg2: i32):
34+
%3 = arith.extui %arg1: i8 to i32
35+
linalg.yield %3 : i32
36+
} -> tensor<3xi32>
37+
return %2: tensor<3xi32>
38+
}
39+
func.func private @printMemrefI32(tensor<*xi32>) attributes { llvm.emit_c_interface }
2640
func.func @test(%arg0: tensor<3x3xi8>, %arg1: tensor<3xi8>, %arg2: tensor<3xi8>) -> tensor<3xi8> {
2741
%c0_i8 = arith.constant 0 : i8
2842
%0 = tensor.empty() : tensor<3xi8>

test/PlaidML/OpTest.LogicalAnd_mixed.mlir

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,26 @@ func.func @main() {
1212
%0= arith.constant dense<[[1, 2, 3], [4, 0, 6], [7, 0, 9]]>:tensor<3x3xi64>
1313
%1= arith.constant dense<[[10.0, 11.0, 12.0], [13.0, 14.0, 15.0], [16.0, 17.0, 18.0]]>:tensor<3x3xf32>
1414
%2 = call @test(%0,%1) : (tensor<3x3xi64>,tensor<3x3xf32>) -> tensor<3x3xi1>
15-
%unranked = tensor.cast %2 : tensor<3x3xi1>to tensor<*xi1>
16-
call @printMemrefI32(%unranked) : (tensor<*xi1>) -> ()
15+
%3 = call @castI1toI32(%2): (tensor<3x3xi1>) -> tensor<3x3xi32>
16+
%unranked = tensor.cast %3 : tensor<3x3xi32>to tensor<*xi32>
17+
call @printMemrefI32(%unranked) : (tensor<*xi32>) -> ()
1718
return
1819
}
19-
func.func private @printMemrefI32(tensor<*xi1>)
20+
21+
func.func @castI1toI32(%arg0: tensor<3x3xi1>) -> tensor<3x3xi32> {
22+
%1 = tensor.empty() : tensor<3x3xi32>
23+
%2 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel", "parallel"]}
24+
ins(%arg0: tensor<3x3xi1>)
25+
outs(%1 : tensor<3x3xi32>)
26+
attrs = {iterator_ranges = [3, 3]} {
27+
^bb0(%arg1: i1, %arg2: i32):
28+
%3 = arith.extui %arg1: i1 to i32
29+
linalg.yield %3 : i32
30+
} -> tensor<3x3xi32>
31+
return %2: tensor<3x3xi32>
32+
}
33+
34+
func.func private @printMemrefI32(tensor<*xi32>)
2035
func.func @test(%arg0: tensor<3x3xi64>, %arg1: tensor<3x3xf32>)->tensor<3x3xi1>{
2136
%0 = tensor.empty() : tensor<3x3xi1>
2237
%1 = linalg.generic {indexing_maps = [#map, #map, #map], iterator_types = ["parallel", "parallel"]} ins(%arg0, %arg1 : tensor<3x3xi64>, tensor<3x3xf32>) outs(%0 : tensor<3x3xi1>) {

test/PlaidML/OpTest.LogicalAnd_uint64.mlir

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,26 @@ func.func @main() {
1212
%0= arith.constant dense<[[1, 2, 3], [4, 0, 6], [7, 0, 9]]>:tensor<3x3xi64>
1313
%1= arith.constant dense<[[10, 11, 12], [13, 14, 15], [16, 17, 18]]>:tensor<3x3xi64>
1414
%2 = call @test(%0,%1) : (tensor<3x3xi64>,tensor<3x3xi64>) -> tensor<3x3xi1>
15-
%unranked = tensor.cast %2 : tensor<3x3xi1>to tensor<*xi1>
16-
call @printMemrefI32(%unranked) : (tensor<*xi1>) -> ()
15+
%3 = call @castI1toI32(%2): (tensor<3x3xi1>) -> tensor<3x3xi32>
16+
%unranked = tensor.cast %3 : tensor<3x3xi32>to tensor<*xi32>
17+
call @printMemrefI32(%unranked) : (tensor<*xi32>) -> ()
1718
return
1819
}
19-
func.func private @printMemrefI32(tensor<*xi1>)
20+
21+
func.func @castI1toI32(%arg0: tensor<3x3xi1>) -> tensor<3x3xi32> {
22+
%1 = tensor.empty() : tensor<3x3xi32>
23+
%2 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel", "parallel"]}
24+
ins(%arg0: tensor<3x3xi1>)
25+
outs(%1 : tensor<3x3xi32>)
26+
attrs = {iterator_ranges = [3, 3]} {
27+
^bb0(%arg1: i1, %arg2: i32):
28+
%3 = arith.extui %arg1: i1 to i32
29+
linalg.yield %3 : i32
30+
} -> tensor<3x3xi32>
31+
return %2: tensor<3x3xi32>
32+
}
33+
34+
func.func private @printMemrefI32(tensor<*xi32>)
2035
func.func @test(%arg0: tensor<3x3xi64>, %arg1: tensor<3x3xi64>)->tensor<3x3xi1>{
2136
%0 = tensor.empty() : tensor<3x3xi1>
2237
%1 = linalg.generic {indexing_maps = [#map, #map, #map], iterator_types = ["parallel", "parallel"]} ins(%arg0, %arg1 : tensor<3x3xi64>, tensor<3x3xi64>) outs(%0 : tensor<3x3xi1>) {

test/PlaidML/OpTest.LogicalNot_float.mlir

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,26 @@ module @logical_not {
1111
func.func @main() {
1212
%0= arith.constant dense<[[1.0, 2.0, 3.0], [4.0, 0.0, 6.5], [7.7, 0.0, 0.9]]>:tensor<3x3xf32>
1313
%1 = call @test(%0) : (tensor<3x3xf32>) -> tensor<3x3xi1>
14-
%unranked = tensor.cast %1 : tensor<3x3xi1>to tensor<*xi1>
15-
call @printMemrefI32(%unranked) : (tensor<*xi1>) -> ()
14+
%2 = call @castI1toI32(%1): (tensor<3x3xi1>) -> tensor<3x3xi32>
15+
%unranked = tensor.cast %2 : tensor<3x3xi32>to tensor<*xi32>
16+
call @printMemrefI32(%unranked) : (tensor<*xi32>) -> ()
1617
return
1718
}
18-
func.func private @printMemrefI32(tensor<*xi1>)
19+
20+
func.func @castI1toI32(%arg0: tensor<3x3xi1>) -> tensor<3x3xi32> {
21+
%1 = tensor.empty() : tensor<3x3xi32>
22+
%2 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel", "parallel"]}
23+
ins(%arg0: tensor<3x3xi1>)
24+
outs(%1 : tensor<3x3xi32>)
25+
attrs = {iterator_ranges = [3, 3]} {
26+
^bb0(%arg1: i1, %arg2: i32):
27+
%3 = arith.extui %arg1: i1 to i32
28+
linalg.yield %3 : i32
29+
} -> tensor<3x3xi32>
30+
return %2: tensor<3x3xi32>
31+
}
32+
33+
func.func private @printMemrefI32(tensor<*xi32>)
1934
func.func @test(%arg0: tensor<3x3xf32>)->tensor<3x3xi1>{
2035
%0 = tensor.empty() : tensor<3x3xi1>
2136
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel", "parallel"]} ins(%arg0 : tensor<3x3xf32>) outs(%0 : tensor<3x3xi1>) {

test/PlaidML/OpTest.LogicalNot_int32.mlir

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,26 @@ module @logical_not {
1111
func.func @main() {
1212
%0= arith.constant dense<[[1, 2, 3], [4, 0, 6], [7, 0, 9]]>:tensor<3x3xi32>
1313
%1 = call @test(%0) : (tensor<3x3xi32>) -> tensor<3x3xi1>
14-
%unranked = tensor.cast %1 : tensor<3x3xi1>to tensor<*xi1>
15-
call @printMemrefI32(%unranked) : (tensor<*xi1>) -> ()
14+
%2 = call @castI1toI32(%1): (tensor<3x3xi1>) -> tensor<3x3xi32>
15+
%unranked = tensor.cast %2 : tensor<3x3xi32>to tensor<*xi32>
16+
call @printMemrefI32(%unranked) : (tensor<*xi32>) -> ()
1617
return
1718
}
18-
func.func private @printMemrefI32(tensor<*xi1>)
19+
20+
func.func @castI1toI32(%arg0: tensor<3x3xi1>) -> tensor<3x3xi32> {
21+
%1 = tensor.empty() : tensor<3x3xi32>
22+
%2 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel", "parallel"]}
23+
ins(%arg0: tensor<3x3xi1>)
24+
outs(%1 : tensor<3x3xi32>)
25+
attrs = {iterator_ranges = [3, 3]} {
26+
^bb0(%arg1: i1, %arg2: i32):
27+
%3 = arith.extui %arg1: i1 to i32
28+
linalg.yield %3 : i32
29+
} -> tensor<3x3xi32>
30+
return %2: tensor<3x3xi32>
31+
}
32+
33+
func.func private @printMemrefI32(tensor<*xi32>)
1934
func.func @test(%arg0: tensor<3x3xi32>)->tensor<3x3xi1>{
2035
%0 = tensor.empty() : tensor<3x3xi1>
2136
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel", "parallel"]} ins(%arg0 : tensor<3x3xi32>) outs(%0 : tensor<3x3xi1>) {

0 commit comments

Comments
 (0)