diff --git a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index eb1e010cb3..46b00d284f 100644 --- a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -984,6 +984,12 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const { case HSA_AMD_AGENT_INFO_ASIC_REVISION: *((uint32_t*)value) = static_cast(properties_.Capability.ui32.ASICRevision); break; + case HSA_AMD_AGENT_INFO_VGPR_SIZE: + *((uint32_t*)value) = properties_.VGPRSizePerCU; + break; + case HSA_AMD_AGENT_INFO_SGPR_SIZE: + *((uint32_t*)value) = properties_.SGPRSizePerCU; + break; default: return HSA_STATUS_ERROR_INVALID_ARGUMENT; break; diff --git a/runtime/hsa-runtime/inc/hsa_ext_amd.h b/runtime/hsa-runtime/inc/hsa_ext_amd.h index a0bc5d1d99..905a003f96 100644 --- a/runtime/hsa-runtime/inc/hsa_ext_amd.h +++ b/runtime/hsa-runtime/inc/hsa_ext_amd.h @@ -291,7 +291,17 @@ typedef enum hsa_amd_agent_info_s { * selective workarounds for hardware errata. * The type of this attribute is uint32_t. */ - HSA_AMD_AGENT_INFO_ASIC_REVISION = 0xA012 + HSA_AMD_AGENT_INFO_ASIC_REVISION = 0xA012, + /** + * Size of VGPR register file in kilobytes per CU. + * The type of this attribute is uint32_t. + */ + HSA_AMD_AGENT_INFO_VGPR_SIZE = 0xA013, + /** + * Size of SGPR register file in kilobytes per CU. + * The type of this attribute is uint32_t. + */ + HSA_AMD_AGENT_INFO_SGPR_SIZE = 0xA014 } hsa_amd_agent_info_t; typedef struct hsa_amd_hdp_flush_s {