Correct code object V2 support

- Remove gfx800, gfx804 and gfx901 as they do not exist.
- Map the V2 note record of "AMD:AMDGPU:8:0:0" to gfx802 as they are
  the same target just connected to a differnt motherboard.
- Correct typo for supporting gfx902:xnack+.
- Support agent names with a minor or stepping version greater than 9.

Change-Id: Ife933449f60ab4687e2aaab9baf4c9fc5b86339d
Tento commit je obsažen v:
Tony
2020-12-05 17:11:01 +00:00
odevzdal Tony Tye
rodič 7e2ba23566
revize 12eb2764cd
6 změnil soubory, kde provedl 75 přidání a 102 odebrání
+2 -1
Zobrazit soubor
@@ -734,7 +734,8 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const {
std::stringstream name;
std::memset(value, 0, HSA_PUBLIC_NAME_SIZE);
char* temp = reinterpret_cast<char*>(value);
name << "gfx" << isa_->GetMajorVersion() << isa_->GetMinorVersion() << isa_->GetStepping();
name << "gfx" << isa_->GetMajorVersion() << std::hex << isa_->GetMinorVersion()
<< isa_->GetStepping();
std::strcpy(temp, name.str().c_str());
break;
}
+6 -26
Zobrazit soubor
@@ -1865,53 +1865,33 @@ static std::string ConvertOldTargetNameToNew(
NewName = "amdgcn-amd-amdhsa--gfx704";
else if (OldName == "AMD:AMDGPU:7:0:5")
NewName = "amdgcn-amd-amdhsa--gfx705";
else if (OldName == "AMD:AMDGPU:8:0:0")
NewName = "amdgcn-amd-amdhsa--gfx800";
else if (OldName == "AMD:AMDGPU:8:0:1") {
NewName = "amdgcn-amd-amdhsa--gfx801";
xnack_supported = true;
}
else if (OldName == "AMD:AMDGPU:8:0:2")
else if (OldName == "AMD:AMDGPU:8:0:0" || OldName == "AMD:AMDGPU:8:0:2")
NewName = "amdgcn-amd-amdhsa--gfx802";
else if (OldName == "AMD:AMDGPU:8:0:3")
else if (OldName == "AMD:AMDGPU:8:0:3" || OldName == "AMD:AMDGPU:8:0:4")
NewName = "amdgcn-amd-amdhsa--gfx803";
else if (OldName == "AMD:AMDGPU:8:0:4")
NewName = "amdgcn-amd-amdhsa--gfx804";
else if (OldName == "AMD:AMDGPU:8:0:5")
NewName = "amdgcn-amd-amdhsa--gfx805";
else if (OldName == "AMD:AMDGPU:8:1:0") {
NewName = "amdgcn-amd-amdhsa--gfx810";
xnack_supported = true;
}
else if (OldName == "AMD:AMDGPU:9:0:0") {
else if (OldName == "AMD:AMDGPU:9:0:0" || OldName == "AMD:AMDGPU:9:0:1") {
NewName = "amdgcn-amd-amdhsa--gfx900";
xnack_supported = true;
}
else if (OldName == "AMD:AMDGPU:9:0:1") {
NewName = "amdgcn-amd-amdhsa--gfx900";
xnack_supported = true;
}
else if (OldName == "AMD:AMDGPU:9:0:2") {
else if (OldName == "AMD:AMDGPU:9:0:2" || OldName == "AMD:AMDGPU:9:0:3") {
NewName = "amdgcn-amd-amdhsa--gfx902";
xnack_supported = true;
}
else if (OldName == "AMD:AMDGPU:9:0:3") {
NewName = "amdgcn-amd-amdhsa--gfx902";
xnack_supported = true;
}
else if (OldName == "AMD:AMDGPU:9:0:4") {
else if (OldName == "AMD:AMDGPU:9:0:4" || OldName == "AMD:AMDGPU:9:0:5") {
NewName = "amdgcn-amd-amdhsa--gfx904";
xnack_supported = true;
}
else if (OldName == "AMD:AMDGPU:9:0:5") {
NewName = "amdgcn-amd-amdhsa--gfx904";
xnack_supported = true;
}
else if (OldName == "AMD:AMDGPU:9:0:6") {
NewName = "amdgcn-amd-amdhsa--gfx906";
xnack_supported = true;
}
else if (OldName == "AMD:AMDGPU:9:0:7") {
else if (OldName == "AMD:AMDGPU:9:0:6" || OldName == "AMD:AMDGPU:9:0:7") {
NewName = "amdgcn-amd-amdhsa--gfx906";
xnack_supported = true;
}
+13 -11
Zobrazit soubor
@@ -2,24 +2,24 @@
//
// The University of Illinois/NCSA
// Open Source License (NCSA)
//
//
// Copyright (c) 2014-2020, Advanced Micro Devices, Inc. All rights reserved.
//
//
// Developed by:
//
//
// AMD Research and AMD HSA Software Development
//
//
// Advanced Micro Devices, Inc.
//
//
// www.amd.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal with the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
//
// - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimers.
// - Redistributions in binary form must reproduce the above copyright
@@ -29,7 +29,7 @@
// nor the names of its contributors may be used to endorse or promote
// products derived from this Software without specific prior written
// permission.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@@ -90,9 +90,11 @@ bool Isa::IsCompatible(const Isa &code_object_isa,
std::string Isa::GetFullName() const {
std::stringstream full_name;
auto fmt = full_name.flags();
full_name << GetArchitecture() << "-" << GetVendor() << "-" << GetOS() << "-"
<< GetEnvironment() << "-gfx" << GetMajorVersion()
<< GetMinorVersion() << GetStepping();
<< std::hex << GetMinorVersion() << GetStepping();
full_name.flags(fmt);
switch (sramecc_) {
case IsaFeature::Disabled:
@@ -231,7 +233,7 @@ const IsaRegistry::IsaMap IsaRegistry::supported_isas_ =
IsaRegistry::GetSupportedIsas();
const IsaRegistry::IsaMap IsaRegistry::GetSupportedIsas() {
#define ISAREG_ENTRY_GEN(name, maj, min, stp, sramecc, xnack) \
#define ISAREG_ENTRY_GEN(name, maj, min, stp, sramecc, xnack) \
Isa amd_amdgpu_##maj##min##stp##_SRAMECC_##sramecc##_XNACK_##xnack; \
amd_amdgpu_##maj##min##stp##_SRAMECC_##sramecc##_XNACK_##xnack.version_ = Isa::Version(maj, min, stp); \
amd_amdgpu_##maj##min##stp##_SRAMECC_##sramecc##_XNACK_##xnack.sramecc_ = sramecc; \
@@ -264,7 +266,7 @@ const IsaRegistry::IsaMap IsaRegistry::GetSupportedIsas() {
ISAREG_ENTRY_GEN("gfx900:xnack+", 9, 0, 0, unsupported, enabled)
ISAREG_ENTRY_GEN("gfx902", 9, 0, 2, unsupported, any)
ISAREG_ENTRY_GEN("gfx902:xnack-", 9, 0, 2, unsupported, disabled)
ISAREG_ENTRY_GEN("gfx900:xnack+", 9, 0, 2, unsupported, enabled)
ISAREG_ENTRY_GEN("gfx902:xnack+", 9, 0, 2, unsupported, enabled)
ISAREG_ENTRY_GEN("gfx904", 9, 0, 4, unsupported, any)
ISAREG_ENTRY_GEN("gfx904:xnack-", 9, 0, 4, unsupported, disabled)
ISAREG_ENTRY_GEN("gfx904:xnack+", 9, 0, 4, unsupported, enabled)