|
4 | 4 |
|
5 | 5 | // RUN: mlir-opt %s -split-input-file -verify-diagnostics -tosa-validate="profile=pro_int,pro_fp strict-op-spec-alignment"
|
6 | 6 |
|
| 7 | +// ----- |
| 8 | +func.func @test_argmax(%arg0: tensor<14x19xbf16>) -> tensor<14xi32> { |
| 9 | + // expected-error@+1 {{'tosa.argmax' op illegal: requires [bf16] but not enabled in target}} |
| 10 | + %0 = tosa.argmax %arg0 {axis = 1 : i32} : (tensor<14x19xbf16>) -> tensor<14xi32> |
| 11 | + return %0 : tensor<14xi32> |
| 12 | +} |
| 13 | + |
| 14 | +// ----- |
| 15 | +func.func @test_avg_pool2d(%arg0: tensor<1x7x7x9xbf16>, %arg1: tensor<1xbf16>, %arg2: tensor<1xbf16>) -> tensor<1x7x7x9xbf16> { |
| 16 | + // expected-error@+1 {{'tosa.avg_pool2d' op illegal: requires [bf16] but not enabled in target}} |
| 17 | + %0 = tosa.avg_pool2d %arg0, %arg1, %arg2 {acc_type = f32, kernel = array<i64: 2, 2>, pad = array<i64: 0, 1, 0, 1>, stride = array<i64: 1, 1>} : (tensor<1x7x7x9xbf16>, tensor<1xbf16>, tensor<1xbf16>) -> tensor<1x7x7x9xbf16> |
| 18 | + return %0 : tensor<1x7x7x9xbf16> |
| 19 | +} |
| 20 | + |
| 21 | +// ----- |
| 22 | +func.func @test_conv2d(%arg0: tensor<1x4x4x4xi8>, %arg1: tensor<8x1x1x4xi4>, %arg2: tensor<8xi32>, %arg3: tensor<1xi8>, %arg4: tensor<1xi4>) -> tensor<1x4x4x8xi32> { |
| 23 | + // expected-error@+1 {{'tosa.conv2d' op illegal: requires [int4] but not enabled in target}} |
| 24 | + %0 = tosa.conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = i32, dilation = array<i64: 1, 1>, pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 1>, local_bound = true} : (tensor<1x4x4x4xi8>, tensor<8x1x1x4xi4>, tensor<8xi32>, tensor<1xi8>, tensor<1xi4>) -> tensor<1x4x4x8xi32> |
| 25 | + return %0 : tensor<1x4x4x8xi32> |
| 26 | +} |
| 27 | + |
| 28 | +// ----- |
| 29 | +func.func @test_conv3d(%arg0: tensor<1x4x8x21x17xi16>, %arg1: tensor<34x1x1x1x17xi8>, %arg2: tensor<34xi48>, %arg3: tensor<1xi16>, %arg4: tensor<1xi8>) -> tensor<1x4x8x21x34xi48> { |
| 30 | + // expected-error@+1 {{'tosa.conv3d' op illegal: requires [int16] but not enabled in target}} |
| 31 | + %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = i48, dilation = array<i64: 1, 1, 1>, pad = array<i64: 0, 0, 0, 0, 0, 0>, stride = array<i64: 1, 1, 1>} : (tensor<1x4x8x21x17xi16>, tensor<34x1x1x1x17xi8>, tensor<34xi48>, tensor<1xi16>, tensor<1xi8>) -> tensor<1x4x8x21x34xi48> |
| 32 | + return %0 : tensor<1x4x8x21x34xi48> |
| 33 | +} |
| 34 | + |
| 35 | +// ----- |
| 36 | +func.func @test_depthwise_conv2d(%arg0: tensor<1x4x4x4xbf16>, %arg1: tensor<1x1x4x2xbf16>, %arg2: tensor<8xbf16>, %arg3: tensor<1xbf16>, %arg4: tensor<1xbf16>) -> tensor<1x4x4x8xbf16> { |
| 37 | + // expected-error@+1 {{'tosa.depthwise_conv2d' op illegal: requires [bf16] but not enabled in target}} |
| 38 | + %0 = tosa.depthwise_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1>, pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 1>} : (tensor<1x4x4x4xbf16>, tensor<1x1x4x2xbf16>, tensor<8xbf16>, tensor<1xbf16>, tensor<1xbf16>) -> tensor<1x4x4x8xbf16> |
| 39 | + return %0 : tensor<1x4x4x8xbf16> |
| 40 | +} |
| 41 | + |
| 42 | +// ----- |
| 43 | +func.func @test_max_pool2d(%arg0: tensor<1x32x32x8xi16>) -> tensor<1x32x32x8xi16> { |
| 44 | + // expected-error@+1 {{'tosa.max_pool2d' op illegal: requires [int16] but not enabled in target}} |
| 45 | + %0 = tosa.max_pool2d %arg0 {kernel = array<i64: 1, 1>, pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 1>} : (tensor<1x32x32x8xi16>) -> tensor<1x32x32x8xi16> |
| 46 | + return %0 : tensor<1x32x32x8xi16> |
| 47 | +} |
| 48 | + |
| 49 | +// ----- |
| 50 | +func.func @test_clamp(%arg0: tensor<13x21x3xi16>) -> tensor<13x21x3xi16> { |
| 51 | + // expected-error@+1 {{'tosa.clamp' op illegal: requires [int16] but not enabled in target}} |
| 52 | + %0 = tosa.clamp %arg0 {min_val = 0 : i16, max_val = 1 : i16} : (tensor<13x21x3xi16>) -> tensor<13x21x3xi16> |
| 53 | + return %0 : tensor<13x21x3xi16> |
| 54 | +} |
| 55 | + |
| 56 | +// ----- |
| 57 | +func.func @test_sigmoid(%arg0: tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> { |
| 58 | + // expected-error@+1 {{'tosa.sigmoid' op illegal: requires [bf16] but not enabled in target}} |
| 59 | + %0 = tosa.sigmoid %arg0 : (tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> |
| 60 | + return %0 : tensor<13x21x3xbf16> |
| 61 | +} |
| 62 | + |
| 63 | +// ----- |
| 64 | +func.func @test_tanh(%arg0: tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> { |
| 65 | + // expected-error@+1 {{'tosa.tanh' op illegal: requires [bf16] but not enabled in target}} |
| 66 | + %0 = tosa.tanh %arg0 : (tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> |
| 67 | + return %0 : tensor<13x21x3xbf16> |
| 68 | +} |
| 69 | + |
| 70 | +// ----- |
| 71 | +func.func @test_add(%arg0: tensor<13x21x1xbf16>, %arg1: tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> { |
| 72 | + // expected-error@+1 {{'tosa.add' op illegal: requires [bf16] but not enabled in target}} |
| 73 | + %0 = tosa.add %arg0, %arg1 : (tensor<13x21x1xbf16>, tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> |
| 74 | + return %0 : tensor<13x21x3xbf16> |
| 75 | +} |
| 76 | + |
| 77 | +// ----- |
| 78 | +func.func @test_max(%arg0: tensor<13x21x3xbf16>, %arg1: tensor<13x21x1xbf16>) -> tensor<13x21x3xbf16> { |
| 79 | + // expected-error@+1 {{'tosa.maximum' op illegal: requires [bf16] but not enabled in target}} |
| 80 | + %0 = tosa.maximum %arg0, %arg1 : (tensor<13x21x3xbf16>, tensor<13x21x1xbf16>) -> tensor<13x21x3xbf16> |
| 81 | + return %0 : tensor<13x21x3xbf16> |
| 82 | +} |
| 83 | + |
| 84 | +// ----- |
| 85 | +func.func @test_mul(%arg0: tensor<13x21x3xbf16>, %arg1: tensor<13x1x3xbf16>, %shift: tensor<1xi8>) -> tensor<13x21x3xbf16> { |
| 86 | + // expected-error@+1 {{'tosa.mul' op illegal: requires [bf16] but not enabled in target}} |
| 87 | + %0 = tosa.mul %arg0, %arg1, %shift : (tensor<13x21x3xbf16>, tensor<13x1x3xbf16>, tensor<1xi8>) -> tensor<13x21x3xbf16> |
| 88 | + return %0 : tensor<13x21x3xbf16> |
| 89 | +} |
| 90 | + |
| 91 | +// ----- |
| 92 | +func.func @test_pow(%arg0: tensor<13x21x3xbf16>, %arg1: tensor<13x21x1xbf16>) -> tensor<13x21x3xbf16> { |
| 93 | + // expected-error@+1 {{'tosa.pow' op illegal: requires [bf16] but not enabled in target}} |
| 94 | + %0 = tosa.pow %arg0, %arg1 : (tensor<13x21x3xbf16>, tensor<13x21x1xbf16>) -> tensor<13x21x3xbf16> |
| 95 | + return %0 : tensor<13x21x3xbf16> |
| 96 | +} |
| 97 | + |
| 98 | +// ----- |
| 99 | +func.func @test_sub(%arg0: tensor<1x21x3xbf16>, %arg1: tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> { |
| 100 | + // expected-error@+1 {{'tosa.sub' op illegal: requires [bf16] but not enabled in target}} |
| 101 | + %0 = tosa.sub %arg0, %arg1 : (tensor<1x21x3xbf16>, tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> |
| 102 | + return %0 : tensor<13x21x3xbf16> |
| 103 | +} |
| 104 | + |
| 105 | +// ----- |
| 106 | +func.func @test_table(%arg0 : tensor<4x5xi16>, %arg1 : tensor<513xi16>) -> () { |
| 107 | + // expected-error@+1 {{'tosa.table' op illegal: requires [int16] but not enabled in target}} |
| 108 | + %0 = tosa.table %arg0, %arg1 : (tensor<4x5xi16>, tensor<513xi16>) -> tensor<?x?xi32> |
| 109 | + return |
| 110 | +} |
| 111 | + |
| 112 | +// ----- |
| 113 | +func.func @test_abs(%arg0: tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> { |
| 114 | + // expected-error@+1 {{'tosa.abs' op illegal: requires [bf16] but not enabled in target}} |
| 115 | + %0 = tosa.abs %arg0 : (tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> |
| 116 | + return %0 : tensor<13x21x3xbf16> |
| 117 | +} |
| 118 | + |
| 119 | +// ----- |
| 120 | +func.func @test_cos(%arg0: tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> { |
| 121 | + // expected-error@+1 {{'tosa.cos' op illegal: requires [bf16] but not enabled in target}} |
| 122 | + %0 = tosa.cos %arg0 : (tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> |
| 123 | + return %0 : tensor<13x21x3xbf16> |
| 124 | +} |
| 125 | + |
| 126 | +// ----- |
| 127 | +func.func @test_exp(%arg0: tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> { |
| 128 | + // expected-error@+1 {{'tosa.exp' op illegal: requires [bf16] but not enabled in target}} |
| 129 | + %0 = tosa.exp %arg0 : (tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> |
| 130 | + return %0 : tensor<13x21x3xbf16> |
| 131 | +} |
| 132 | + |
| 133 | +// ----- |
| 134 | +func.func @test_floor(%arg0: tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> { |
| 135 | + // expected-error@+1 {{'tosa.floor' op illegal: requires [bf16] but not enabled in target}} |
| 136 | + %0 = tosa.floor %arg0 : (tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> |
| 137 | + return %0 : tensor<13x21x3xbf16> |
| 138 | +} |
| 139 | + |
| 140 | +// ----- |
| 141 | +func.func @test_log(%arg0: tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> { |
| 142 | + // expected-error@+1 {{'tosa.log' op illegal: requires [bf16] but not enabled in target}} |
| 143 | + %0 = tosa.log %arg0 : (tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> |
| 144 | + return %0 : tensor<13x21x3xbf16> |
| 145 | +} |
| 146 | + |
| 147 | +// ----- |
| 148 | +func.func @test_negate(%arg0: tensor<13x21x3xbf16>, %arg1: tensor<1xbf16>, %arg2: tensor<1xbf16>) -> tensor<13x21x3xbf16> { |
| 149 | + // expected-error@+1 {{'tosa.negate' op illegal: requires [bf16] but not enabled in target}} |
| 150 | + %0 = tosa.negate %arg0, %arg1, %arg2 : (tensor<13x21x3xbf16>, tensor<1xbf16>, tensor<1xbf16>) -> tensor<13x21x3xbf16> |
| 151 | + return %0 : tensor<13x21x3xbf16> |
| 152 | +} |
| 153 | + |
| 154 | +// ----- |
| 155 | +func.func @test_reciprocal(%arg0: tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> { |
| 156 | + // expected-error@+1 {{'tosa.reciprocal' op illegal: requires [bf16] but not enabled in target}} |
| 157 | + %0 = tosa.reciprocal %arg0 : (tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> |
| 158 | + return %0 : tensor<13x21x3xbf16> |
| 159 | +} |
| 160 | + |
| 161 | +// ----- |
| 162 | +func.func @test_rsqrt(%arg0: tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> { |
| 163 | + // expected-error@+1 {{'tosa.rsqrt' op illegal: requires [bf16] but not enabled in target}} |
| 164 | + %0 = tosa.rsqrt %arg0 : (tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> |
| 165 | + return %0 : tensor<13x21x3xbf16> |
| 166 | +} |
| 167 | + |
| 168 | +// ----- |
| 169 | +func.func @test_equal(%arg0: tensor<13x21x3xbf16>, %arg1: tensor<13x1x3xbf16>) -> tensor<13x21x3xi1> { |
| 170 | + // expected-error@+1 {{'tosa.equal' op illegal: requires [bf16] but not enabled in target}} |
| 171 | + %0 = tosa.equal %arg0, %arg1 : (tensor<13x21x3xbf16>, tensor<13x1x3xbf16>) -> tensor<13x21x3xi1> |
| 172 | + return %0 : tensor<13x21x3xi1> |
| 173 | +} |
| 174 | + |
| 175 | +// ----- |
| 176 | +func.func @test_reduce_max(%arg0: tensor<13x21x3xbf16>) -> tensor<1x21x3xbf16> { |
| 177 | + // expected-error@+1 {{'tosa.reduce_max' op illegal: requires [bf16] but not enabled in target}} |
| 178 | + %0 = tosa.reduce_max %arg0 {axis = 0 : i32} : (tensor<13x21x3xbf16>) -> tensor<1x21x3xbf16> |
| 179 | + return %0 : tensor<1x21x3xbf16> |
| 180 | +} |
| 181 | + |
| 182 | +// ----- |
| 183 | +func.func @test_concat(%arg0: tensor<13x21x3xbf16>, %arg1: tensor<13x21x3xbf16>) -> tensor<26x21x3xbf16> { |
| 184 | + // expected-error@+1 {{'tosa.concat' op illegal: requires [bf16] but not enabled in target}} |
| 185 | + %0 = tosa.concat %arg0, %arg1 {axis = 0 : i32} : (tensor<13x21x3xbf16>, tensor<13x21x3xbf16>) -> tensor<26x21x3xbf16> |
| 186 | + return %0 : tensor<26x21x3xbf16> |
| 187 | +} |
| 188 | + |
| 189 | +// ----- |
| 190 | +func.func @test_pad(%arg0: tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> { |
| 191 | + %padding = tosa.const_shape {values = dense<0> : tensor<6xindex>} : () -> !tosa.shape<6> |
| 192 | + // expected-error@+1 {{'tosa.const' op illegal: requires [bf16] but not enabled in target}} |
| 193 | + %pad_const = "tosa.const"() {values = dense<3.14> : tensor<1xbf16>} : () -> tensor<1xbf16> |
| 194 | + // expected-error@+1 {{'tosa.pad' op illegal: requires [bf16] but not enabled in target}} |
| 195 | + %0 = tosa.pad %arg0, %padding, %pad_const : (tensor<13x21x3xbf16>, !tosa.shape<6>, tensor<1xbf16>) -> tensor<13x21x3xbf16> |
| 196 | + return %0 : tensor<13x21x3xbf16> |
| 197 | +} |
| 198 | + |
| 199 | +// ----- |
| 200 | +func.func @test_reshape(%arg0: tensor<13x21x3xbf16>) -> tensor<1x819xbf16> { |
| 201 | + %1 = tosa.const_shape {values = dense<[1, 819]> : tensor<2xindex>} : () -> !tosa.shape<2> |
| 202 | + // expected-error@+1 {{'tosa.reshape' op illegal: requires [bf16] but not enabled in target}} |
| 203 | + %0 = tosa.reshape %arg0, %1 : (tensor<13x21x3xbf16>, !tosa.shape<2>) -> tensor<1x819xbf16> |
| 204 | + return %0 : tensor<1x819xbf16> |
| 205 | +} |
| 206 | + |
| 207 | +// ----- |
| 208 | +func.func @test_reverse(%arg0: tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> { |
| 209 | + // expected-error@+1 {{'tosa.reverse' op illegal: requires [bf16] but not enabled in target}} |
| 210 | + %0 = tosa.reverse %arg0 {axis = 0 : i32} : (tensor<13x21x3xbf16>) -> tensor<13x21x3xbf16> |
| 211 | + return %0 : tensor<13x21x3xbf16> |
| 212 | +} |
| 213 | + |
| 214 | +// ----- |
| 215 | +func.func @test_slice(%arg0: tensor<13x21x3xbf16>) -> tensor<4x11x1xbf16> { |
| 216 | + %0 = tosa.const_shape {values = dense<[4, 11, 1]> : tensor<3xindex>} : () -> !tosa.shape<3> |
| 217 | + %1 = tosa.const_shape {values = dense<[6, 8, 0]> : tensor<3xindex>} : () -> !tosa.shape<3> |
| 218 | + // expected-error@+1 {{'tosa.slice' op illegal: requires [bf16] but not enabled in target}} |
| 219 | + %2 = tosa.slice %arg0, %0, %1 : (tensor<13x21x3xbf16>, !tosa.shape<3>, !tosa.shape<3>) -> tensor<4x11x1xbf16> |
| 220 | + return %2 : tensor<4x11x1xbf16> |
| 221 | +} |
| 222 | + |
| 223 | +// ----- |
| 224 | +func.func @test_tile(%arg0: tensor<13x21x3xbf16>) -> tensor<39x21x6xbf16> { |
| 225 | + %cst = tosa.const_shape { values = dense<[3, 1, 2]> : tensor<3xindex> } : () -> !tosa.shape<3> |
| 226 | + // expected-error@+1 {{'tosa.tile' op illegal: requires [bf16] but not enabled in target}} |
| 227 | + %0 = tosa.tile %arg0, %cst: (tensor<13x21x3xbf16>, !tosa.shape<3>) -> tensor<39x21x6xbf16> |
| 228 | + return %0 : tensor<39x21x6xbf16> |
| 229 | +} |
| 230 | + |
| 231 | +// ----- |
| 232 | +func.func @test_transpose(%arg0: tensor<13x21x3xbf16>) -> tensor<3x13x21xbf16> { |
| 233 | + // expected-error@+1 {{'tosa.transpose' op illegal: requires [bf16] but not enabled in target}} |
| 234 | + %1 = tosa.transpose %arg0 {perms = array<i32: 2, 0, 1>} : (tensor<13x21x3xbf16>) -> tensor<3x13x21xbf16> |
| 235 | + return %1 : tensor<3x13x21xbf16> |
| 236 | +} |
| 237 | + |
| 238 | +// ----- |
| 239 | +func.func @test_gather(%arg0: tensor<13x21x3xbf16>, %arg1: tensor<13x26xi32>) -> tensor<13x26x3xbf16> { |
| 240 | + // expected-error@+1 {{'tosa.gather' op illegal: requires [bf16] but not enabled in target}} |
| 241 | + %0 = tosa.gather %arg0, %arg1 : (tensor<13x21x3xbf16>, tensor<13x26xi32>) -> tensor<13x26x3xbf16> |
| 242 | + return %0 : tensor<13x26x3xbf16> |
| 243 | +} |
| 244 | + |
| 245 | +// ----- |
| 246 | +func.func @test_scatter(%arg0: tensor<13x21x3xbf16>, %arg1: tensor<13x26xi32>, %arg2: tensor<13x26x3xbf16>) -> tensor<13x21x3xbf16> { |
| 247 | + // expected-error@+1 {{'tosa.scatter' op illegal: requires [bf16] but not enabled in target}} |
| 248 | + %0 = tosa.scatter %arg0, %arg1, %arg2 : (tensor<13x21x3xbf16>, tensor<13x26xi32>, tensor<13x26x3xbf16>) -> tensor<13x21x3xbf16> |
| 249 | + return %0 : tensor<13x21x3xbf16> |
| 250 | +} |
| 251 | + |
| 252 | +// ----- |
| 253 | +func.func @test_resize(%arg0: tensor<1x32x32x8xbf16>) -> tensor<1x64x64x8xbf16> { |
| 254 | + %scale = tosa.const_shape { values = dense<[4, 2, 4, 2]> : tensor<4xindex> } : () -> !tosa.shape<4> |
| 255 | + %offset = tosa.const_shape { values = dense<[-1, -1]> : tensor<2xindex> } : () -> !tosa.shape<2> |
| 256 | + %border = tosa.const_shape { values = dense<[1, 1]> : tensor<2xindex> } : () -> !tosa.shape<2> |
| 257 | + // expected-error@+1 {{'tosa.resize' op illegal: requires [bf16] but not enabled in target}} |
| 258 | + %1 = tosa.resize %arg0, %scale, %offset, %border { mode = "BILINEAR" } : (tensor<1x32x32x8xbf16>, !tosa.shape<4>, !tosa.shape<2>, !tosa.shape<2>) -> tensor<1x64x64x8xbf16> |
| 259 | + return %1 : tensor<1x64x64x8xbf16> |
| 260 | +} |
| 261 | + |
| 262 | +// ----- |
| 263 | +func.func @test_cast_i8_bf16(%arg0: tensor<13x21x3xi8>) -> tensor<13x21x3xbf16> { |
| 264 | + // expected-error@+1 {{'tosa.cast' op illegal: requires [bf16] but not enabled in target}} |
| 265 | + %0 = tosa.cast %arg0 : (tensor<13x21x3xi8>) -> tensor<13x21x3xbf16> |
| 266 | + return %0 : tensor<13x21x3xbf16> |
| 267 | +} |
| 268 | + |
| 269 | +// ----- |
| 270 | +func.func @test_cast_bf16_i8(%arg0: tensor<13x21x3xbf16>) -> tensor<13x21x3xi8> { |
| 271 | + // expected-error@+1 {{'tosa.cast' op illegal: requires [bf16] but not enabled in target}} |
| 272 | + %0 = tosa.cast %arg0 : (tensor<13x21x3xbf16>) -> tensor<13x21x3xi8> |
| 273 | + return %0 : tensor<13x21x3xi8> |
| 274 | +} |
| 275 | + |
| 276 | +// ----- |
| 277 | +func.func @test_cast_f32_bf16(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xbf16> { |
| 278 | + // expected-error@+1 {{'tosa.cast' op illegal: requires [bf16] but not enabled in target}} |
| 279 | + %0 = tosa.cast %arg0 : (tensor<13x21x3xf32>) -> tensor<13x21x3xbf16> |
| 280 | + return %0 : tensor<13x21x3xbf16> |
| 281 | +} |
| 282 | + |
7 | 283 | // -----
|
8 | 284 | func.func @test_fft2d(%arg0: tensor<1x4x8xf32>, %arg1: tensor<1x4x8xf32>) -> (tensor<1x4x8xf32>, tensor<1x4x8xf32>) {
|
9 | 285 | // expected-error@+1 {{'tosa.fft2d' op illegal: requires [fft] but not enabled in target}}
|
10 | 286 | %0, %1 = tosa.fft2d %arg0, %arg1 {inverse = false} : (tensor<1x4x8xf32>, tensor<1x4x8xf32>) -> (tensor<1x4x8xf32>, tensor<1x4x8xf32>)
|
11 | 287 | return %0, %1 : tensor<1x4x8xf32>, tensor<1x4x8xf32>
|
12 | 288 | }
|
13 | 289 |
|
| 290 | +// ----- |
| 291 | +func.func @test_const_i4() -> tensor<3x11x11x3xi4> { |
| 292 | + // expected-error@+1 {{'tosa.const' op illegal: requires [int4] but not enabled in target}} |
| 293 | + %0 = "tosa.const"() {values = dense<0> : tensor<3x11x11x3xi4>} : () -> tensor<3x11x11x3xi4> |
| 294 | + return %0 : tensor<3x11x11x3xi4> |
| 295 | +} |
| 296 | + |
| 297 | +// ----- |
| 298 | +func.func @test_const_i48() -> tensor<3x11x11x3xi48> { |
| 299 | + // expected-error@+1 {{'tosa.const' op illegal: requires [int16] but not enabled in target}} |
| 300 | + %0 = "tosa.const"() {values = dense<0> : tensor<3x11x11x3xi48>} : () -> tensor<3x11x11x3xi48> |
| 301 | + return %0 : tensor<3x11x11x3xi48> |
| 302 | +} |
| 303 | + |
| 304 | +// ----- |
| 305 | +// CHECK-LABEL: identity |
| 306 | +func.func @test_identity(%arg0: tensor<13x21x3xi4>) -> tensor<13x21x3xi4> { |
| 307 | + // expected-error@+1 {{'tosa.identity' op illegal: requires [int4] but not enabled in target}} |
| 308 | + %0 = tosa.identity %arg0 : (tensor<13x21x3xi4>) -> tensor<13x21x3xi4> |
| 309 | + return %0 : tensor<13x21x3xi4> |
| 310 | +} |
| 311 | + |
14 | 312 | // -----
|
15 | 313 | func.func @test_variable_read_type(%arg0: tensor<2x4x8xi8>) -> () {
|
16 | 314 | // expected-error@+1 {{'tosa.variable' op illegal: requires [variable] but not enabled in target}}
|
@@ -79,7 +377,7 @@ func.func @test_single_round_rescale(%arg0: tensor<13x21x3xi8>) -> tensor<13x21x
|
79 | 377 | %input_zp = "tosa.const"() {values = dense<0> : tensor<1xi8>} : () -> tensor<1xi8>
|
80 | 378 | %output_zp = "tosa.const"() {values = dense<0> : tensor<1xi8>} : () -> tensor<1xi8>
|
81 | 379 | // CHECK tosa.rescale
|
82 |
| - %0 = tosa.rescale %arg0, %multiplier, %shift, %input_zp, %output_zp {rounding_mode = "SINGLE_ROUND", input_zp = 127 : i32, output_zp = -1 : i32, per_channel = false, scale32 = true, input_unsigned = false, output_unsigned = false} : (tensor<13x21x3xi8>, tensor<1xi32>, tensor<1xi8>, tensor<1xi8>, tensor<1xi8>) -> tensor<13x21x3xi8> |
| 380 | + %0 = tosa.rescale %arg0, %multiplier, %shift, %input_zp, %output_zp {rounding_mode = "SINGLE_ROUND", per_channel = false, scale32 = true, input_unsigned = false, output_unsigned = false} : (tensor<13x21x3xi8>, tensor<1xi32>, tensor<1xi8>, tensor<1xi8>, tensor<1xi8>) -> tensor<13x21x3xi8> |
83 | 381 | return %0 : tensor<13x21x3xi8>
|
84 | 382 | }
|
85 | 383 |
|
|
0 commit comments