@@ -1931,6 +1931,125 @@ func.func @reduce_non_operation_name(%arg0: tensor<4xf32>, %arg1: tensor<f32>) -
19311931
19321932// -----
19331933
1934+ //===----------------------------------------------------------------------===//
1935+ // linalg.pooling_nhwc_*
1936+ //===----------------------------------------------------------------------===//
1937+
1938+ func.func @pooling_nhwc_max_unsigned_float_type (
1939+ %input: tensor <1 x4 x4 x1 xf32 >,
1940+ %filter: tensor <2 x2 xf32 >,
1941+ %init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 > {
1942+ // expected-error @+1 {{unsupported operation: unsigned max not on uint}}
1943+ %0 = linalg.pooling_nhwc_max_unsigned {dilations = dense <1 > : tensor <2 xi64 >,
1944+ strides = dense <1 > : tensor <2 xi64 >}
1945+ ins (%input , %filter: tensor <1 x4 x4 x1 xf32 >, tensor <2 x2 xf32 >)
1946+ outs (%init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 >
1947+ return %0 : tensor <1 x2 x2 x1 xf32 >
1948+ }
1949+
1950+ // -----
1951+
1952+ func.func @pooling_nhwc_max_unsigned_i1 (
1953+ %input: tensor <1 x4 x4 x1 xi1 >,
1954+ %filter: tensor <2 x2 xi1 >,
1955+ %init_val: tensor <1 x2 x2 x1 xi1 >) -> tensor <1 x2 x2 x1 xi1 > {
1956+ // expected-error @+1 {{unsupported operation: unsigned max not on uint}}
1957+ %0 = linalg.pooling_nhwc_max_unsigned {dilations = dense <1 > : tensor <2 xi64 >,
1958+ strides = dense <1 > : tensor <2 xi64 >}
1959+ ins (%input , %filter: tensor <1 x4 x4 x1 xi1 >, tensor <2 x2 xi1 >)
1960+ outs (%init_val: tensor <1 x2 x2 x1 xi1 >) -> tensor <1 x2 x2 x1 xi1 >
1961+ return %0 : tensor <1 x2 x2 x1 xi1 >
1962+ }
1963+
1964+ // -----
1965+
1966+ func.func @pooling_nhwc_min_unsigned_float_type (
1967+ %input: tensor <1 x4 x4 x1 xf32 >,
1968+ %filter: tensor <2 x2 xf32 >,
1969+ %init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 > {
1970+ // expected-error @+1 {{unsupported operation: unsigned min not on uint}}
1971+ %0 = linalg.pooling_nhwc_min_unsigned {dilations = dense <1 > : tensor <2 xi64 >,
1972+ strides = dense <1 > : tensor <2 xi64 >}
1973+ ins (%input , %filter: tensor <1 x4 x4 x1 xf32 >, tensor <2 x2 xf32 >)
1974+ outs (%init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 >
1975+ return %0 : tensor <1 x2 x2 x1 xf32 >
1976+ }
1977+
1978+ // -----
1979+
1980+ func.func @pooling_nhwc_min_unsigned_i1 (
1981+ %input: tensor <1 x4 x4 x1 xi1 >,
1982+ %filter: tensor <2 x2 xi1 >,
1983+ %init_val: tensor <1 x2 x2 x1 xi1 >) -> tensor <1 x2 x2 x1 xi1 > {
1984+ // expected-error @+1 {{unsupported operation: unsigned min not on uint}}
1985+ %0 = linalg.pooling_nhwc_min_unsigned {dilations = dense <1 > : tensor <2 xi64 >,
1986+ strides = dense <1 > : tensor <2 xi64 >}
1987+ ins (%input , %filter: tensor <1 x4 x4 x1 xi1 >, tensor <2 x2 xi1 >)
1988+ outs (%init_val: tensor <1 x2 x2 x1 xi1 >) -> tensor <1 x2 x2 x1 xi1 >
1989+ return %0 : tensor <1 x2 x2 x1 xi1 >
1990+ }
1991+
1992+ // -----
1993+
1994+ //===----------------------------------------------------------------------===//
1995+ // linalg.pooling_nwc_*
1996+ //===----------------------------------------------------------------------===//
1997+
1998+ func.func @pooling_nwc_max_unsigned_float_type (
1999+ %input: tensor <1 x4 x1 xf32 >,
2000+ %filter: tensor <2 xf32 >,
2001+ %init_val: tensor <1 x2 x1 xf32 >) -> tensor <1 x2 x1 xf32 > {
2002+ // expected-error @+1 {{unsupported operation: unsigned max not on uint}}
2003+ %0 = linalg.pooling_nwc_max_unsigned {dilations = dense <1 > : tensor <1 xi64 >,
2004+ strides = dense <1 > : tensor <1 xi64 >}
2005+ ins (%input , %filter: tensor <1 x4 x1 xf32 >, tensor <2 xf32 >)
2006+ outs (%init_val: tensor <1 x2 x1 xf32 >) -> tensor <1 x2 x1 xf32 >
2007+ return %0 : tensor <1 x2 x1 xf32 >
2008+ }
2009+
2010+ // -----
2011+
2012+ func.func @pooling_nwc_max_unsigned_i1 (
2013+ %input: tensor <1 x4 x1 xi1 >,
2014+ %filter: tensor <2 xi1 >,
2015+ %init_val: tensor <1 x2 x1 xi1 >) -> tensor <1 x2 x1 xi1 > {
2016+ // expected-error @+1 {{unsupported operation: unsigned max not on uint}}
2017+ %0 = linalg.pooling_nwc_max_unsigned {dilations = dense <1 > : tensor <1 xi64 >,
2018+ strides = dense <1 > : tensor <1 xi64 >}
2019+ ins (%input , %filter: tensor <1 x4 x1 xi1 >, tensor <2 xi1 >)
2020+ outs (%init_val: tensor <1 x2 x1 xi1 >) -> tensor <1 x2 x1 xi1 >
2021+ return %0 : tensor <1 x2 x1 xi1 >
2022+ }
2023+
2024+ // -----
2025+
2026+ func.func @pooling_nwc_min_unsigned_float_type (
2027+ %input: tensor <1 x4 x1 xf32 >,
2028+ %filter: tensor <2 xf32 >,
2029+ %init_val: tensor <1 x2 x1 xf32 >) -> tensor <1 x2 x1 xf32 > {
2030+ // expected-error @+1 {{unsupported operation: unsigned min not on uint}}
2031+ %0 = linalg.pooling_nwc_min_unsigned {dilations = dense <1 > : tensor <1 xi64 >,
2032+ strides = dense <1 > : tensor <1 xi64 >}
2033+ ins (%input , %filter: tensor <1 x4 x1 xf32 >, tensor <2 xf32 >)
2034+ outs (%init_val: tensor <1 x2 x1 xf32 >) -> tensor <1 x2 x1 xf32 >
2035+ return %0 : tensor <1 x2 x1 xf32 >
2036+ }
2037+
2038+ // -----
2039+
2040+ func.func @pooling_nwc_min_unsigned_i1 (
2041+ %input: tensor <1 x4 x1 xi1 >,
2042+ %filter: tensor <2 xi1 >,
2043+ %init_val: tensor <1 x2 x1 xi1 >) -> tensor <1 x2 x1 xi1 > {
2044+ // expected-error @+1 {{unsupported operation: unsigned min not on uint}}
2045+ %0 = linalg.pooling_nwc_min_unsigned {dilations = dense <1 > : tensor <1 xi64 >,
2046+ strides = dense <1 > : tensor <1 xi64 >}
2047+ ins (%input , %filter: tensor <1 x4 x1 xi1 >, tensor <2 xi1 >)
2048+ outs (%init_val: tensor <1 x2 x1 xi1 >) -> tensor <1 x2 x1 xi1 >
2049+ return %0 : tensor <1 x2 x1 xi1 >
2050+ }
2051+
2052+ // -----
19342053
19352054//===----------------------------------------------------------------------===//
19362055// Tests for generic infrastructure for named Ops. The actual Ops used are
@@ -1958,30 +2077,3 @@ func.func @matmul_invalid_mixed_types(%t: tensor<?xf16>, %f: vector<4xf16>)
19582077 func.return %0 , %f : tensor <?xf16 >, vector <4 xf16 >
19592078}
19602079
1961- // -----
1962-
1963- func.func @pooling_nhwc_max_unsigned_non_integer_elem_type (
1964- %input: tensor <1 x4 x4 x1 xf32 >,
1965- %filter: tensor <2 x2 xf32 >,
1966- %init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 > {
1967- // expected-error @+1 {{unsupported operation: unsigned max not on uint}}
1968- %0 = linalg.pooling_nhwc_max_unsigned {dilations = dense <1 > : tensor <2 xi64 >,
1969- strides = dense <1 > : tensor <2 xi64 >}
1970- ins (%input , %filter: tensor <1 x4 x4 x1 xf32 >, tensor <2 x2 xf32 >)
1971- outs (%init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 >
1972- return %0 : tensor <1 x2 x2 x1 xf32 >
1973- }
1974-
1975- // -----
1976-
1977- func.func @pooling_nhwc_min_unsigned_non_integer_elem_type (
1978- %input: tensor <1 x4 x4 x1 xf32 >,
1979- %filter: tensor <2 x2 xf32 >,
1980- %init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 > {
1981- // expected-error @+1 {{unsupported operation: unsigned min not on uint}}
1982- %0 = linalg.pooling_nhwc_min_unsigned {dilations = dense <1 > : tensor <2 xi64 >,
1983- strides = dense <1 > : tensor <2 xi64 >}
1984- ins (%input , %filter: tensor <1 x4 x4 x1 xf32 >, tensor <2 x2 xf32 >)
1985- outs (%init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 >
1986- return %0 : tensor <1 x2 x2 x1 xf32 >
1987- }
0 commit comments