Skip to content

Commit 235bec3

Browse files
Fixing the intrinsic offset for openCL 2d Load/prefetch built-ins functions (#336)
One of the differences between the intrinsic and the built-in function (the SPIR-V instruction is the same) is that the intrinsic mapped directly to the HW, so it needed the "-1", but the built-in function and the SPIR-V instruction should just take the width, height, and pitch as-is. When we have the size 1 for the hight, the -1 was causing an issue on BMG making tests to fail. Since the openCL built-ins mainly used in prefetch it was causing segfault in the code when prefetch is used. Co-authored-by: Alejandro Acosta <[email protected]>
1 parent 167f160 commit 235bec3

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

include/cute/arch/xe_copy_1B.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ struct XE_2D_U8x1x64_LD_N {
607607
intel::coord_t coord) {
608608
#if defined(SYCL_INTEL_TARGET)
609609
intel_sub_group_2d_block_prefetch_8b_1r32x2c(
610-
(__global void*)baseoffset, width - 1, height - 1, pitch - 1, coord);
610+
(__global void*)baseoffset, width, height, pitch, coord);
611611
#else
612612
CUTE_INVALID_CONTROL_PATH(
613613
"Trying to use block prefetch on non-PVC hardware");
@@ -639,7 +639,7 @@ struct XE_2D_U8x2x64_LD_N {
639639
intel::coord_t coord) {
640640
#if defined(SYCL_INTEL_TARGET)
641641
intel_sub_group_2d_block_prefetch_8b_2r32x2c(
642-
(__global void*)baseoffset, width - 1, height - 1, pitch - 1, coord);
642+
(__global void*)baseoffset, width, height, pitch, coord);
643643
#else
644644
CUTE_INVALID_CONTROL_PATH(
645645
"Trying to use block prefetch on non-PVC hardware");
@@ -671,7 +671,7 @@ struct XE_2D_U8x4x64_LD_N {
671671
intel::coord_t coord) {
672672
#if defined(SYCL_INTEL_TARGET)
673673
intel_sub_group_2d_block_prefetch_8b_4r32x2c(
674-
(__global void*)baseoffset, width - 1, height - 1, pitch - 1, coord);
674+
(__global void*)baseoffset, width, height, pitch, coord);
675675
#else
676676
CUTE_INVALID_CONTROL_PATH(
677677
"Trying to use block prefetch on non-PVC hardware");
@@ -703,7 +703,7 @@ struct XE_2D_U8x8x64_LD_N {
703703
intel::coord_t coord) {
704704
#if defined(SYCL_INTEL_TARGET)
705705
intel_sub_group_2d_block_prefetch_8b_8r32x2c(
706-
(__global void*)baseoffset, width - 1, height - 1, pitch - 1, coord);
706+
(__global void*)baseoffset, width, height, pitch, coord);
707707
#else
708708
CUTE_INVALID_CONTROL_PATH(
709709
"Trying to use block prefetch on non-PVC hardware");
@@ -803,7 +803,7 @@ struct XE_2D_U8x32x16_LD_V {
803803
intel::coord_t coord) {
804804
#if defined(SYCL_INTEL_TARGET)
805805
intel_sub_group_2d_block_prefetch_8b_32r16x1c(
806-
(__global void*)baseoffset, width - 1, height - 1, pitch - 1, coord);
806+
(__global void*)baseoffset, width, height, pitch, coord);
807807
#else
808808
CUTE_INVALID_CONTROL_PATH(
809809
"Trying to use block prefetch on non-PVC hardware");

include/cute/arch/xe_copy_2B.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ struct XE_2D_U16x1x32_LD_N {
431431
intel::coord_t coord) {
432432
#if defined(SYCL_INTEL_TARGET)
433433
intel_sub_group_2d_block_prefetch_16b_1r16x2c(
434-
(__global void*)baseoffset, width - 1, height - 1, pitch - 1, coord);
434+
(__global void*)baseoffset, width, height, pitch, coord);
435435
#else
436436
CUTE_INVALID_CONTROL_PATH(
437437
"Trying to use block prefetch on non-PVC hardware");
@@ -463,7 +463,7 @@ struct XE_2D_U16x2x32_LD_N {
463463
intel::coord_t coord) {
464464
#if defined(SYCL_INTEL_TARGET)
465465
intel_sub_group_2d_block_prefetch_16b_2r16x2c(
466-
(__global void*)baseoffset, width - 1, height - 1, pitch - 1, coord);
466+
(__global void*)baseoffset, width, height, pitch, coord);
467467
#else
468468
CUTE_INVALID_CONTROL_PATH(
469469
"Trying to use block prefetch on non-PVC hardware");
@@ -495,7 +495,7 @@ struct XE_2D_U16x4x32_LD_N {
495495
intel::coord_t coord) {
496496
#if defined(SYCL_INTEL_TARGET)
497497
intel_sub_group_2d_block_prefetch_16b_4r16x2c(
498-
(__global void*)baseoffset, width - 1, height - 1, pitch - 1, coord);
498+
(__global void*)baseoffset, width, height, pitch , coord);
499499
#else
500500
CUTE_INVALID_CONTROL_PATH(
501501
"Trying to use block prefetch on non-PVC hardware");

include/cute/arch/xe_copy_4B.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ struct XE_2D_TF32x16x16_LD_N {
589589
intel::coord_t coord) {
590590
#if defined(SYCL_INTEL_TARGET)
591591
intel_sub_group_2d_block_prefetch_32b_16r8x1c(
592-
(__global void*)baseoffset, width - 1, height - 1, pitch - 1, coord);
592+
(__global void*)baseoffset, width, height, pitch, coord);
593593
#else
594594
CUTE_INVALID_CONTROL_PATH(
595595
"Trying to use block prefetch on non-Xe hardware");
@@ -701,7 +701,7 @@ struct XE_2D_U32x16x8_LD_T {
701701
intel::coord_t coord) {
702702
#if defined(SYCL_INTEL_TARGET)
703703
intel_sub_group_2d_block_prefetch_32b_16r8x1c(
704-
(__global void*)baseoffset, width - 1, height - 1, pitch - 1, coord);
704+
(__global void*)baseoffset, width, height, pitch, coord);
705705
#else
706706
CUTE_INVALID_CONTROL_PATH(
707707
"Trying to use block prefetch on non-PVC hardware");

0 commit comments

Comments
 (0)