@@ -85,7 +85,28 @@ struct mem_payload_t<
85
85
using mem_dtype = typename std::
86
86
conditional_t <mem_transpose_dtype_less4bytes, uint32_t , dtype>;
87
87
static constexpr uint32_t scale_factor = sizeof (mem_dtype) / sizeof (dtype);
88
- mem_dtype* base_ptr;
88
+
89
+ using load_store_attr = load_store_attr_t <msg_type::block_2d, arch_tag>;
90
+
91
+ static constexpr uint32_t max_load_width_in_elem = trans
92
+ ? load_store_attr::max_trans_load_width_in_bytes / sizeof (dtype)
93
+ : load_store_attr::max_load_width_in_bytes / sizeof (dtype);
94
+ static constexpr uint32_t max_load_height_in_elem = trans
95
+ ? load_store_attr::max_trans_load_height_in_elem
96
+ : load_store_attr::max_load_height_in_elem;
97
+
98
+ static constexpr uint32_t max_store_width_in_elem =
99
+ load_store_attr::max_store_width_in_bytes / sizeof (dtype);
100
+ static constexpr uint32_t max_store_height_in_elem =
101
+ load_store_attr::max_store_height_in_elem;
102
+
103
+ static constexpr uint32_t elems_per_CL =
104
+ load_store_attr::cache_line_size_in_bytes / sizeof (dtype);
105
+
106
+ static constexpr uint32_t elems_per_reg =
107
+ register_bytes_t <arch_tag>::reg_in_bytes / sizeof (dtype);
108
+
109
+ dtype* base_ptr;
89
110
uint32_t surface_width;
90
111
uint32_t surface_height;
91
112
uint32_t surface_pitch;
@@ -106,7 +127,7 @@ struct mem_payload_t<
106
127
}
107
128
108
129
inline mem_payload_t (mem_desc_t & mem_desc) {
109
- this ->base_ptr = (mem_dtype *)mem_desc.base .base ;
130
+ this ->base_ptr = (dtype *)mem_desc.base .base ;
110
131
this ->surface_width =
111
132
(mem_transpose ? mem_desc.shape .y : mem_desc.shape .x ) * sizeof (dtype);
112
133
this ->surface_height =
@@ -131,7 +152,7 @@ struct mem_payload_t<
131
152
uint32_t surface_pitch,
132
153
int32_t surface_offset_x = 0 ,
133
154
int32_t surface_offset_y = 0 ) {
134
- this ->base_ptr = (mem_dtype*) p;
155
+ this ->base_ptr = p;
135
156
this ->surface_width = surface_width * sizeof (dtype);
136
157
this ->surface_height = surface_height;
137
158
this ->surface_pitch = surface_pitch * sizeof (dtype);
@@ -152,7 +173,7 @@ struct mem_payload_t<
152
173
}
153
174
154
175
__XETLA_API void init (mem_desc_t & mem_desc) {
155
- this ->base_ptr = (mem_dtype *)mem_desc.base .base ;
176
+ this ->base_ptr = (dtype *)mem_desc.base .base ;
156
177
this ->surface_width =
157
178
(mem_transpose ? mem_desc.shape .y : mem_desc.shape .x ) * sizeof (dtype);
158
179
this ->surface_height =
@@ -185,7 +206,7 @@ struct mem_payload_t<
185
206
uint32_t surface_pitch,
186
207
int32_t surface_offset_x = 0 ,
187
208
int32_t surface_offset_y = 0 ) {
188
- this ->base_ptr = (mem_dtype*) p;
209
+ this ->base_ptr = p;
189
210
this ->surface_width = surface_width * sizeof (dtype);
190
211
this ->surface_height = surface_height;
191
212
this ->surface_pitch = surface_pitch * sizeof (dtype);
0 commit comments