From 5257adde8767a01735c8e5b18efddeab511168ee Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Mon, 27 Nov 2023 16:07:20 +0000 Subject: [PATCH] Add query for memory properties Change-Id: I07c084c56b15c499ec564860b2a514e909ab7ca4 [ROCm/rocminfo commit: 7e159e6d763436a56d8144f9a1ce7041c1ae4bb1] --- projects/rocminfo/rocminfo.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/projects/rocminfo/rocminfo.cc b/projects/rocminfo/rocminfo.cc index 9e88cd32b4..f5cf867a11 100755 --- a/projects/rocminfo/rocminfo.cc +++ b/projects/rocminfo/rocminfo.cc @@ -142,6 +142,7 @@ struct agent_info_t { uint32_t pkt_processor_ucode_ver; uint32_t sdma_ucode_ver; hsa_amd_iommu_version_t iommu_support; + uint8_t memory_properties[8]; }; // This structure holds memory pool information acquired through hsa info @@ -491,6 +492,12 @@ AcquireAgentInfo(hsa_agent_t agent, agent_info_t *agent_i) { &agent_i->coherent_host_access); RET_IF_HSA_ERR(err); + // Get memory properties + err = hsa_agent_get_info(agent, + (hsa_agent_info_t) HSA_AMD_AGENT_INFO_MEMORY_PROPERTIES, + agent_i->memory_properties); + RET_IF_HSA_ERR(err); + // Check if the agent is kernel agent if (agent_i->agent_feature & HSA_AGENT_FEATURE_KERNEL_DISPATCH) { // Get flaf of fast_f16 operation @@ -642,6 +649,11 @@ static void DisplayAgentInfo(agent_info_t *agent_i) { if (agent_i->device_type == HSA_DEVICE_TYPE_GPU) printLabelStr("Coherent Host Access:", agent_i->coherent_host_access ? "TRUE":"FALSE", 1); + printLabel("Memory Properties:", false, 1); + if (hsa_flag_isset64(agent_i->memory_properties, HSA_AMD_MEMORY_PROPERTY_AGENT_IS_APU)) + printf("%s", "APU"); + printf("\n"); + printLabel("Features:", false, 1); if (agent_i->agent_feature & HSA_AGENT_FEATURE_KERNEL_DISPATCH) { printf("%s", "KERNEL_DISPATCH ");