Skip to contentSkip to conversation

lib/intel_compute: Fix localgroup size passed in indirect data for Xe3p

PATCH In review Zbigniew Kempczyński 3 participants 3 messages May 4 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/intel_compute: Fix localgroup size passed in indirect data for Xe3p

Previously hardcoded constants are not correct for handling larger buffers in compute square tests in Xe3p. Replace these values to commonly used localgroup size definitions.

---
 lib/intel_compute.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
lib/intel_compute.c +5 -5
index 7dda423c80..680675982a 100644
@@ -2054,7 +2054,7 @@ static void xe3p_compute_exec_compute(int fd,
 	addr_bo_buffer_batch[b++] = 0x008004A0; /* dw3 */
 	addr_bo_buffer_batch[b++] = 0xBE040000; /* dw4 */
 	addr_bo_buffer_batch[b++] = 0xFFFFFFFF; /* dw5 */
-	addr_bo_buffer_batch[b++] = 0x000001FF; /* dw6 */
+	addr_bo_buffer_batch[b++] = 0x000003FF; /* dw6 */ // Local X/Y/Z Dimension
 
 	if (threadgroup_preemption)
 		addr_bo_buffer_batch[b++] = XE2_THREADGROUP_PREEMPT_XDIM; // Thread Group ID X Dimension
@@ -2081,7 +2081,7 @@ static void xe3p_compute_exec_compute(int fd,
 
 	addr_bo_buffer_batch[b++] = 0x00000000; /* dw22 */
 	addr_bo_buffer_batch[b++] = 0x00000000; /* dw23 */
-	addr_bo_buffer_batch[b++] = 0x0C000010; /* dw24 */
+	addr_bo_buffer_batch[b++] = 0x0C000000 | THREADS_PER_GROUP; /* dw24 */
 	addr_bo_buffer_batch[b++] = 0x00000000; /* dw25 */
 	addr_bo_buffer_batch[b++] = 0x00000400; /* dw26 */
 
@@ -2135,9 +2135,9 @@ static void xe3p_create_indirect_data(uint32_t *addr_bo_buffer_batch,
 	addr_bo_buffer_batch[b++] = addr_output & 0xffffffff;
 	addr_bo_buffer_batch[b++] = addr_output >> 32;
 	addr_bo_buffer_batch[b++] = loop_count;
-	addr_bo_buffer_batch[b++] = 0x00000200;
-	addr_bo_buffer_batch[b++] = 0x00000001;
-	addr_bo_buffer_batch[b++] = 0x00000001;
+	addr_bo_buffer_batch[b++] = ENQUEUED_LOCAL_SIZE_X;
+	addr_bo_buffer_batch[b++] = ENQUEUED_LOCAL_SIZE_Y;
+	addr_bo_buffer_batch[b++] = ENQUEUED_LOCAL_SIZE_Z;
 	addr_bo_buffer_batch[b++] = 0x00000000;
 	addr_bo_buffer_batch[b++] = 0x00000000;
 	addr_bo_buffer_batch[b++] = 0x00000000;
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Zbigniew Kempczyński

Previously hardcoded constants are not correct for handling larger buffers in compute square tests in Xe3p. Replace these values to commonly used localgroup size definitions.

Quoted 42 lines
---
 lib/intel_compute.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
lib/intel_compute.c +5 -5
index 7dda423c80..680675982a 100644
@@ -2054,7 +2054,7 @@ static void xe3p_compute_exec_compute(int fd,
 	addr_bo_buffer_batch[b++] = 0x008004A0; /* dw3 */
 	addr_bo_buffer_batch[b++] = 0xBE040000; /* dw4 */
 	addr_bo_buffer_batch[b++] = 0xFFFFFFFF; /* dw5 */
-	addr_bo_buffer_batch[b++] = 0x000001FF; /* dw6 */
+	addr_bo_buffer_batch[b++] = 0x000003FF; /* dw6 */ // Local X/Y/Z Dimension
 
 	if (threadgroup_preemption)
 		addr_bo_buffer_batch[b++] = XE2_THREADGROUP_PREEMPT_XDIM; // Thread Group ID X Dimension
@@ -2081,7 +2081,7 @@ static void xe3p_compute_exec_compute(int fd,
 
 	addr_bo_buffer_batch[b++] = 0x00000000; /* dw22 */
 	addr_bo_buffer_batch[b++] = 0x00000000; /* dw23 */
-	addr_bo_buffer_batch[b++] = 0x0C000010; /* dw24 */
+	addr_bo_buffer_batch[b++] = 0x0C000000 | THREADS_PER_GROUP; /* dw24 */
 	addr_bo_buffer_batch[b++] = 0x00000000; /* dw25 */
 	addr_bo_buffer_batch[b++] = 0x00000400; /* dw26 */
 
@@ -2135,9 +2135,9 @@ static void xe3p_create_indirect_data(uint32_t *addr_bo_buffer_batch,
 	addr_bo_buffer_batch[b++] = addr_output & 0xffffffff;
 	addr_bo_buffer_batch[b++] = addr_output >> 32;
 	addr_bo_buffer_batch[b++] = loop_count;
-	addr_bo_buffer_batch[b++] = 0x00000200;
-	addr_bo_buffer_batch[b++] = 0x00000001;
-	addr_bo_buffer_batch[b++] = 0x00000001;
+	addr_bo_buffer_batch[b++] = ENQUEUED_LOCAL_SIZE_X;
+	addr_bo_buffer_batch[b++] = ENQUEUED_LOCAL_SIZE_Y;
+	addr_bo_buffer_batch[b++] = ENQUEUED_LOCAL_SIZE_Z;
 	addr_bo_buffer_batch[b++] = 0x00000000;
 	addr_bo_buffer_batch[b++] = 0x00000000;
 	addr_bo_buffer_batch[b++] = 0x00000000;
Signature · 1 line
2.43.0