From 101755c207c4e404d80a95b33c9f60c2934725ac Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 11 Apr 2023 21:23:56 +0000 Subject: [PATCH] Add query for number of XCCs per agent Change-Id: I4b694b4904ba0326c998356388a62c19a972a7ff [ROCm/ROCR-Runtime commit: f024d21e3dc306d64bce638b5cdd951f91443ef1] --- .../runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp | 3 +++ .../runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 3 +++ .../rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h | 7 ++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp index 8b35d99557..c890098ca4 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp @@ -385,6 +385,9 @@ hsa_status_t CpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const { case HSA_AMD_AGENT_INFO_IOMMU_SUPPORT: *((hsa_amd_iommu_version_t*)value) = HSA_IOMMU_SUPPORT_NONE; break; + case HSA_AMD_AGENT_INFO_NUM_XCC: + *((uint32_t*)value) = 0; + break; default: return HSA_STATUS_ERROR_INVALID_ARGUMENT; break; 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 dc8f63263b..00547d16d8 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 @@ -1242,6 +1242,9 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const { else *((hsa_amd_iommu_version_t*)value) = HSA_IOMMU_SUPPORT_NONE; break; + case HSA_AMD_AGENT_INFO_NUM_XCC: + *((uint32_t*)value) = static_cast(properties_.NumXcc); + 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 508a45cf3b..c4eedf4904 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 @@ -387,7 +387,12 @@ typedef enum hsa_amd_agent_info_s { * Queries for version of IOMMU supported by agent. * The type of this attribute is hsa_amd_iommu_version_t. */ - HSA_AMD_AGENT_INFO_IOMMU_SUPPORT = 0xA110 + HSA_AMD_AGENT_INFO_IOMMU_SUPPORT = 0xA110, + /** + * Queries for number of XCCs within the agent. + * The type of this attribute is uint32_t. + */ + HSA_AMD_AGENT_INFO_NUM_XCC = 0xA111 } hsa_amd_agent_info_t; /**