gpu-compute: Fix LGKM decrementing for flat atomic insts
authorKyle Roarty <kyleroarty1716@gmail.com>
Fri, 15 Jan 2021 00:06:30 +0000 (18:06 -0600)
committerKyle Roarty <kyleroarty1716@gmail.com>
Fri, 15 Jan 2021 06:00:06 +0000 (06:00 +0000)
A prior commit (f6ec145fc0) fixed early LGKM decrementing for flat loads
and stores, but failed to address flat atomics.

Per the GCN3 ISA, LGKM count is decremented on flat atomics with return
when the data has been returned. This patch checks if the flat
instruction is an atomic with return, and decrements LGKM count if so.

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

index a2b24e4b478d0d37fbd3f1a77fbd6bd026e35fb2..f6d60cf0843b8355654e1ed4ba5465fec3481f54 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()) {
+        if (m->isFlat() && (m->isLoad() || m->isAtomicRet())) {
             w->decLGKMInstsIssued();
         }
         w->decVMemInstsIssued();