Skip to content

Commit 2e49cdf

Browse files
committed
[mlir][linalg][test] Refactor: Move unsigned pooling float check to invalid.mlir
1 parent 7329bb0 commit 2e49cdf

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

mlir/test/Dialect/Linalg/invalid.mlir

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,3 +1939,31 @@ func.func @matmul_invalid_mixed_types(%t: tensor<?xf16>, %f: vector<4xf16>)
19391939
outs(%f : vector<4xf16>) -> tensor<?xf16>
19401940
func.return %0, %f : tensor<?xf16>, vector<4xf16>
19411941
}
1942+
1943+
// -----
1944+
1945+
func.func @pooling_nhwc_max_unsigned_non_integer_elem_type(
1946+
%input: tensor<1x4x4x1xf32>,
1947+
%filter: tensor<2x2xf32>,
1948+
%init_val: tensor<1x2x2x1xf32>) -> tensor<1x2x2x1xf32> {
1949+
// expected-error @+1 {{unsupported operation: unsigned max not on uint}}
1950+
%0 = linalg.pooling_nhwc_max_unsigned {dilations = dense<1> : tensor<2xi64>,
1951+
strides = dense<1> : tensor<2xi64>}
1952+
ins (%input, %filter: tensor<1x4x4x1xf32>, tensor<2x2xf32>)
1953+
outs (%init_val: tensor<1x2x2x1xf32>) -> tensor<1x2x2x1xf32>
1954+
return %0 : tensor<1x2x2x1xf32>
1955+
}
1956+
1957+
// -----
1958+
1959+
func.func @pooling_nhwc_min_unsigned_non_integer_elem_type(
1960+
%input: tensor<1x4x4x1xf32>,
1961+
%filter: tensor<2x2xf32>,
1962+
%init_val: tensor<1x2x2x1xf32>) -> tensor<1x2x2x1xf32> {
1963+
// expected-error @+1 {{unsupported operation: unsigned min not on uint}}
1964+
%0 = linalg.pooling_nhwc_min_unsigned {dilations = dense<1> : tensor<2xi64>,
1965+
strides = dense<1> : tensor<2xi64>}
1966+
ins (%input, %filter: tensor<1x4x4x1xf32>, tensor<2x2xf32>)
1967+
outs (%init_val: tensor<1x2x2x1xf32>) -> tensor<1x2x2x1xf32>
1968+
return %0 : tensor<1x2x2x1xf32>
1969+
}

mlir/test/Dialect/Linalg/named-ops-fail.mlir

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,6 @@ func.func @divu_broadcast(%arg0: memref<8x16xi32>, %arg1: memref<4x8x16xi32>, %a
8080

8181
// -----
8282

83-
func.func @pooling_nhwc_max_unsigned_float(
84-
%input: tensor<?x?x?x?xf32>,
85-
%filter: tensor<?x?xf32>,
86-
%init_val: tensor<?x?x?x?xf32>) -> tensor<?x?x?x?xf32> {
87-
// CHECK: unsupported operation: unsigned max not on uint
88-
linalg.pooling_nhwc_max_unsigned {dilations = dense<1> : tensor<2xi64>,
89-
strides = dense<1> : tensor<2xi64>}
90-
ins (%input, %filter: tensor<?x?x?x?xf32>, tensor<?x?xf32>)
91-
outs (%init_val: tensor<?x?x?x?xf32>) -> tensor<?x?x?x?xf32>
92-
return %init_val : tensor<?x?x?x?xf32>
93-
}
94-
95-
// -----
96-
9783
func.func @exp_type_cast(%arg: memref<4x8x16xf16>, %out: memref<4x8x16xf32>) {
9884
// CHECK: operand 1 ('f16') doesn't match the element type of the enclosing linalg.generic op ('f32')
9985
linalg.exp ins(%arg : memref<4x8x16xf16>) outs(%out: memref<4x8x16xf32>)

0 commit comments

Comments
 (0)