349 lines · plain
1//--------------------------------------------------------------------------------------------------2// Enable all supported extensions to focus the verification of expected profile requirement errors.3//--------------------------------------------------------------------------------------------------4 5// RUN: mlir-opt %s -split-input-file -verify-diagnostics -tosa-attach-target="specification_version=1.1.draft profiles=pro_int extensions=int16,int4,bf16,fp8e4m3,fp8e5m2,fft,variable,controlflow,dynamic,doubleround,inexactround,mxfp" -tosa-validate="strict-op-spec-alignment"6 7// -----8func.func @test_const_f16() -> tensor<3x11x11x3xf16> {9 // expected-error@+1 {{'tosa.const' op illegal: requires [pro_fp] but not enabled in target}}10 %0 = "tosa.const"() {values = dense<2.0> : tensor<3x11x11x3xf16>} : () -> tensor<3x11x11x3xf16>11 return %0 : tensor<3x11x11x3xf16>12}13 14// -----15func.func @test_const_f32() -> tensor<3x11x11x3xf32> {16 // expected-error@+1 {{'tosa.const' op illegal: requires [pro_fp] but not enabled in target}}17 %0 = "tosa.const"() {values = dense<3.0> : tensor<3x11x11x3xf32>} : () -> tensor<3x11x11x3xf32>18 return %0 : tensor<3x11x11x3xf32>19}20 21// -----22func.func @test_avg_pool2d(%arg0: tensor<1x7x7x9xf32>, %arg1: tensor<1xf32>, %arg2: tensor<1xf32>) -> tensor<1x7x7x9xf32> {23 // expected-error@+1 {{'tosa.avg_pool2d' op illegal: requires [pro_fp] but not enabled in target}}24 %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<1x7x7x9xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x7x7x9xf32>25 return %0 : tensor<1x7x7x9xf32>26}27 28// -----29func.func @test_conv2d(%arg0: tensor<1x4x4x4xf32>, %arg1: tensor<8x1x1x4xf32>, %arg2: tensor<8xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x4x4x8xf32> {30 // expected-error@+1 {{'tosa.conv2d' op illegal: requires [pro_fp] but not enabled in target}}31 %0 = tosa.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>, local_bound = true} : (tensor<1x4x4x4xf32>, tensor<8x1x1x4xf32>, tensor<8xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x4x4x8xf32>32 return %0 : tensor<1x4x4x8xf32>33}34 35// -----36func.func @test_conv3d(%arg0: tensor<1x4x8x21x17xf16>, %arg1: tensor<34x1x1x1x17xf16>, %arg2: tensor<34xf16>, %arg3: tensor<1xf16>, %arg4: tensor<1xf16>) -> tensor<1x4x8x21x34xf16> {37 // expected-error@+1 {{'tosa.conv3d' op illegal: requires [pro_fp] but not enabled in target}}38 %0 = tosa.conv3d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, dilation = array<i64: 1, 1, 1>, pad = array<i64: 0, 0, 0, 0, 0, 0>, stride = array<i64: 1, 1, 1>} : (tensor<1x4x8x21x17xf16>, tensor<34x1x1x1x17xf16>, tensor<34xf16>, tensor<1xf16>, tensor<1xf16>) -> tensor<1x4x8x21x34xf16>39 return %0 : tensor<1x4x8x21x34xf16>40}41 42// -----43func.func @test_depthwise_conv2d(%arg0: tensor<1x4x4x4xf16>, %arg1: tensor<1x1x4x2xf16>, %arg2: tensor<8xf16>, %arg3: tensor<1xf16>, %arg4: tensor<1xf16>) -> tensor<1x4x4x8xf16> {44 // expected-error@+1 {{'tosa.depthwise_conv2d' op illegal: requires [pro_fp] but not enabled in target}}45 %0 = tosa.depthwise_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f16, dilation = array<i64: 1, 1>, pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 1>} : (tensor<1x4x4x4xf16>, tensor<1x1x4x2xf16>, tensor<8xf16>, tensor<1xf16>, tensor<1xf16>) -> tensor<1x4x4x8xf16>46 return %0 : tensor<1x4x4x8xf16>47}48 49// -----50func.func @test_matmul(%arg0: tensor<1x14x19xf32>, %arg1: tensor<1x19x28xf32>) -> tensor<1x14x28xf32> {51 // expected-error@+1 {{'tosa.const' op illegal: requires [pro_fp] but not enabled in target}}52 %azp0 = "tosa.const"() <{values = dense<0.0> : tensor<1xf32>}> : () -> tensor<1xf32>53 // expected-error@+1 {{'tosa.const' op illegal: requires [pro_fp] but not enabled in target}}54 %bzp0 = "tosa.const"() <{values = dense<0.0> : tensor<1xf32>}> : () -> tensor<1xf32>55 // expected-error@+1 {{'tosa.matmul' op illegal: requires [pro_fp] but not enabled in target}}56 %0 = tosa.matmul %arg0, %arg1, %azp0, %bzp0 : (tensor<1x14x19xf32>, tensor<1x19x28xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x14x28xf32>57 return %0 : tensor<1x14x28xf32>58}59 60// -----61func.func @test_sigmoid(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {62 // expected-error@+1 {{'tosa.sigmoid' op illegal: requires [pro_fp] but not enabled in target}}63 %0 = tosa.sigmoid %arg0 : (tensor<13x21x3xf32>) -> tensor<13x21x3xf32>64 return %0 : tensor<13x21x3xf32>65}66 67// -----68func.func @test_transpose_conv2d(%arg0: tensor<1x32x32x8xf32>, %arg1: tensor<16x1x1x8xf32>, %arg2: tensor<16xf32>, %arg3: tensor<1xf32>, %arg4: tensor<1xf32>) -> tensor<1x32x32x16xf32> {69 // expected-error@+1 {{'tosa.transpose_conv2d' op illegal: requires [pro_fp] but not enabled in target}}70 %0 = tosa.transpose_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f32, out_pad = array<i64: 0, 0, 0, 0>, out_shape = array<i64: 1, 32, 32, 16>, stride = array<i64: 1, 1>} : (tensor<1x32x32x8xf32>, tensor<16x1x1x8xf32>, tensor<16xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x32x32x16xf32>71 return %0 : tensor<1x32x32x16xf32>72}73 74// -----75func.func @test_max_pool2d(%arg0: tensor<1x32x32x8xf32>) -> tensor<1x32x32x8xf32> {76 // expected-error@+1 {{'tosa.max_pool2d' op illegal: requires [pro_fp] but not enabled in target}}77 %0 = tosa.max_pool2d %arg0 {kernel = array<i64: 1, 1>, pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 1>} : (tensor<1x32x32x8xf32>) -> tensor<1x32x32x8xf32>78 return %0 : tensor<1x32x32x8xf32>79}80 81// -----82func.func @test_transpose_conv2d(%arg0: tensor<1x32x32x8xf16>, %arg1: tensor<16x1x1x8xf16>, %arg2: tensor<16xf16>, %arg3: tensor<1xf16>, %arg4: tensor<1xf16>) -> tensor<1x32x32x16xf16> {83 // expected-error@+1 {{'tosa.transpose_conv2d' op illegal: requires [pro_fp] but not enabled in target}}84 %0 = tosa.transpose_conv2d %arg0, %arg1, %arg2, %arg3, %arg4 {acc_type = f16, out_pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 1>} : (tensor<1x32x32x8xf16>, tensor<16x1x1x8xf16>, tensor<16xf16>, tensor<1xf16>, tensor<1xf16>) -> tensor<1x32x32x16xf16>85 return %0 : tensor<1x32x32x16xf16>86}87 88// -----89func.func @test_clamp(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {90 // expected-error@+1 {{'tosa.clamp' op illegal: requires [pro_fp] but not enabled in target}}91 %0 = tosa.clamp %arg0 {min_val = 0.0 : f32, max_val = 1.0 : f32} : (tensor<13x21x3xf32>) -> tensor<13x21x3xf32>92 return %0 : tensor<13x21x3xf32>93}94 95// -----96func.func @test_add(%arg0: tensor<13x21x1xf32>, %arg1: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {97 // expected-error@+1 {{'tosa.add' op illegal: requires [pro_fp] but not enabled in target}}98 %0 = tosa.add %arg0, %arg1 : (tensor<13x21x1xf32>, tensor<13x21x3xf32>) -> tensor<13x21x3xf32>99 return %0 : tensor<13x21x3xf32>100}101 102// -----103func.func @test_concat(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x21x3xf32>) -> tensor<26x21x3xf32> {104 // expected-error@+1 {{'tosa.concat' op illegal: requires [pro_fp] but not enabled in target}}105 %0 = tosa.concat %arg0, %arg1 {axis = 0 : i32} : (tensor<13x21x3xf32>, tensor<13x21x3xf32>) -> tensor<26x21x3xf32>106 return %0 : tensor<26x21x3xf32>107}108 109// -----110func.func @test_cast_i32_f32(%arg0: tensor<13x21x3xi32>) -> tensor<13x21x3xf32> {111 // expected-error@+1 {{'tosa.cast' op illegal: requires [pro_fp] but not enabled in target}}112 %0 = tosa.cast %arg0 : (tensor<13x21x3xi32>) -> tensor<13x21x3xf32>113 return %0 : tensor<13x21x3xf32>114}115 116// -----117func.func @test_max(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x21x1xf32>) -> tensor<13x21x3xf32> {118 // expected-error@+1 {{'tosa.maximum' op illegal: requires [pro_fp] but not enabled in target}}119 %0 = tosa.maximum %arg0, %arg1 : (tensor<13x21x3xf32>, tensor<13x21x1xf32>) -> tensor<13x21x3xf32>120 return %0 : tensor<13x21x3xf32>121}122 123// -----124func.func @test_mul(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x1x3xf32>, %shift: tensor<1xi8>) -> tensor<13x21x3xf32> {125 // expected-error@+1 {{'tosa.mul' op illegal: requires [pro_fp] but not enabled in target}}126 %0 = tosa.mul %arg0, %arg1, %shift : (tensor<13x21x3xf32>, tensor<13x1x3xf32>, tensor<1xi8>) -> tensor<13x21x3xf32>127 return %0 : tensor<13x21x3xf32>128}129 130// -----131func.func @test_pow(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x21x1xf32>) -> tensor<13x21x3xf32> {132 // expected-error@+1 {{'tosa.pow' op illegal: requires [pro_fp] but not enabled in target}}133 %0 = tosa.pow %arg0, %arg1 : (tensor<13x21x3xf32>, tensor<13x21x1xf32>) -> tensor<13x21x3xf32>134 return %0 : tensor<13x21x3xf32>135}136 137// -----138func.func @test_sub(%arg0: tensor<1x21x3xf32>, %arg1: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {139 // expected-error@+1 {{'tosa.sub' op illegal: requires [pro_fp] but not enabled in target}}140 %0 = tosa.sub %arg0, %arg1 : (tensor<1x21x3xf32>, tensor<13x21x3xf32>) -> tensor<13x21x3xf32>141 return %0 : tensor<13x21x3xf32>142}143 144// -----145func.func @test_abs(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {146 // expected-error@+1 {{'tosa.abs' op illegal: requires [pro_fp] but not enabled in target}}147 %0 = tosa.abs %arg0 : (tensor<13x21x3xf32>) -> tensor<13x21x3xf32>148 return %0 : tensor<13x21x3xf32>149}150 151// -----152func.func @test_ceil(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {153 // expected-error@+1 {{'tosa.ceil' op illegal: requires [pro_fp] but not enabled in target}}154 %0 = tosa.ceil %arg0 : (tensor<13x21x3xf32>) -> tensor<13x21x3xf32>155 return %0 : tensor<13x21x3xf32>156}157 158// -----159func.func @test_cos(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {160 // expected-error@+1 {{'tosa.cos' op illegal: requires [pro_fp] but not enabled in target}}161 %0 = tosa.cos %arg0 : (tensor<13x21x3xf32>) -> tensor<13x21x3xf32>162 return %0 : tensor<13x21x3xf32>163}164 165// -----166func.func @test_exp(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {167 // expected-error@+1 {{'tosa.exp' op illegal: requires [pro_fp] but not enabled in target}}168 %0 = tosa.exp %arg0 : (tensor<13x21x3xf32>) -> tensor<13x21x3xf32>169 return %0 : tensor<13x21x3xf32>170}171 172// -----173func.func @test_floor(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {174 // expected-error@+1 {{'tosa.floor' op illegal: requires [pro_fp] but not enabled in target}}175 %0 = tosa.floor %arg0 : (tensor<13x21x3xf32>) -> tensor<13x21x3xf32>176 return %0 : tensor<13x21x3xf32>177}178 179// -----180func.func @test_log(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {181 // expected-error@+1 {{'tosa.log' op illegal: requires [pro_fp] but not enabled in target}}182 %0 = tosa.log %arg0 : (tensor<13x21x3xf32>) -> tensor<13x21x3xf32>183 return %0 : tensor<13x21x3xf32>184}185 186// -----187func.func @test_negate(%arg0: tensor<13x21x3xf32>, %arg1: tensor<1xf32>, %arg2: tensor<1xf32>) -> tensor<13x21x3xf32> {188 // expected-error@+1 {{'tosa.negate' op illegal: requires [pro_fp] but not enabled in target}}189 %0 = tosa.negate %arg0, %arg1, %arg2 : (tensor<13x21x3xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<13x21x3xf32>190 return %0 : tensor<13x21x3xf32>191}192 193// -----194func.func @test_reciprocal(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {195 // expected-error@+1 {{'tosa.reciprocal' op illegal: requires [pro_fp] but not enabled in target}}196 %0 = tosa.reciprocal %arg0 : (tensor<13x21x3xf32>) -> tensor<13x21x3xf32>197 return %0 : tensor<13x21x3xf32>198}199 200// -----201func.func @test_rsqrt(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {202 // expected-error@+1 {{'tosa.rsqrt' op illegal: requires [pro_fp] but not enabled in target}}203 %0 = tosa.rsqrt %arg0 : (tensor<13x21x3xf32>) -> tensor<13x21x3xf32>204 return %0 : tensor<13x21x3xf32>205}206 207// -----208func.func @test_select(%arg0: tensor<1x1x1xi1>, %arg1: tensor<13x21x3xf32>, %arg2: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {209 // expected-error@+1 {{'tosa.select' op illegal: requires [pro_fp] but not enabled in target}}210 %0 = tosa.select %arg0, %arg1, %arg2 : (tensor<1x1x1xi1>, tensor<13x21x3xf32>, tensor<13x21x3xf32>) -> tensor<13x21x3xf32>211 return %0 : tensor<13x21x3xf32>212}213 214// -----215func.func @test_sin(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {216 // expected-error@+1 {{'tosa.sin' op illegal: requires [pro_fp] but not enabled in target}}217 %0 = tosa.sin %arg0 : (tensor<13x21x3xf32>) -> tensor<13x21x3xf32>218 return %0 : tensor<13x21x3xf32>219}220 221// -----222func.func @test_equal(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x1x3xf32>) -> tensor<13x21x3xi1> {223 // expected-error@+1 {{'tosa.equal' op illegal: requires [pro_fp] but not enabled in target}}224 %0 = tosa.equal %arg0, %arg1 : (tensor<13x21x3xf32>, tensor<13x1x3xf32>) -> tensor<13x21x3xi1>225 return %0 : tensor<13x21x3xi1>226}227 228// -----229func.func @test_greater(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x1x3xf32>) -> tensor<13x21x3xi1> {230 // expected-error@+1 {{'tosa.greater' op illegal: requires [pro_fp] but not enabled in target}}231 %0 = tosa.greater %arg0, %arg1 : (tensor<13x21x3xf32>, tensor<13x1x3xf32>) -> tensor<13x21x3xi1>232 return %0 : tensor<13x21x3xi1>233}234 235// -----236func.func @test_reduce_max(%arg0: tensor<13x21x3xf16>) -> tensor<1x21x3xf16> {237 // expected-error@+1 {{'tosa.reduce_max' op illegal: requires [pro_fp] but not enabled in target}}238 %0 = tosa.reduce_max %arg0 {axis = 0 : i32} : (tensor<13x21x3xf16>) -> tensor<1x21x3xf16>239 return %0 : tensor<1x21x3xf16>240}241 242// -----243func.func @test_reduce_sum(%arg0: tensor<13x21x3xf32>) -> tensor<1x21x3xf32> {244 // expected-error@+1 {{'tosa.reduce_sum' op illegal: requires [pro_fp] but not enabled in target}}245 %0 = tosa.reduce_sum %arg0 {axis = 0 : i32} : (tensor<13x21x3xf32>) -> tensor<1x21x3xf32>246 return %0 : tensor<1x21x3xf32>247}248 249// -----250func.func @test_concat(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x21x3xf32>) -> tensor<26x21x3xf32> {251 // expected-error@+1 {{'tosa.concat' op illegal: requires [pro_fp] but not enabled in target}}252 %0 = tosa.concat %arg0, %arg1 {axis = 0 : i32} : (tensor<13x21x3xf32>, tensor<13x21x3xf32>) -> tensor<26x21x3xf32>253 return %0 : tensor<26x21x3xf32>254}255 256// -----257func.func @test_pad(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {258 %padding = tosa.const_shape {values = dense<0> : tensor<6xindex>} : () -> !tosa.shape<6>259 // expected-error@+1 {{'tosa.const' op illegal: requires [pro_fp] but not enabled in target}}260 %pad_const = "tosa.const"() {values = dense<3.14> : tensor<1xf32>} : () -> tensor<1xf32>261 // expected-error@+1 {{'tosa.pad' op illegal: requires [pro_fp] but not enabled in target}}262 %0 = tosa.pad %arg0, %padding, %pad_const : (tensor<13x21x3xf32>, !tosa.shape<6>, tensor<1xf32>) -> tensor<13x21x3xf32>263 return %0 : tensor<13x21x3xf32>264}265 266// -----267func.func @test_reshape(%arg0: tensor<13x21x3xf32>) -> tensor<1x819xf32> {268 %1 = tosa.const_shape {values = dense<[1, 819]> : tensor<2xindex>} : () -> !tosa.shape<2>269 // expected-error@+1 {{'tosa.reshape' op illegal: requires [pro_fp] but not enabled in target}}270 %0 = tosa.reshape %arg0, %1 : (tensor<13x21x3xf32>, !tosa.shape<2>) -> tensor<1x819xf32>271 return %0 : tensor<1x819xf32>272}273 274// -----275func.func @test_reverse(%arg0: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> {276 // expected-error@+1 {{'tosa.reverse' op illegal: requires [pro_fp] but not enabled in target}}277 %0 = tosa.reverse %arg0 {axis = 0 : i32} : (tensor<13x21x3xf32>) -> tensor<13x21x3xf32>278 return %0 : tensor<13x21x3xf32>279}280 281// -----282func.func @test_slice(%arg0: tensor<13x21x3xf32>) -> tensor<4x11x1xf32> {283 %0 = tosa.const_shape {values = dense<[4, 11, 1]> : tensor<3xindex>} : () -> !tosa.shape<3>284 %1 = tosa.const_shape {values = dense<[6, 8, 0]> : tensor<3xindex>} : () -> !tosa.shape<3>285 // expected-error@+1 {{'tosa.slice' op illegal: requires [pro_fp] but not enabled in target}}286 %2 = tosa.slice %arg0, %0, %1 : (tensor<13x21x3xf32>, !tosa.shape<3>, !tosa.shape<3>) -> tensor<4x11x1xf32>287 return %2 : tensor<4x11x1xf32>288}289 290// -----291func.func @test_tile(%arg0: tensor<13x21x3xf32>) -> tensor<39x21x6xf32> {292 %cst = tosa.const_shape { values = dense<[3, 1, 2]> : tensor<3xindex> } : () -> !tosa.shape<3>293 // expected-error@+1 {{'tosa.tile' op illegal: requires [pro_fp] but not enabled in target}}294 %0 = tosa.tile %arg0, %cst: (tensor<13x21x3xf32>, !tosa.shape<3>) -> tensor<39x21x6xf32>295 return %0 : tensor<39x21x6xf32>296}297 298// -----299func.func @test_transpose(%arg0: tensor<13x21x3xf32>, %arg1: tensor<3xi32>) -> tensor<3x13x21xf32> {300 // expected-error@+1 {{'tosa.transpose' op illegal: requires [pro_fp] but not enabled in target}}301 %1 = tosa.transpose %arg0 {perms = array<i32: 2, 0, 1>}: (tensor<13x21x3xf32>) -> tensor<3x13x21xf32>302 return %1 : tensor<3x13x21xf32>303}304 305// -----306func.func @test_gather(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x26xi32>) -> tensor<13x26x3xf32> {307 // expected-error@+1 {{'tosa.gather' op illegal: requires [pro_fp] but not enabled in target}}308 %0 = tosa.gather %arg0, %arg1 : (tensor<13x21x3xf32>, tensor<13x26xi32>) -> tensor<13x26x3xf32>309 return %0 : tensor<13x26x3xf32>310}311 312// -----313func.func @test_scatter(%arg0: tensor<13x28x3xf32>, %arg1: tensor<13x26xi32>, %arg2: tensor<13x26x3xf32>) -> tensor<13x28x3xf32> {314 // expected-error@+1 {{'tosa.scatter' op illegal: requires [pro_fp] but not enabled in target}}315 %0 = tosa.scatter %arg0, %arg1, %arg2 : (tensor<13x28x3xf32>, tensor<13x26xi32>, tensor<13x26x3xf32>) -> tensor<13x28x3xf32>316 return %0 : tensor<13x28x3xf32>317}318 319// -----320func.func @test_resize(%arg0: tensor<1x32x32x8xf32>) -> tensor<1x64x64x8xf32> {321 %scale = tosa.const_shape { values = dense<[4, 2, 4, 2]> : tensor<4xindex> } : () -> !tosa.shape<4>322 %offset = tosa.const_shape { values = dense<[-1, -1]> : tensor<2xindex> } : () -> !tosa.shape<2>323 %border = tosa.const_shape { values = dense<[1, 1]> : tensor<2xindex> } : () -> !tosa.shape<2>324 // expected-error@+1 {{'tosa.resize' op illegal: requires [pro_fp] but not enabled in target}}325 %1 = tosa.resize %arg0, %scale, %offset, %border { mode = BILINEAR } : (tensor<1x32x32x8xf32>, !tosa.shape<4>, !tosa.shape<2>, !tosa.shape<2>) -> tensor<1x64x64x8xf32>326 return %1 : tensor<1x64x64x8xf32>327}328 329// -----330func.func @test_matmul_t_block_scaled(%arg0: tensor<4x8x32xf6E3M2FN>, %arg1: tensor<4x8x1xf8E8M0FNU>, %arg2: tensor<4x16x32xf6E3M2FN>, %arg3: tensor<4x16x1xf8E8M0FNU>) -> tensor<4x8x16xf32> {331 // expected-error@+1 {{'tosa.matmul_t_block_scaled' op illegal: requires [pro_fp] but not enabled in target}}332 %0 = tosa.matmul_t_block_scaled %arg0, %arg1, %arg2, %arg3 {block_size = #tosa.block_size<BLOCK_SIZE_32>} : (tensor<4x8x32xf6E3M2FN>, tensor<4x8x1xf8E8M0FNU>, tensor<4x16x32xf6E3M2FN>, tensor<4x16x1xf8E8M0FNU>) -> tensor<4x8x16xf32>333 return %0 : tensor<4x8x16xf32>334}335 336// -----337func.func @test_cast_from_block_scaled_static(%arg0: tensor<4x32xf4E2M1FN>, %arg1: tensor<4x1xf8E8M0FNU>) -> tensor<4x32xf32> {338 // expected-error@+1 {{'tosa.cast_from_block_scaled' op illegal: requires [pro_fp] but not enabled in target}}339 %0 = tosa.cast_from_block_scaled %arg0, %arg1 {block_size = #tosa.block_size<BLOCK_SIZE_32> : i32} : (tensor<4x32xf4E2M1FN>, tensor<4x1xf8E8M0FNU>) -> tensor<4x32xf32>340 return %0 : tensor<4x32xf32>341}342 343// -----344func.func @test_cast_to_block_scaled_static(%arg0: tensor<4x32xf32>) -> (tensor<4x32xf4E2M1FN>, tensor<4x1xf8E8M0FNU>) {345 // expected-error@+1 {{'tosa.cast_to_block_scaled' op illegal: requires [pro_fp] but not enabled in target}}346 %0:2 = tosa.cast_to_block_scaled %arg0 {block_size = #tosa.block_size<BLOCK_SIZE_32>} : (tensor<4x32xf32>) -> (tensor<4x32xf4E2M1FN>, tensor<4x1xf8E8M0FNU>)347 return %0#0, %0#1 : tensor<4x32xf4E2M1FN>, tensor<4x1xf8E8M0FNU>348}349