diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp index c84e272a82..ce491db321 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_cpu_agent.cpp @@ -191,10 +191,14 @@ hsa_status_t CpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const { const size_t attribute_u = static_cast(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(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 diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index becd2e942a..c6a03e5eab 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -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(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: