@@ -82,16 +82,33 @@ func.func @test_load_nd_vc_4(%src: memref<24x32xf32>) {
82
82
%1 = xegpu.create_nd_tdesc %src [0 , 0 ] : memref <24 x32 xf32 > ->
83
83
!xegpu.tensor_desc <8 x16 xf32 , #xegpu.sg_map <wi_layout = [1 , 16 ], wi_data = [1 , 1 ]>>
84
84
// 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 >
86
89
return
87
90
}
88
91
89
92
// -----
90
93
func.func @test_load_nd_vc_5 (%src: memref <24 x32 xf32 >) {
91
94
%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 ]>>
93
96
// 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 >
95
112
return
96
113
}
97
114
@@ -116,6 +133,35 @@ func.func @test_store_nd_vc_2(%dst: memref<16xf16>) {
116
133
return
117
134
}
118
135
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
+
119
165
// -----
120
166
func.func @test_update_nd_offset_1 (%dst: memref <16 xf16 >) {
121
167
%0 = arith.constant dense <[0 , 2 , 4 , 6 , 8 , 10 , 12 , 14 ]> : vector <8 xindex >
0 commit comments