@@ -435,9 +435,15 @@ struct mem_payload_t<
435
435
uint64_t base_offset;
436
436
dtype* base_ptr;
437
437
uint32_t pitch_in_bytes;
438
+ uint32_t height_in_elems;
439
+ uint32_t width_in_elems;
440
+ uint32_t payload_bytes;
438
441
439
442
inline mem_payload_t (mem_desc_t & mem_tdesc) {
440
443
pitch_in_bytes = mem_tdesc.shape .stride * sizeof (dtype);
444
+ width_in_elems = mem_tdesc.shape .x ;
445
+ height_in_elems = mem_tdesc.shape .y ;
446
+ payload_bytes = width_in_elems * height_in_elems * sizeof (dtype);
441
447
uint32_t offset_x = mem_tdesc.coord .x ;
442
448
uint32_t offset_y = mem_tdesc.coord .y ;
443
449
base_offset = mem_transpose
@@ -448,14 +454,17 @@ struct mem_payload_t<
448
454
449
455
inline mem_payload_t (
450
456
dtype* p,
451
- [[maybe_unused]] int surface_width,
452
- [[maybe_unused]] int surface_height,
457
+ int surface_width,
458
+ int surface_height,
453
459
int surface_pitch,
454
460
int surface_offset_x,
455
461
int surface_offset_y) {
456
462
pitch_in_bytes = surface_pitch * sizeof (dtype);
457
463
uint32_t offset_x = surface_offset_x;
458
464
uint32_t offset_y = surface_offset_y;
465
+ width_in_elems = surface_width;
466
+ height_in_elems = surface_height;
467
+ payload_bytes = width_in_elems * height_in_elems * sizeof (dtype);
459
468
base_offset = mem_transpose
460
469
? offset_x * pitch_in_bytes + offset_y * sizeof (dtype)
461
470
: offset_y * pitch_in_bytes + offset_x * sizeof (dtype);
@@ -466,6 +475,9 @@ struct mem_payload_t<
466
475
pitch_in_bytes = mem_tdesc.shape .stride * sizeof (dtype);
467
476
uint32_t offset_x = mem_tdesc.coord .x ;
468
477
uint32_t offset_y = mem_tdesc.coord .y ;
478
+ width_in_elems = mem_tdesc.shape .x ;
479
+ height_in_elems = mem_tdesc.shape .y ;
480
+ payload_bytes = width_in_elems * height_in_elems * sizeof (dtype);
469
481
base_offset = mem_transpose
470
482
? offset_x * pitch_in_bytes + offset_y * sizeof (dtype)
471
483
: offset_y * pitch_in_bytes + offset_x * sizeof (dtype);
@@ -474,14 +486,17 @@ struct mem_payload_t<
474
486
475
487
__XETLA_API void init (
476
488
dtype* p,
477
- [[maybe_unused]] int surface_width,
478
- [[maybe_unused]] int surface_height,
489
+ int surface_width,
490
+ int surface_height,
479
491
int surface_pitch,
480
492
int surface_offset_x,
481
493
int surface_offset_y) {
482
494
pitch_in_bytes = surface_pitch * sizeof (dtype);
483
495
uint32_t offset_x = surface_offset_x;
484
496
uint32_t offset_y = surface_offset_y;
497
+ width_in_elems = surface_width;
498
+ height_in_elems = surface_height;
499
+ payload_bytes = width_in_elems * height_in_elems * sizeof (dtype);
485
500
base_offset = mem_transpose
486
501
? offset_x * pitch_in_bytes + offset_y * sizeof (dtype)
487
502
: offset_y * pitch_in_bytes + offset_x * sizeof (dtype);
@@ -492,13 +507,19 @@ struct mem_payload_t<
492
507
this ->base_offset = rhs.base_offset ;
493
508
this ->base_ptr = rhs.base_ptr ;
494
509
this ->pitch_in_bytes = rhs.pitch_in_bytes ;
510
+ this ->width_in_elems = rhs.width_in_elems ;
511
+ this ->height_in_elems = rhs.height_in_elems ;
512
+ this ->payload_bytes = rhs.payload_bytes ;
495
513
}
496
514
497
515
inline mem_payload_t () = default ;
498
516
inline this_payload_t & operator =(const this_payload_t & rhs) {
499
517
this ->base_offset = rhs.base_offset ;
500
518
this ->base_ptr = rhs.base_ptr ;
501
519
this ->pitch_in_bytes = rhs.pitch_in_bytes ;
520
+ this ->width_in_elems = rhs.width_in_elems ;
521
+ this ->height_in_elems = rhs.height_in_elems ;
522
+ this ->payload_bytes = rhs.payload_bytes ;
502
523
return *this ;
503
524
}
504
525
0 commit comments