diff --git a/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp b/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp index c876a85c5a..a271601365 100644 --- a/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp @@ -370,6 +370,12 @@ hsa_status_t CpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const { case HSA_AMD_AGENT_INFO_ASIC_FAMILY_ID: *((uint32_t*)value) = static_cast(properties_.FamilyID); break; + case HSA_AMD_AGENT_INFO_UCODE_VERSION: + *((uint32_t*)value) = 0; + break; + case HSA_AMD_AGENT_INFO_SDMA_UCODE_VERSION: + *((uint32_t*)value) = 0; + break; default: return HSA_STATUS_ERROR_INVALID_ARGUMENT; break; diff --git a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index 83d570d2ce..4ba4d5d804 100644 --- a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -1105,6 +1105,12 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const { case HSA_AMD_AGENT_INFO_ASIC_FAMILY_ID: *((uint32_t*)value) = static_cast(properties_.FamilyID); break; + case HSA_AMD_AGENT_INFO_UCODE_VERSION: + *((uint32_t*)value) = static_cast(properties_.EngineId.ui32.uCode); + break; + case HSA_AMD_AGENT_INFO_SDMA_UCODE_VERSION: + *((uint32_t*)value) = static_cast(properties_.uCodeEngineVersions.uCodeSDMA); + 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 926057924f..38fcb8aad0 100644 --- a/runtime/hsa-runtime/inc/hsa_ext_amd.h +++ b/runtime/hsa-runtime/inc/hsa_ext_amd.h @@ -335,7 +335,17 @@ typedef enum hsa_amd_agent_info_s { * Queries for the ASIC family ID of an agent. * The type of this attribute is uint32_t. */ - HSA_AMD_AGENT_INFO_ASIC_FAMILY_ID = 0xA107 + HSA_AMD_AGENT_INFO_ASIC_FAMILY_ID = 0xA107, + /** + * Queries for the Packet Processor(CP Firmware) ucode version of an agent. + * The type of this attribute is uint32_t. + */ + HSA_AMD_AGENT_INFO_UCODE_VERSION = 0xA108, + /** + * Queries for the SDMA engine ucode of an agent. + * The type of this attribute is uint32_t. + */ + HSA_AMD_AGENT_INFO_SDMA_UCODE_VERSION = 0xA109 } hsa_amd_agent_info_t;