From fabfc42b68b9b9471e64dd4201d09d7b7975bcb5 Mon Sep 17 00:00:00 2001 From: Tao Sang Date: Tue, 2 Jun 2020 11:52:04 -0400 Subject: [PATCH] Fix TC linux build issue due to previous Numa patch Change-Id: I6068edaf38cac6fad187c8429707afdb727e8d41 --- rocclr/device/rocm/rocdevice.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rocclr/device/rocm/rocdevice.cpp b/rocclr/device/rocm/rocdevice.cpp index 46ac62a776..1892dba016 100644 --- a/rocclr/device/rocm/rocdevice.cpp +++ b/rocclr/device/rocm/rocdevice.cpp @@ -181,9 +181,9 @@ Device::Device(hsa_agent_t bkendDevice) void Device::setupCpuAgent() { uint32_t numaDistance = std::numeric_limits::max(); - int index = 0; // 0 as default + uint32_t index = 0; // 0 as default auto size = cpu_agents_.size(); - for (int i = 0; i < size; i++) { + for (uint32_t i = 0; i < size; i++) { uint32_t hops = 0; uint32_t link_type = 0; uint32_t distance = 0; @@ -198,7 +198,7 @@ void Device::setupCpuAgent() { cpu_agent_ = cpu_agents_[index].agent; system_segment_ = cpu_agents_[index].fine_grain_pool; system_coarse_segment_ = cpu_agents_[index].coarse_grain_pool; - LogPrintfInfo("Numa select cpu agent[%d]=0x%llx(fine=0x%llx,coarse=0x%llx) for gpu agent=0x%llx", + LogPrintfInfo("Numa select cpu agent[%u]=0x%llx(fine=0x%llx,coarse=0x%llx) for gpu agent=0x%llx", index, cpu_agent_.handle, system_segment_.handle, system_coarse_segment_.handle, _bkendDevice.handle); } @@ -2076,7 +2076,7 @@ void* Device::getOrCreateHostcallBuffer(hsa_queue_t* queue) { bool Device::findLinkTypeAndHopCount(amd::Device* other_device, uint32_t* link_type, uint32_t* hop_count) { uint32_t distance = 0; - return getNumaInfo((dynamic_cast(other_device))->gpuvm_segment_, + return getNumaInfo((static_cast(other_device))->gpuvm_segment_, hop_count, link_type, &distance); } @@ -2117,7 +2117,7 @@ bool Device::getNumaInfo(const hsa_amd_memory_pool_t& pool, uint32_t* hop_count, *link_type = link_info[0].link_type; uint32_t distance = 0; - for (int i = 0; i < hops; i++) { + for (uint32_t i = 0; i < hops; i++) { distance += link_info[i].numa_distance; } *numa_distance = distance;