@@ -82,16 +82,33 @@ func.func @test_load_nd_vc_4(%src: memref<24x32xf32>) {
8282 %1 = xegpu.create_nd_tdesc %src [0 , 0 ] : memref <24 x32 xf32 > ->
8383 !xegpu.tensor_desc <8 x16 xf32 , #xegpu.sg_map <wi_layout = [1 , 16 ], wi_data = [1 , 1 ]>>
8484 // expected-error@+1 {{Result shape doesn't match TensorDesc shape.}}
85- %2 = xegpu.load_nd %1 <{l1_hint = #xegpu.cache_hint <cached >, l2_hint = #xegpu.cache_hint <uncached >}> : !xegpu.tensor_desc <8 x16 xf32 , #xegpu.sg_map <wi_layout = [1 , 16 ], wi_data = [1 , 1 ]>> -> vector <8 x2 xf32 >
85+ %2 = xegpu.load_nd %1 <{l1_hint = #xegpu.cache_hint <cached >,
86+ l2_hint = #xegpu.cache_hint <uncached >}>
87+ : !xegpu.tensor_desc <8 x16 xf32 , #xegpu.sg_map <wi_layout = [1 , 16 ], wi_data = [1 , 1 ]>>
88+ -> vector <8 x2 xf32 >
8689 return
8790}
8891
8992// -----
9093func.func @test_load_nd_vc_5 (%src: memref <24 x32 xf32 >) {
9194 %1 = xegpu.create_nd_tdesc %src [0 , 0 ] : memref <24 x32 xf32 > ->
92- !xegpu.tensor_desc <16 xf32 , #xegpu.sg_map <wi_layout = [1 , 16 ], wi_data = [1 , 1 ]>>
95+ !xegpu.tensor_desc <16 xf32 , #xegpu.sg_map <wi_layout = [1 , 16 ], wi_data = [1 , 1 ]>>
9396 // expected-error@+1 {{Result shape doesn't match TensorDesc shape.}}
94- %2 = xegpu.load_nd %1: !xegpu.tensor_desc <16 xf32 , #xegpu.sg_map <wi_layout = [1 , 16 ], wi_data = [1 , 1 ]>> -> vector <16 xf32 >
97+ %2 = xegpu.load_nd %1 <{l1_hint = #xegpu.cache_hint <cached >,
98+ l2_hint = #xegpu.cache_hint <uncached >}>
99+ : !xegpu.tensor_desc <16 xf32 , #xegpu.sg_map <wi_layout = [1 , 16 ], wi_data = [1 , 1 ]>>
100+ -> vector <8 xf32 >
101+ return
102+ }
103+
104+ // -----
105+ func.func @test_load_nd_vc_6 (%src: memref <24 x32 xf32 >) {
106+ %1 = xegpu.create_nd_tdesc %src [0 , 0 ] : memref <24 x32 xf32 > ->
107+ !xegpu.tensor_desc <8 x16 xf32 >
108+ // expected-error@+1 {{Result shape doesn't match TensorDesc shape.}}
109+ %2 = xegpu.load_nd %1 <{l1_hint = #xegpu.cache_hint <cached >,
110+ l2_hint = #xegpu.cache_hint <uncached >}>
111+ : !xegpu.tensor_desc <8 x16 xf32 > -> vector <8 x1 xf32 >
95112 return
96113}
97114
@@ -116,6 +133,35 @@ func.func @test_store_nd_vc_2(%dst: memref<16xf16>) {
116133 return
117134}
118135
136+ // -----
137+ func.func @test_store_nd_vc_3 (%dst: memref <24 x32 xf32 >, %data: vector <8 x2 xf32 >) {
138+ %1 = xegpu.create_nd_tdesc %dst [0 , 0 ] : memref <24 x32 xf32 > ->
139+ !xegpu.tensor_desc <8 x16 xf32 , #xegpu.sg_map <wi_layout = [1 , 16 ], wi_data = [1 , 1 ]>>
140+ // expected-error@+1 {{Result shape doesn't match TensorDesc shape.}}
141+ xegpu.store_nd %data , %1
142+ : vector <8 x2 xf32 >, !xegpu.tensor_desc <8 x16 xf32 , #xegpu.sg_map <wi_layout = [1 , 16 ], wi_data = [1 , 1 ]>>
143+ return
144+ }
145+
146+ // -----
147+ func.func @test_store_nd_vc_4 (%dst: memref <24 x32 xf32 >, %data: vector <2 xf32 >) {
148+ %1 = xegpu.create_nd_tdesc %dst [0 , 0 ] : memref <24 x32 xf32 > ->
149+ !xegpu.tensor_desc <16 xf32 , #xegpu.sg_map <wi_layout = [1 , 16 ], wi_data = [1 , 1 ]>>
150+ // expected-error@+1 {{Result shape doesn't match TensorDesc shape.}}
151+ xegpu.store_nd %data , %1
152+ : vector <2 xf32 >, !xegpu.tensor_desc <16 xf32 , #xegpu.sg_map <wi_layout = [1 , 16 ], wi_data = [1 , 1 ]>>
153+ return
154+ }
155+
156+ // -----
157+ func.func @test_store_nd_vc_5 (%dst: memref <24 x32 xf32 >, %data: vector <8 x1 xf32 >) {
158+ %1 = xegpu.create_nd_tdesc %dst [0 , 0 ] : memref <24 x32 xf32 > ->
159+ !xegpu.tensor_desc <8 x16 xf32 >
160+ // expected-error@+1 {{Result shape doesn't match TensorDesc shape.}}
161+ xegpu.store_nd %data , %1 : vector <8 x1 xf32 >, !xegpu.tensor_desc <8 x16 xf32 >
162+ return
163+ }
164+
119165// -----
120166func.func @test_update_nd_offset_1 (%dst: memref <16 xf16 >) {
121167 %0 = arith.constant dense <[0 , 2 , 4 , 6 , 8 , 10 , 12 , 14 ]> : vector <8 xindex >
0 commit comments