Loader support for SRAM ECC.
Change-Id: I0c6791c356d9186cc8dabae9fd698b1d4de19b09
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
namespace core {
|
||||
|
||||
@@ -74,6 +75,9 @@ std::string Isa::GetFullName() const {
|
||||
if (xnackEnabled_)
|
||||
full_name << "+xnack";
|
||||
|
||||
if (sramEcc_)
|
||||
full_name << "+sram-ecc";
|
||||
|
||||
return full_name.str();
|
||||
}
|
||||
|
||||
@@ -180,8 +184,8 @@ const Isa *IsaRegistry::GetIsa(const std::string &full_name) {
|
||||
return isareg_iter == supported_isas_.end() ? nullptr : &isareg_iter->second;
|
||||
}
|
||||
|
||||
const Isa *IsaRegistry::GetIsa(const Isa::Version &version, bool xnack) {
|
||||
auto isareg_iter = supported_isas_.find(Isa(version, xnack).GetFullName());
|
||||
const Isa *IsaRegistry::GetIsa(const Isa::Version &version, bool xnack, bool ecc) {
|
||||
auto isareg_iter = supported_isas_.find(Isa(version, xnack, ecc).GetFullName());
|
||||
return isareg_iter == supported_isas_.end() ? nullptr : &isareg_iter->second;
|
||||
}
|
||||
|
||||
@@ -189,27 +193,29 @@ const IsaRegistry::IsaMap IsaRegistry::supported_isas_ =
|
||||
IsaRegistry::GetSupportedIsas();
|
||||
|
||||
const IsaRegistry::IsaMap IsaRegistry::GetSupportedIsas() {
|
||||
#define ISAREG_ENTRY_GEN(maj, min, stp, xnack) \
|
||||
Isa amd_amdgpu_##maj##min##stp##xnack; \
|
||||
amd_amdgpu_##maj##min##stp##xnack.version_ = Isa::Version(maj, min, stp); \
|
||||
amd_amdgpu_##maj##min##stp##xnack.xnackEnabled_ = xnack; \
|
||||
supported_isas.insert(std::make_pair( \
|
||||
amd_amdgpu_##maj##min##stp##xnack.GetFullName(), \
|
||||
amd_amdgpu_##maj##min##stp##xnack)); \
|
||||
#define ISAREG_ENTRY_GEN(maj, min, stp, xnack, ecc) \
|
||||
Isa amd_amdgpu_##maj##min##stp##xnack##ecc; \
|
||||
amd_amdgpu_##maj##min##stp##xnack##ecc.version_ = Isa::Version(maj, min, stp); \
|
||||
amd_amdgpu_##maj##min##stp##xnack##ecc.xnackEnabled_ = xnack; \
|
||||
amd_amdgpu_##maj##min##stp##xnack##ecc.sramEcc_ = ecc; \
|
||||
supported_isas.insert(std::make_pair( \
|
||||
amd_amdgpu_##maj##min##stp##xnack##ecc.GetFullName(), \
|
||||
amd_amdgpu_##maj##min##stp##xnack##ecc)); \
|
||||
|
||||
IsaMap supported_isas;
|
||||
|
||||
ISAREG_ENTRY_GEN(7, 0, 0, false)
|
||||
ISAREG_ENTRY_GEN(7, 0, 1, false)
|
||||
ISAREG_ENTRY_GEN(7, 0, 2, false)
|
||||
ISAREG_ENTRY_GEN(8, 0, 1, true)
|
||||
ISAREG_ENTRY_GEN(8, 0, 2, false)
|
||||
ISAREG_ENTRY_GEN(8, 0, 3, false)
|
||||
ISAREG_ENTRY_GEN(8, 1, 0, true)
|
||||
ISAREG_ENTRY_GEN(9, 0, 0, false)
|
||||
ISAREG_ENTRY_GEN(9, 0, 2, true)
|
||||
ISAREG_ENTRY_GEN(9, 0, 4, false)
|
||||
ISAREG_ENTRY_GEN(9, 0, 6, false)
|
||||
ISAREG_ENTRY_GEN(7, 0, 0, false, false)
|
||||
ISAREG_ENTRY_GEN(7, 0, 1, false, false)
|
||||
ISAREG_ENTRY_GEN(7, 0, 2, false, false)
|
||||
ISAREG_ENTRY_GEN(8, 0, 1, true, false)
|
||||
ISAREG_ENTRY_GEN(8, 0, 2, false, false)
|
||||
ISAREG_ENTRY_GEN(8, 0, 3, false, false)
|
||||
ISAREG_ENTRY_GEN(8, 1, 0, true, false)
|
||||
ISAREG_ENTRY_GEN(9, 0, 0, false, false)
|
||||
ISAREG_ENTRY_GEN(9, 0, 2, true, false)
|
||||
ISAREG_ENTRY_GEN(9, 0, 4, false, false)
|
||||
ISAREG_ENTRY_GEN(9, 0, 6, false, false)
|
||||
ISAREG_ENTRY_GEN(9, 0, 6, false, true )
|
||||
|
||||
return supported_isas;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user