From ebd5b3e4ae49b24dec4efc299d0b0198be9f4df3 Mon Sep 17 00:00:00 2001 From: Matthew Poremba Date: Tue, 30 May 2023 13:57:09 -0500 Subject: [PATCH] gpu-compute: Gfx version check for FS and SE mode There is no GPU device in SE mode to get version from and no GPU driver in FS mode to get version from, so a conditional needs to be added depending on the mode to get the gfx version. Change-Id: I33fdafb60d351ebc5148e2248244537fb5bebd31 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71078 Tested-by: kokoro Maintainer: Matt Sinclair Reviewed-by: Matt Sinclair --- src/gpu-compute/gpu_command_processor.cc | 4 +++- src/gpu-compute/gpu_compute_driver.hh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gpu-compute/gpu_command_processor.cc b/src/gpu-compute/gpu_command_processor.cc index 9755180204..8f748bdc31 100644 --- a/src/gpu-compute/gpu_command_processor.cc +++ b/src/gpu-compute/gpu_command_processor.cc @@ -227,9 +227,11 @@ GPUCommandProcessor::submitDispatchPkt(void *raw_pkt, uint32_t queue_id, DPRINTF(GPUKernelInfo, "Kernel name: %s\n", kernel_name.c_str()); + GfxVersion gfxVersion = FullSystem ? gpuDevice->getGfxVersion() + : driver()->getGfxVersion(); HSAQueueEntry *task = new HSAQueueEntry(kernel_name, queue_id, dynamic_task_id, raw_pkt, &akc, host_pkt_addr, machine_code_addr, - gpuDevice->getGfxVersion()); + gfxVersion); DPRINTF(GPUCommandProc, "Task ID: %i Got AQL: wg size (%dx%dx%d), " "grid size (%dx%dx%d) kernarg addr: %#x, completion " diff --git a/src/gpu-compute/gpu_compute_driver.hh b/src/gpu-compute/gpu_compute_driver.hh index def40f4557..9a3c6479c3 100644 --- a/src/gpu-compute/gpu_compute_driver.hh +++ b/src/gpu-compute/gpu_compute_driver.hh @@ -142,6 +142,8 @@ class GPUComputeDriver final : public EmulatedDriver }; typedef class EventTableEntry ETEntry; + GfxVersion getGfxVersion() const { return gfxVersion; } + private: /** * GPU that is controlled by this driver.