Query agent family id from roct

Add agent info query HSA_AMD_AGENT_INFO_ASIC_FAMILY_ID.
Then we can remove the codes to parse family id.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Change-Id: I3ac4746d3015e89b32322ebc0f8a3084f98677a4


[ROCm/ROCR-Runtime commit: d0e7c617df]
This commit is contained in:
Lang Yu
2022-08-17 11:40:37 +08:00
parent 2ce78f0612
commit 6283510a9f
6 changed files with 16 additions and 148 deletions
@@ -367,6 +367,9 @@ hsa_status_t CpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const {
return core::Runtime::runtime_singleton_->GetSystemInfo(HSA_SYSTEM_INFO_TIMESTAMP_FREQUENCY,
value);
break;
case HSA_AMD_AGENT_INFO_ASIC_FAMILY_ID:
*((uint32_t*)value) = static_cast<uint32_t>(properties_.FamilyID);
break;
default:
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
break;
@@ -1102,6 +1102,9 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const {
case HSA_AMD_AGENT_INFO_TIMESTAMP_FREQUENCY:
*((uint64_t*)value) = wallclock_frequency_;
break;
case HSA_AMD_AGENT_INFO_ASIC_FAMILY_ID:
*((uint32_t*)value) = static_cast<uint32_t>(properties_.FamilyID);
break;
default:
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
break;