Hello Michael LeBeane, Tony Gutierrez,

I'd like you to do a code review. Please visit

    https://gem5-review.googlesource.com/c/public/gem5/+/29965

to review the following change.


Change subject: gpu-compute: Fix Y-dimension ABI decode
......................................................................

gpu-compute: Fix Y-dimension ABI decode

We currently have a bug in decoding workitem ID from the kernel
descriptor with multiple dimensions.  The enable_vgpr_workitem_id bits
are currently seperated into x and y components, when they should be
treated as a single 2 bit value, where y is enabled when it is > 0,
and z is enabled when it is > 1.  The current setup allows a kernel
launch with vgprs reserved for the z dimension and not the y dimension,
which is incorrect.

Change-Id: Iee64b207feb95bcf064898d5db33b8f201e25323
---
M src/gpu-compute/hsa_queue_entry.hh
M src/gpu-compute/kernel_code.hh
2 files changed, 3 insertions(+), 4 deletions(-)



diff --git a/src/gpu-compute/hsa_queue_entry.hh b/src/gpu-compute/hsa_queue_entry.hh
index 5fc5e56..ea79869 100644
--- a/src/gpu-compute/hsa_queue_entry.hh
+++ b/src/gpu-compute/hsa_queue_entry.hh
@@ -417,8 +417,8 @@
          * workitem Id in the X dimension is always initialized.
          */
         initialVgprState.set(WorkitemIdX, true);
-        initialVgprState.set(WorkitemIdY, akc->enable_vgpr_workitem_id_y);
-        initialVgprState.set(WorkitemIdZ, akc->enable_vgpr_workitem_id_z);
+ initialVgprState.set(WorkitemIdY, akc->enable_vgpr_workitem_id > 0); + initialVgprState.set(WorkitemIdZ, akc->enable_vgpr_workitem_id > 1);
     }

     // name of the kernel associated with the AQL entry
diff --git a/src/gpu-compute/kernel_code.hh b/src/gpu-compute/kernel_code.hh
index b3560c7..680dd72 100644
--- a/src/gpu-compute/kernel_code.hh
+++ b/src/gpu-compute/kernel_code.hh
@@ -130,8 +130,7 @@
     uint32_t enable_sgpr_workgroup_id_y : 1;
     uint32_t enable_sgpr_workgroup_id_z : 1;
     uint32_t enable_sgpr_workgroup_info : 1;
-    uint32_t enable_vgpr_workitem_id_y : 1;
-    uint32_t enable_vgpr_workitem_id_z : 1;
+    uint32_t enable_vgpr_workitem_id : 2;
     uint32_t enable_exception_address_watch : 1;
     uint32_t enable_exception_memory_violation : 1;
     uint32_t granulated_lds_size : 9;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/29965
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Iee64b207feb95bcf064898d5db33b8f201e25323
Gerrit-Change-Number: 29965
Gerrit-PatchSet: 1
Gerrit-Owner: Anthony Gutierrez <[email protected]>
Gerrit-Reviewer: Michael LeBeane <[email protected]>
Gerrit-Reviewer: Tony Gutierrez <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to