From 919642f72199dc7465c4be6515bd86700f0a9512 Mon Sep 17 00:00:00 2001 From: German Andryeyev <56892148+gandryey@users.noreply.github.com> Date: Wed, 19 Nov 2025 18:26:23 -0500 Subject: [PATCH] rocr: Expose PM4 emulation in the agent info (#1869) Native AQL path in Windows requires extra logic, which has a conflict with the implementation of Pm4 emulation and needs a detection in the client. --- .../runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 3 +++ projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index 08842cb75e..88e8065a44 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -1710,6 +1710,9 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const { } return HSA_STATUS_ERROR; } + case HSA_AMD_AGENT_INFO_PM4_EMULATION: + *((bool*)value) = properties_.Capability2.ui32.AqlEmulationPm4_; + break; default: return HSA_STATUS_ERROR_INVALID_ARGUMENT; break; diff --git a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h index 18c9d4e45f..b1c5e8e67b 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h @@ -705,7 +705,11 @@ typedef enum hsa_amd_agent_info_s { * Queries the driver for clock counters of the agent. * The type of this attribute is hsa_amd_clock_counters_t. */ - HSA_AMD_AGENT_INFO_CLOCK_COUNTERS = 0xA118 + HSA_AMD_AGENT_INFO_CLOCK_COUNTERS = 0xA118, + /** + * The agent uses PM4 emulation mode. + */ + HSA_AMD_AGENT_INFO_PM4_EMULATION = 0xA119 } hsa_amd_agent_info_t; /**