@@ -84,7 +84,28 @@ struct mem_payload_t<
8484 using mem_dtype = typename std::
8585 conditional_t <mem_transpose_dtype_less4bytes, uint32_t , dtype>;
8686 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;
88109 uint32_t surface_width;
89110 uint32_t surface_height;
90111 uint32_t surface_pitch;
@@ -105,7 +126,7 @@ struct mem_payload_t<
105126 }
106127
107128 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 ;
109130 this ->surface_width =
110131 (mem_transpose ? mem_desc.shape .y : mem_desc.shape .x ) * sizeof (dtype);
111132 this ->surface_height =
@@ -130,7 +151,7 @@ struct mem_payload_t<
130151 uint32_t surface_pitch,
131152 int32_t surface_offset_x = 0 ,
132153 int32_t surface_offset_y = 0 ) {
133- this ->base_ptr = (mem_dtype*) p;
154+ this ->base_ptr = p;
134155 this ->surface_width = surface_width * sizeof (dtype);
135156 this ->surface_height = surface_height;
136157 this ->surface_pitch = surface_pitch * sizeof (dtype);
@@ -151,7 +172,7 @@ struct mem_payload_t<
151172 }
152173
153174 __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 ;
155176 this ->surface_width =
156177 (mem_transpose ? mem_desc.shape .y : mem_desc.shape .x ) * sizeof (dtype);
157178 this ->surface_height =
@@ -184,7 +205,7 @@ struct mem_payload_t<
184205 uint32_t surface_pitch,
185206 int32_t surface_offset_x = 0 ,
186207 int32_t surface_offset_y = 0 ) {
187- this ->base_ptr = (mem_dtype*) p;
208+ this ->base_ptr = p;
188209 this ->surface_width = surface_width * sizeof (dtype);
189210 this ->surface_height = surface_height;
190211 this ->surface_pitch = surface_pitch * sizeof (dtype);
0 commit comments