@@ -85,7 +85,28 @@ struct mem_payload_t<
8585 using mem_dtype = typename std::
8686 conditional_t <mem_transpose_dtype_less4bytes, uint32_t , dtype>;
8787 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;
89110 uint32_t surface_width;
90111 uint32_t surface_height;
91112 uint32_t surface_pitch;
@@ -106,7 +127,7 @@ struct mem_payload_t<
106127 }
107128
108129 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 ;
110131 this ->surface_width =
111132 (mem_transpose ? mem_desc.shape .y : mem_desc.shape .x ) * sizeof (dtype);
112133 this ->surface_height =
@@ -131,7 +152,7 @@ struct mem_payload_t<
131152 uint32_t surface_pitch,
132153 int32_t surface_offset_x = 0 ,
133154 int32_t surface_offset_y = 0 ) {
134- this ->base_ptr = (mem_dtype*) p;
155+ this ->base_ptr = p;
135156 this ->surface_width = surface_width * sizeof (dtype);
136157 this ->surface_height = surface_height;
137158 this ->surface_pitch = surface_pitch * sizeof (dtype);
@@ -152,7 +173,7 @@ struct mem_payload_t<
152173 }
153174
154175 __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 ;
156177 this ->surface_width =
157178 (mem_transpose ? mem_desc.shape .y : mem_desc.shape .x ) * sizeof (dtype);
158179 this ->surface_height =
@@ -185,7 +206,7 @@ struct mem_payload_t<
185206 uint32_t surface_pitch,
186207 int32_t surface_offset_x = 0 ,
187208 int32_t surface_offset_y = 0 ) {
188- this ->base_ptr = (mem_dtype*) p;
209+ this ->base_ptr = p;
189210 this ->surface_width = surface_width * sizeof (dtype);
190211 this ->surface_height = surface_height;
191212 this ->surface_pitch = surface_pitch * sizeof (dtype);
0 commit comments