Read name of Hsa Agent from a new field of Node Properties

Change-Id: I3abca521a904c40cb84d90800a16363b1ad64768
Tento commit je obsažen v:
Ramesh Errabolu
2016-08-30 18:25:15 -05:00
rodič 1bc15bbf79
revize 5ab5396529
2 změnil soubory, kde provedl 11 přidání a 8 odebrání
+7 -3
Zobrazit soubor
@@ -191,10 +191,14 @@ hsa_status_t CpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const {
const size_t attribute_u = static_cast<size_t>(attribute);
switch (attribute_u) {
case HSA_AGENT_INFO_NAME:
// TODO: hardcode for now, wait until SWDEV-88894 implemented
case HSA_AGENT_INFO_NAME: {
// The code copies from HsaNodeProperties.AMDName is encoded in
// 7-bit ASCII as the runtime output is 7-bit ASCII in bytes.
std::memset(value, 0, kNameSize);
std::memcpy(value, "CPU Device", sizeof("CPU Device"));
char* temp = reinterpret_cast<char*>(value);
for (uint32_t i = 0; properties_.AMDName[i] != 0 && i < kNameSize - 1; i++)
temp[i] = properties_.AMDName[i];
}
break;
case HSA_AGENT_INFO_VENDOR_NAME:
// TODO: hardcode for now, wait until SWDEV-88894 implemented
+4 -5
Zobrazit soubor
@@ -657,13 +657,12 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const {
switch (attribute_u) {
case HSA_AGENT_INFO_NAME:
{
// This code assumes that UTF-16 HsaNodeProperties.MarketingName is
// actually encoded in 7-bit ASCII, and the runtime output is 7-bit ASCII
// in bytes.
// The code copies from HsaNodeProperties.AMDName is encoded in
// 7-bit ASCII as the runtime output is 7-bit ASCII in bytes.
std::memset(value, 0, kNameSize);
char* temp = reinterpret_cast<char*>(value);
for (uint32_t i = 0; properties_.MarketingName[i] != 0 && i < kNameSize - 1; i++)
temp[i] = properties_.MarketingName[i];
for (uint32_t i = 0; properties_.AMDName[i] != 0 && i < kNameSize - 1; i++)
temp[i] = properties_.AMDName[i];
break;
}
case HSA_AGENT_INFO_VENDOR_NAME: