gpu-compute: Simplify LGKM decrementing for Flat instructions
authorKyle Roarty <kyleroarty1716@gmail.com>
Tue, 19 Jan 2021 20:00:58 +0000 (14:00 -0600)
committerKyle Roarty <kyleroarty1716@gmail.com>
Thu, 21 Jan 2021 21:41:05 +0000 (21:41 +0000)
This commit makes it so LGKM count is decremented in a single place
(after completeAcc), which fixes a couple of potential bugs

1. Data is only written by completeAcc, not after initiateAcc. LGKM
count is supposed to be decremented after data is written.
2. LGKM count is now properly decremented for atomics without return

Change-Id: Ic791af3b42e04f7baaa0ce50cb2a2c6286c54f5a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39396
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/gpu-compute/global_memory_pipeline.cc

index 48f767b567a0fe4aebd19ce2551ec1b2b12c330f..2f251e864f2f1c352c27f7cd8f94c8375c121c8b 100644 (file)
@@ -130,7 +130,7 @@ GlobalMemPipeline::exec()
         DPRINTF(GPUMem, "CU%d: WF[%d][%d]: Completing global mem instr %s\n",
                 m->cu_id, m->simdId, m->wfSlotId, m->disassemble());
         m->completeAcc(m);
-        if (m->isFlat() && (m->isLoad() || m->isAtomicRet())) {
+        if (m->isFlat()) {
             w->decLGKMInstsIssued();
         }
         w->decVMemInstsIssued();
@@ -196,10 +196,6 @@ GlobalMemPipeline::exec()
                 mp->disassemble(), mp->seqNum());
         mp->initiateAcc(mp);
 
-        if (mp->isFlat() && mp->isStore()) {
-            mp->wavefront()->decLGKMInstsIssued();
-        }
-
         if (mp->isStore() && mp->isGlobalSeg()) {
             mp->wavefront()->decExpInstsIssued();
         }