From 69f90c8f055f53cae824920f98d210a9f39da14e Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Mon, 14 Aug 2023 13:15:16 +0000 Subject: [PATCH] Adding coherent host access query Change-Id: I34030ab193b5e7890cf10c6a0c6ad493ac0e0283 [ROCm/rocminfo commit: 23c483ca6580b1ec57b9050d273e5c76f4a749f2] --- projects/rocminfo/rocminfo.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/projects/rocminfo/rocminfo.cc b/projects/rocminfo/rocminfo.cc index cdf8fd02ef..1d6cfbfcfb 100755 --- a/projects/rocminfo/rocminfo.cc +++ b/projects/rocminfo/rocminfo.cc @@ -137,6 +137,7 @@ struct agent_info_t { uint16_t workgroup_max_dim[3]; uint16_t bdf_id; bool fast_f16; + bool coherent_host_access; uint32_t pkt_processor_ucode_ver; uint32_t sdma_ucode_ver; hsa_amd_iommu_version_t iommu_support; @@ -471,6 +472,12 @@ AcquireAgentInfo(hsa_agent_t agent, agent_info_t *agent_i) { &agent_i->compute_unit); RET_IF_HSA_ERR(err); + // Get coherent Host access + err = hsa_agent_get_info(agent, + (hsa_agent_info_t) HSA_AMD_AGENT_INFO_SVM_DIRECT_HOST_ACCESS, + &agent_i->coherent_host_access); + 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 @@ -619,6 +626,9 @@ static void DisplayAgentInfo(agent_info_t *agent_i) { printLabelInt("Shader Arrs. per Eng.:", agent_i->shader_arrs_per_sh_eng, 1); printLabelInt("WatchPts on Addr. Ranges:", agent_i->max_addr_watch_pts, 1); + if (agent_i->device_type == HSA_DEVICE_TYPE_GPU) + printLabelStr("Coherent Host Access:", agent_i->coherent_host_access ? "TRUE":"FALSE", 1); + printLabel("Features:", false, 1); if (agent_i->agent_feature & HSA_AGENT_FEATURE_KERNEL_DISPATCH) { printf("%s", "KERNEL_DISPATCH ");