@@ -1913,6 +1913,125 @@ func.func @reduce_non_operation_name(%arg0: tensor<4xf32>, %arg1: tensor<f32>) -
19131913
19141914// -----
19151915
1916+ //===----------------------------------------------------------------------===//
1917+ // linalg.pooling_nhwc_*
1918+ //===----------------------------------------------------------------------===//
1919+
1920+ func.func @pooling_nhwc_max_unsigned_float_type (
1921+ %input: tensor <1 x4 x4 x1 xf32 >,
1922+ %filter: tensor <2 x2 xf32 >,
1923+ %init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 > {
1924+ // expected-error @+1 {{unsupported operation: unsigned max not on uint}}
1925+ %0 = linalg.pooling_nhwc_max_unsigned {dilations = dense <1 > : tensor <2 xi64 >,
1926+ strides = dense <1 > : tensor <2 xi64 >}
1927+ ins (%input , %filter: tensor <1 x4 x4 x1 xf32 >, tensor <2 x2 xf32 >)
1928+ outs (%init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 >
1929+ return %0 : tensor <1 x2 x2 x1 xf32 >
1930+ }
1931+
1932+ // -----
1933+
1934+ func.func @pooling_nhwc_max_unsigned_i1 (
1935+ %input: tensor <1 x4 x4 x1 xi1 >,
1936+ %filter: tensor <2 x2 xi1 >,
1937+ %init_val: tensor <1 x2 x2 x1 xi1 >) -> tensor <1 x2 x2 x1 xi1 > {
1938+ // expected-error @+1 {{unsupported operation: unsigned max not on uint}}
1939+ %0 = linalg.pooling_nhwc_max_unsigned {dilations = dense <1 > : tensor <2 xi64 >,
1940+ strides = dense <1 > : tensor <2 xi64 >}
1941+ ins (%input , %filter: tensor <1 x4 x4 x1 xi1 >, tensor <2 x2 xi1 >)
1942+ outs (%init_val: tensor <1 x2 x2 x1 xi1 >) -> tensor <1 x2 x2 x1 xi1 >
1943+ return %0 : tensor <1 x2 x2 x1 xi1 >
1944+ }
1945+
1946+ // -----
1947+
1948+ func.func @pooling_nhwc_min_unsigned_float_type (
1949+ %input: tensor <1 x4 x4 x1 xf32 >,
1950+ %filter: tensor <2 x2 xf32 >,
1951+ %init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 > {
1952+ // expected-error @+1 {{unsupported operation: unsigned min not on uint}}
1953+ %0 = linalg.pooling_nhwc_min_unsigned {dilations = dense <1 > : tensor <2 xi64 >,
1954+ strides = dense <1 > : tensor <2 xi64 >}
1955+ ins (%input , %filter: tensor <1 x4 x4 x1 xf32 >, tensor <2 x2 xf32 >)
1956+ outs (%init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 >
1957+ return %0 : tensor <1 x2 x2 x1 xf32 >
1958+ }
1959+
1960+ // -----
1961+
1962+ func.func @pooling_nhwc_min_unsigned_i1 (
1963+ %input: tensor <1 x4 x4 x1 xi1 >,
1964+ %filter: tensor <2 x2 xi1 >,
1965+ %init_val: tensor <1 x2 x2 x1 xi1 >) -> tensor <1 x2 x2 x1 xi1 > {
1966+ // expected-error @+1 {{unsupported operation: unsigned min not on uint}}
1967+ %0 = linalg.pooling_nhwc_min_unsigned {dilations = dense <1 > : tensor <2 xi64 >,
1968+ strides = dense <1 > : tensor <2 xi64 >}
1969+ ins (%input , %filter: tensor <1 x4 x4 x1 xi1 >, tensor <2 x2 xi1 >)
1970+ outs (%init_val: tensor <1 x2 x2 x1 xi1 >) -> tensor <1 x2 x2 x1 xi1 >
1971+ return %0 : tensor <1 x2 x2 x1 xi1 >
1972+ }
1973+
1974+ // -----
1975+
1976+ //===----------------------------------------------------------------------===//
1977+ // linalg.pooling_nwc_*
1978+ //===----------------------------------------------------------------------===//
1979+
1980+ func.func @pooling_nwc_max_unsigned_float_type (
1981+ %input: tensor <1 x4 x1 xf32 >,
1982+ %filter: tensor <2 xf32 >,
1983+ %init_val: tensor <1 x2 x1 xf32 >) -> tensor <1 x2 x1 xf32 > {
1984+ // expected-error @+1 {{unsupported operation: unsigned max not on uint}}
1985+ %0 = linalg.pooling_nwc_max_unsigned {dilations = dense <1 > : tensor <1 xi64 >,
1986+ strides = dense <1 > : tensor <1 xi64 >}
1987+ ins (%input , %filter: tensor <1 x4 x1 xf32 >, tensor <2 xf32 >)
1988+ outs (%init_val: tensor <1 x2 x1 xf32 >) -> tensor <1 x2 x1 xf32 >
1989+ return %0 : tensor <1 x2 x1 xf32 >
1990+ }
1991+
1992+ // -----
1993+
1994+ func.func @pooling_nwc_max_unsigned_i1 (
1995+ %input: tensor <1 x4 x1 xi1 >,
1996+ %filter: tensor <2 xi1 >,
1997+ %init_val: tensor <1 x2 x1 xi1 >) -> tensor <1 x2 x1 xi1 > {
1998+ // expected-error @+1 {{unsupported operation: unsigned max not on uint}}
1999+ %0 = linalg.pooling_nwc_max_unsigned {dilations = dense <1 > : tensor <1 xi64 >,
2000+ strides = dense <1 > : tensor <1 xi64 >}
2001+ ins (%input , %filter: tensor <1 x4 x1 xi1 >, tensor <2 xi1 >)
2002+ outs (%init_val: tensor <1 x2 x1 xi1 >) -> tensor <1 x2 x1 xi1 >
2003+ return %0 : tensor <1 x2 x1 xi1 >
2004+ }
2005+
2006+ // -----
2007+
2008+ func.func @pooling_nwc_min_unsigned_float_type (
2009+ %input: tensor <1 x4 x1 xf32 >,
2010+ %filter: tensor <2 xf32 >,
2011+ %init_val: tensor <1 x2 x1 xf32 >) -> tensor <1 x2 x1 xf32 > {
2012+ // expected-error @+1 {{unsupported operation: unsigned min not on uint}}
2013+ %0 = linalg.pooling_nwc_min_unsigned {dilations = dense <1 > : tensor <1 xi64 >,
2014+ strides = dense <1 > : tensor <1 xi64 >}
2015+ ins (%input , %filter: tensor <1 x4 x1 xf32 >, tensor <2 xf32 >)
2016+ outs (%init_val: tensor <1 x2 x1 xf32 >) -> tensor <1 x2 x1 xf32 >
2017+ return %0 : tensor <1 x2 x1 xf32 >
2018+ }
2019+
2020+ // -----
2021+
2022+ func.func @pooling_nwc_min_unsigned_i1 (
2023+ %input: tensor <1 x4 x1 xi1 >,
2024+ %filter: tensor <2 xi1 >,
2025+ %init_val: tensor <1 x2 x1 xi1 >) -> tensor <1 x2 x1 xi1 > {
2026+ // expected-error @+1 {{unsupported operation: unsigned min not on uint}}
2027+ %0 = linalg.pooling_nwc_min_unsigned {dilations = dense <1 > : tensor <1 xi64 >,
2028+ strides = dense <1 > : tensor <1 xi64 >}
2029+ ins (%input , %filter: tensor <1 x4 x1 xi1 >, tensor <2 xi1 >)
2030+ outs (%init_val: tensor <1 x2 x1 xi1 >) -> tensor <1 x2 x1 xi1 >
2031+ return %0 : tensor <1 x2 x1 xi1 >
2032+ }
2033+
2034+ // -----
19162035
19172036//===----------------------------------------------------------------------===//
19182037// Tests for generic infrastructure for named Ops. The actual Ops used are
@@ -1940,30 +2059,3 @@ func.func @matmul_invalid_mixed_types(%t: tensor<?xf16>, %f: vector<4xf16>)
19402059 func.return %0 , %f : tensor <?xf16 >, vector <4 xf16 >
19412060}
19422061
1943- // -----
1944-
1945- func.func @pooling_nhwc_max_unsigned_non_integer_elem_type (
1946- %input: tensor <1 x4 x4 x1 xf32 >,
1947- %filter: tensor <2 x2 xf32 >,
1948- %init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 > {
1949- // expected-error @+1 {{unsupported operation: unsigned max not on uint}}
1950- %0 = linalg.pooling_nhwc_max_unsigned {dilations = dense <1 > : tensor <2 xi64 >,
1951- strides = dense <1 > : tensor <2 xi64 >}
1952- ins (%input , %filter: tensor <1 x4 x4 x1 xf32 >, tensor <2 x2 xf32 >)
1953- outs (%init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 >
1954- return %0 : tensor <1 x2 x2 x1 xf32 >
1955- }
1956-
1957- // -----
1958-
1959- func.func @pooling_nhwc_min_unsigned_non_integer_elem_type (
1960- %input: tensor <1 x4 x4 x1 xf32 >,
1961- %filter: tensor <2 x2 xf32 >,
1962- %init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 > {
1963- // expected-error @+1 {{unsupported operation: unsigned min not on uint}}
1964- %0 = linalg.pooling_nhwc_min_unsigned {dilations = dense <1 > : tensor <2 xi64 >,
1965- strides = dense <1 > : tensor <2 xi64 >}
1966- ins (%input , %filter: tensor <1 x4 x4 x1 xf32 >, tensor <2 x2 xf32 >)
1967- outs (%init_val: tensor <1 x2 x2 x1 xf32 >) -> tensor <1 x2 x2 x1 xf32 >
1968- return %0 : tensor <1 x2 x2 x1 xf32 >
1969- }
0 commit comments