@@ -384,6 +384,14 @@ func.func @load_gather_vc_3(%src: ui64) {
384384 return
385385}
386386
387+ // -----
388+ func.func @prefetch_offset_wi_1 (%src: memref <4 x4 xf32 >) {
389+ %offsets = arith.constant dense <[0 ]> : vector <1 xindex >
390+ // expected-error@+1 {{Expecting the source is a 1D memref or pointer}}
391+ xegpu.prefetch %src [%offsets ]: memref <4 x4 xf32 >, vector <1 xindex >
392+ return
393+ }
394+
387395// -----
388396func.func @load_gather_offset_sg (%src: memref <?xf16 >) {
389397 %offsets = arith.constant dense <[0 , 8 , 16 , 24 ]> : vector <4 xindex >
@@ -405,7 +413,7 @@ func.func @load_gather_offset_wi(%src: ui64) {
405413}
406414
407415// -----
408- func.func @store_scatter_offset_wi (%src: memref <?xf16 >) {
416+ func.func @store_scatter_offset_wi_1 (%src: memref <?xf16 >) {
409417 %val = arith.constant dense <2.9 >: vector <4 xf16 >
410418 %offsets = arith.constant dense <[0 ]> : vector <1 xindex >
411419 %mask = arith.constant dense <1 >: vector <1 xi1 >
@@ -415,17 +423,34 @@ func.func @store_scatter_offset_wi(%src: memref<?xf16>) {
415423 return
416424}
417425
426+ // -----
427+ func.func @store_scatter_offset_wi_2 (%src: memref <4 x4 xf16 >) {
428+ %val = arith.constant dense <2.9 >: vector <4 xf16 >
429+ %offsets = arith.constant dense <[0 ]> : vector <1 xindex >
430+ %mask = arith.constant dense <1 >: vector <1 xi1 >
431+ // expected-error@+1 {{Expecting the dest is a 1D memref or pointer}}
432+ xegpu.store %val , %src [%offsets ], %mask
433+ : vector <4 xf16 >, memref <4 x4 xf16 >, vector <1 xindex >, vector <1 xi1 >
434+ return
435+ }
418436
419437// -----
420- func.func @load_gather_offset_wi (%src: ui64 ) {
421- %val = arith.constant dense <2.9 >: vector <4 x2 xf16 >
438+ func.func @load_gather_offset_wi_2 (%src: ui64 ) {
422439 %mask = arith.constant dense <1 >: vector <1 xi1 >
423440 %offsets = arith.constant dense <[0 ]> : vector <1 xindex >
424441 // expected-error@+1 {{value elements must match chunk size}}
425- %2 = xegpu.load %src [%offsets ], %mask <{chunk_size = 2 }> : ui64 , vector <1 xindex >, vector <1 xi1 > -> vector <4 x f32 >
442+ %2 = xegpu.load %src [%offsets ], %mask <{chunk_size = 2 }> : ui64 , vector <1 xindex >, vector <1 xi1 > -> vector <4 x f16 >
426443 return
427444}
428445
446+ // -----
447+ func.func @load_gather_offset_wi_1 (%src: memref <4 x4 xf32 >) {
448+ %mask = arith.constant dense <1 >: vector <1 xi1 >
449+ %offsets = arith.constant dense <[0 ]> : vector <1 xindex >
450+ // expected-error@+1 {{Expecting the source is a 1D memref or pointer}}
451+ %2 = xegpu.load %src [%offsets ], %mask <{chunk_size = 2 }> : memref <4 x4 xf32 >, vector <1 xindex >, vector <1 xi1 > -> vector <2 xf32 >
452+ return
453+ }
429454
430455// -----
431456func.func @store_scatter_vc_1 (%src: memref <24 x32 xf32 >) {
0 commit comments