From 3d75b10e0b038ec5c34e72604746cd5891e2470e Mon Sep 17 00:00:00 2001 From: Wenkai Du Date: Wed, 15 May 2019 21:50:35 +0000 Subject: [PATCH] Use NUMA distance for hop count calculation [ROCm/clr commit: 56d2dc0022b0a2677fc2955fdc3099952015d6d7] --- projects/clr/hipamd/src/hip_device.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/clr/hipamd/src/hip_device.cpp b/projects/clr/hipamd/src/hip_device.cpp index 6570b73316..746eaa2ddf 100644 --- a/projects/clr/hipamd/src/hip_device.cpp +++ b/projects/clr/hipamd/src/hip_device.cpp @@ -574,9 +574,10 @@ hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t* link HSA_ERROR_CHECK(err); *linktype = link_info.link_type; - err = hsa_amd_agent_memory_pool_get_info(device1Handle->_hsaAgent, pool, HSA_AMD_AGENT_MEMORY_POOL_INFO_NUM_LINK_HOPS, hopcount); - HSA_ERROR_CHECK(err); - + if (link_info.numa_distance < 30) + *hopcount = 1; + else + *hopcount = 2; return ihipLogStatus(hipSuccess); } }