Matthew Poremba has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/57651 )

 (

12 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
 )Change subject: gpu-compute: Add methods to read GPU memory requestor ID
......................................................................

gpu-compute: Add methods to read GPU memory requestor ID

These methods are called from various places to override the requestor
ID of a request in order to determine which Ruby network a request
should be routed on.

Change-Id: Ic0270ddd7123f0457a13144e69ef9132204d4334
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57651
Reviewed-by: Matt Sinclair <mattdsincl...@gmail.com>
Maintainer: Matt Sinclair <mattdsincl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/gpu-compute/compute_unit.cc
M src/gpu-compute/compute_unit.hh
M src/gpu-compute/gpu_command_processor.cc
M src/gpu-compute/gpu_command_processor.hh
M src/gpu-compute/shader.cc
M src/gpu-compute/shader.hh
6 files changed, 48 insertions(+), 0 deletions(-)

Approvals:
  Matt Sinclair: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/gpu-compute/compute_unit.cc b/src/gpu-compute/compute_unit.cc
index f3db81c..cc6244b 100644
--- a/src/gpu-compute/compute_unit.cc
+++ b/src/gpu-compute/compute_unit.cc
@@ -2010,6 +2010,15 @@
 }

 /**
+ * Forward the VRAM requestor ID needed for device memory from shader.
+ */
+RequestorID
+ComputeUnit::vramRequestorId()
+{
+    return FullSystem ? shader->vramRequestorId() : requestorId();
+}
+
+/**
  * get the result of packets sent to the LDS when they return
  */
 bool
diff --git a/src/gpu-compute/compute_unit.hh b/src/gpu-compute/compute_unit.hh
index 10fd2f9..87ed541 100644
--- a/src/gpu-compute/compute_unit.hh
+++ b/src/gpu-compute/compute_unit.hh
@@ -458,6 +458,7 @@
     void updatePageDivergenceDist(Addr addr);

     RequestorID requestorId() { return _requestorId; }
+    RequestorID vramRequestorId();

     bool isDone() const;
     bool isVectorAluIdle(uint32_t simdId) const;
diff --git a/src/gpu-compute/gpu_command_processor.cc b/src/gpu-compute/gpu_command_processor.cc
index 9499d47..0f74cb1 100644
--- a/src/gpu-compute/gpu_command_processor.cc
+++ b/src/gpu-compute/gpu_command_processor.cc
@@ -65,6 +65,15 @@
     return *hsaPP;
 }

+/**
+ * Forward the VRAM requestor ID needed for device memory from GPU device.
+ */
+RequestorID
+GPUCommandProcessor::vramRequestorId()
+{
+    return gpuDevice->vramRequestorId();
+}
+
 TranslationGenPtr
 GPUCommandProcessor::translate(Addr vaddr, Addr size)
 {
diff --git a/src/gpu-compute/gpu_command_processor.hh b/src/gpu-compute/gpu_command_processor.hh
index 1bc19c7..ec163ed 100644
--- a/src/gpu-compute/gpu_command_processor.hh
+++ b/src/gpu-compute/gpu_command_processor.hh
@@ -76,6 +76,7 @@
     GPUCommandProcessor(const Params &p);

     HSAPacketProcessor& hsaPacketProc();
+    RequestorID vramRequestorId();

     void setGPUDevice(AMDGPUDevice *gpu_device);
     void setShader(Shader *shader);
diff --git a/src/gpu-compute/shader.cc b/src/gpu-compute/shader.cc
index a4e72b3..ebacbb5 100644
--- a/src/gpu-compute/shader.cc
+++ b/src/gpu-compute/shader.cc
@@ -523,6 +523,15 @@
         stats.shaderActiveTicks += curTick() - _lastInactiveTick;
 }

+/**
+ * Forward the VRAM requestor ID needed for device memory from CP.
+ */
+RequestorID
+Shader::vramRequestorId()
+{
+    return gpuCmdProc.vramRequestorId();
+}
+
 Shader::ShaderStats::ShaderStats(statistics::Group *parent, int wf_size)
     : statistics::Group(parent),
       ADD_STAT(allLatencyDist, "delay distribution for all"),
diff --git a/src/gpu-compute/shader.hh b/src/gpu-compute/shader.hh
index 0ea8741..96ad15d 100644
--- a/src/gpu-compute/shader.hh
+++ b/src/gpu-compute/shader.hh
@@ -183,6 +183,8 @@
         shHiddenPrivateBaseVmid = sh_hidden_base_new;
     }

+    RequestorID vramRequestorId();
+
     EventFunctionWrapper tickEvent;

     // is this simulation going to be timing mode in the memory?

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/57651
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: Ic0270ddd7123f0457a13144e69ef9132204d4334
Gerrit-Change-Number: 57651
Gerrit-PatchSet: 18
Gerrit-Owner: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: Matt Sinclair <mattdsincl...@gmail.com>
Gerrit-Reviewer: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to