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
@@ -79,150 +79,5 @@ hsa_status_t GetGPUAsicID(hsa_agent_t agent, uint32_t *chip_id) {
return HSA_STATUS_SUCCESS;
}
uint32_t DevIDToAddrLibFamily(uint32_t dev_id) {
uint32_t major_ver = MajorVerFromDevID(dev_id);
uint32_t minor_ver = MinorVerFromDevID(dev_id);
uint32_t step = StepFromDevID(dev_id);
// FAMILY_UNKNOWN 0xFF
// FAMILY_SI - Southern Islands: Tahiti (P), Pitcairn (PM), Cape Verde (M), Bali (V)
// FAMILY_TN - Fusion Trinity: Devastator - DVST (M), Scrapper (V)
// FAMILY_CI - Sea Islands: Hawaii (P), Maui (P), Bonaire (M)
// FAMILY_KV - Fusion Kaveri: Spectre, Spooky; Fusion Kabini: Kalindi
// FAMILY_VI - Volcanic Islands: Iceland (V), Tonga (M)
// FAMILY_CZ - Carrizo, Nolan, Amur
// FAMILY_PI - Pirate Islands
// FAMILY_AI - Arctic Islands
// FAMILY_RV - Raven
// FAMILY_NV - Navi
switch (major_ver) {
case 6:
switch (minor_ver) {
case 0:
switch (step) {
case 0:
case 1:
return FAMILY_SI;
default:
return FAMILY_UNKNOWN;
}
default:
return FAMILY_UNKNOWN;
}
case 7:
switch (minor_ver) {
case 0:
switch (step) {
case 0:
case 1:
case 2:
return FAMILY_CI;
case 3:
return FAMILY_KV;
default:
return FAMILY_UNKNOWN;
}
default:
return FAMILY_UNKNOWN;
}
case 8:
switch (minor_ver) {
case 0:
switch (step) {
case 0:
case 2:
case 3:
case 4:
return FAMILY_VI;
case 1:
return FAMILY_CZ;
default:
return FAMILY_UNKNOWN;
}
default:
return FAMILY_UNKNOWN;
}
case 9:
switch (minor_ver) {
case 0:
switch (step) {
case 0:
case 1:
case 4: // Vega12
case 6: // Vega20
case 8: // Arcturus
case 10: // Aldebaran
return FAMILY_AI;
case 2:
case 3:
case 12:
return FAMILY_RV;
default:
return FAMILY_UNKNOWN;
}
default:
return FAMILY_UNKNOWN;
}
case 10:
switch (minor_ver) {
case 0:
case 1: // Navi
case 3:
switch (step) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
return FAMILY_NV;
default:
return FAMILY_UNKNOWN;
}
default:
return FAMILY_UNKNOWN;
}
case 11:
switch (minor_ver) {
case 0:
switch (step) {
case 0:
case 1:
case 2:
return FAMILY_GFX1100;
case 3:
return FAMILY_GFX1103;
default:
return FAMILY_UNKNOWN;
}
default:
return FAMILY_UNKNOWN;
}
default:
return FAMILY_UNKNOWN;
}
assert(0); // We should have already returned
}
} // namespace image
} // namespace rocr