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