@@ -53,20 +53,142 @@ func.func @test_add(%arg0: tensor<13x21x1xf32>, %arg1: tensor<13x21x3xf32>) -> t
53
53
return %0 : tensor <13 x21 x3 xf32 >
54
54
}
55
55
56
+ // -----
57
+ func.func @test_add_i32 (%arg0: tensor <13 x21 x1 xi32 >, %arg1: tensor <13 x21 x3 xi32 >) -> tensor <13 x21 x3 xi32 > {
58
+ // expected-error@+1 {{'tosa.add' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
59
+ %0 = tosa.add %arg0 , %arg1 : (tensor <13 x21 x1 xi32 >, tensor <13 x21 x3 xi32 >) -> tensor <13 x21 x3 xi32 >
60
+ return %0 : tensor <13 x21 x3 xi32 >
61
+ }
62
+
63
+ // -----
64
+ func.func @test_int_div (%arg0: tensor <13 x21 x1 xi32 >, %arg1: tensor <13 x21 x3 xi32 >) -> tensor <13 x21 x3 xi32 > {
65
+ // expected-error@+1 {{'tosa.int_div' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
66
+ %0 = tosa.int_div %arg0 , %arg1 : (tensor <13 x21 x1 xi32 >, tensor <13 x21 x3 xi32 >) -> tensor <13 x21 x3 xi32 >
67
+ return %0 : tensor <13 x21 x3 xi32 >
68
+ }
69
+
70
+ // -----
71
+ func.func @test_logical_and (%arg0: tensor <13 x21 x3 xi1 >, %arg1: tensor <13 x21 x1 xi1 >) -> tensor <13 x21 x3 xi1 > {
72
+ // expected-error@+1 {{'tosa.logical_and' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
73
+ %0 = tosa.logical_and %arg0 , %arg1 : (tensor <13 x21 x3 xi1 >, tensor <13 x21 x1 xi1 >) -> tensor <13 x21 x3 xi1 >
74
+ return %0 : tensor <13 x21 x3 xi1 >
75
+ }
76
+
77
+ // -----
78
+ func.func @test_logical_left_shift (%arg0: tensor <13 x21 x3 xi32 >, %arg1: tensor <13 x21 x1 xi32 >) -> tensor <13 x21 x3 xi32 > {
79
+ // expected-error@+1 {{'tosa.logical_left_shift' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
80
+ %0 = tosa.logical_left_shift %arg0 , %arg1 : (tensor <13 x21 x3 xi32 >, tensor <13 x21 x1 xi32 >) -> tensor <13 x21 x3 xi32 >
81
+ return %0 : tensor <13 x21 x3 xi32 >
82
+ }
83
+
84
+ // -----
85
+ func.func @test_mul (%arg0: tensor <13 x21 x3 xi32 >, %arg1: tensor <13 x1 x3 xi32 >, %shift: tensor <1 xi8 >) -> tensor <13 x21 x3 xi32 > {
86
+ // expected-error@+1 {{'tosa.mul' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
87
+ %0 = tosa.mul %arg0 , %arg1 , %shift : (tensor <13 x21 x3 xi32 >, tensor <13 x1 x3 xi32 >, tensor <1 xi8 >) -> tensor <13 x21 x3 xi32 >
88
+ return %0 : tensor <13 x21 x3 xi32 >
89
+ }
90
+
91
+ // -----
92
+ func.func @test_sub (%arg0: tensor <1 x21 x3 xi32 >, %arg1: tensor <13 x21 x3 xi32 >) -> tensor <13 x21 x3 xi32 > {
93
+ // expected-error@+1 {{'tosa.sub' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
94
+ %0 = tosa.sub %arg0 , %arg1 : (tensor <1 x21 x3 xi32 >, tensor <13 x21 x3 xi32 >) -> tensor <13 x21 x3 xi32 >
95
+ return %0 : tensor <13 x21 x3 xi32 >
96
+ }
97
+
98
+ // -----
99
+ func.func @test_logical_not (%arg0: tensor <1 x21 x3 xi1 >) -> tensor <1 x21 x3 xi1 > {
100
+ // expected-error@+1 {{'tosa.logical_not' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
101
+ %0 = tosa.logical_not %arg0 : (tensor <1 x21 x3 xi1 >) -> tensor <1 x21 x3 xi1 >
102
+ return %0 : tensor <1 x21 x3 xi1 >
103
+ }
104
+
105
+ // -----
106
+ func.func @test_select (%arg0: tensor <1 x1 x1 xi1 >, %arg1: tensor <13 x21 x3 xi1 >, %arg2: tensor <13 x21 x3 xi1 >) -> tensor <13 x21 x3 xi1 > {
107
+ // expected-error@+1 {{'tosa.select' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
108
+ %0 = tosa.select %arg0 , %arg1 , %arg2 : (tensor <1 x1 x1 xi1 >, tensor <13 x21 x3 xi1 >, tensor <13 x21 x3 xi1 >) -> tensor <13 x21 x3 xi1 >
109
+ return %0 : tensor <13 x21 x3 xi1 >
110
+ }
56
111
// -----
57
112
func.func @test_reduce_all (%arg0: tensor <13 x21 x3 xi1 >) -> tensor <1 x21 x3 xi1 > {
58
113
// expected-error@+1 {{'tosa.reduce_all' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
59
114
%0 = tosa.reduce_all %arg0 {axis = 0 : i32 } : (tensor <13 x21 x3 xi1 >) -> tensor <1 x21 x3 xi1 >
60
115
return %0 : tensor <1 x21 x3 xi1 >
61
116
}
62
117
118
+ // -----
119
+ func.func @test_reduce_any (%arg0: tensor <13 x21 x3 xi1 >) -> tensor <1 x21 x3 xi1 > {
120
+ // expected-error@+1 {{'tosa.reduce_any' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
121
+ %0 = tosa.reduce_any %arg0 {axis = 0 : i32 } : (tensor <13 x21 x3 xi1 >) -> tensor <1 x21 x3 xi1 >
122
+ return %0 : tensor <1 x21 x3 xi1 >
123
+ }
124
+
63
125
// -----
64
126
func.func @test_concat (%arg0: tensor <13 x21 x3 xf32 >, %arg1: tensor <13 x21 x3 xf32 >) -> tensor <26 x21 x3 xf32 > {
65
127
// expected-error@+1 {{'tosa.concat' op illegal: requires [pro_fp] but not enabled in target}}
66
128
%0 = tosa.concat %arg0 , %arg1 {axis = 0 : i32 } : (tensor <13 x21 x3 xf32 >, tensor <13 x21 x3 xf32 >) -> tensor <26 x21 x3 xf32 >
67
129
return %0 : tensor <26 x21 x3 xf32 >
68
130
}
69
131
132
+ // -----
133
+ func.func @test_concat (%arg0: tensor <13 x21 x3 xi1 >, %arg1: tensor <13 x21 x3 xi1 >) -> tensor <26 x21 x3 xi1 > {
134
+ // expected-error@+1 {{'tosa.concat' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
135
+ %0 = tosa.concat %arg0 , %arg1 {axis = 0 : i32 } : (tensor <13 x21 x3 xi1 >, tensor <13 x21 x3 xi1 >) -> tensor <26 x21 x3 xi1 >
136
+ return %0 : tensor <26 x21 x3 xi1 >
137
+ }
138
+
139
+ // -----
140
+ func.func @test_pad (%arg0: tensor <13 x21 x3 xi1 >) -> tensor <13 x21 x3 xi1 > {
141
+ // expected-error@+1 {{'tosa.const_shape' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
142
+ %padding = tosa.const_shape {values = dense <0 > : tensor <6 xindex >} : () -> !tosa.shape <6 >
143
+ // expected-error@+1 {{'tosa.const' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
144
+ %pad_const = " tosa.const" () {values = dense <1 > : tensor <1 xi1 >} : () -> tensor <1 xi1 >
145
+ // expected-error@+1 {{'tosa.pad' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
146
+ %0 = tosa.pad %arg0 , %padding , %pad_const : (tensor <13 x21 x3 xi1 >, !tosa.shape <6 >, tensor <1 xi1 >) -> tensor <13 x21 x3 xi1 >
147
+ return %0 : tensor <13 x21 x3 xi1 >
148
+ }
149
+
150
+ // -----
151
+ func.func @test_reshape (%arg0: tensor <13 x21 x3 xi1 >) -> tensor <1 x819 xi1 > {
152
+ // expected-error@+1 {{'tosa.const_shape' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
153
+ %1 = tosa.const_shape {values = dense <[1 , 819 ]> : tensor <2 xindex >} : () -> !tosa.shape <2 >
154
+ // expected-error@+1 {{'tosa.reshape' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
155
+ %0 = tosa.reshape %arg0 , %1 : (tensor <13 x21 x3 xi1 >, !tosa.shape <2 >) -> tensor <1 x819 xi1 >
156
+ return %0 : tensor <1 x819 xi1 >
157
+ }
158
+
159
+ // -----
160
+ func.func @test_reverse (%arg0: tensor <13 x21 x3 xi1 >) -> tensor <13 x21 x3 xi1 > {
161
+ // expected-error@+1 {{'tosa.reverse' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
162
+ %0 = tosa.reverse %arg0 {axis = 0 : i32 } : (tensor <13 x21 x3 xi1 >) -> tensor <13 x21 x3 xi1 >
163
+ return %0 : tensor <13 x21 x3 xi1 >
164
+ }
165
+
166
+ // -----
167
+ func.func @test_slice (%arg0: tensor <13 x21 x3 xi1 >) -> tensor <4 x11 x1 xi1 > {
168
+ // expected-error@+1 {{'tosa.const_shape' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
169
+ %0 = tosa.const_shape {values = dense <[4 , 11 , 1 ]> : tensor <3 xindex >} : () -> !tosa.shape <3 >
170
+ // expected-error@+1 {{'tosa.const_shape' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
171
+ %1 = tosa.const_shape {values = dense <[6 , 8 , 0 ]> : tensor <3 xindex >} : () -> !tosa.shape <3 >
172
+ // expected-error@+1 {{'tosa.slice' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
173
+ %2 = tosa.slice %arg0 , %0 , %1 : (tensor <13 x21 x3 xi1 >, !tosa.shape <3 >, !tosa.shape <3 >) -> tensor <4 x11 x1 xi1 >
174
+ return %2 : tensor <4 x11 x1 xi1 >
175
+ }
176
+
177
+ // -----
178
+ func.func @test_tile (%arg0: tensor <13 x21 x3 xi1 >) -> tensor <39 x21 x6 xi1 > {
179
+ // expected-error@+1 {{'tosa.const_shape' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
180
+ %cst = tosa.const_shape { values = dense <[3 , 1 , 2 ]> : tensor <3 xindex > } : () -> !tosa.shape <3 >
181
+ // expected-error@+1 {{'tosa.tile' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
182
+ %0 = tosa.tile %arg0 , %cst: (tensor <13 x21 x3 xi1 >, !tosa.shape <3 >) -> tensor <39 x21 x6 xi1 >
183
+ return %0 : tensor <39 x21 x6 xi1 >
184
+ }
185
+
186
+ // -----
187
+ func.func @test_transpose (%arg0: tensor <13 x21 x3 xi1 >) -> tensor <3 x13 x21 xi1 > {
188
+ // expected-error@+1 {{'tosa.transpose' op illegal: requires any of [pro_int, pro_fp] but not enabled in target}}
189
+ %1 = tosa.transpose %arg0 {perms = array<i32 : 2 , 0 , 1 >} : (tensor <13 x21 x3 xi1 >) -> tensor <3 x13 x21 xi1 >
190
+ return %1 : tensor <3 x13 x21 xi1 >
191
+ }
70
192
// -----
71
193
func.func @test_cast_i32_f32 (%arg0: tensor <13 x21 x3 xi32 >) -> tensor <13 x21 x3 xf32 > {
72
194
// expected-error@+1 {{'tosa.cast' op illegal: requires [pro_fp] but not enabled in target}}
0 commit comments