SWDEV-408180 - Address possible cornercases

- Address corner cases that can arise with the new
hipMemcpyDeviceToDeviceNoCU enum
- Better log

Change-Id: I6035b901f8d616741054b7a5ff4f67956329ac57
This commit is contained in:
Saleel Kudchadker
2023-10-20 18:00:02 +00:00
parent de2b06a7a7
commit 5662d4037c
6 changed files with 34 additions and 10 deletions
+3 -2
View File
@@ -1329,7 +1329,7 @@ bool Device::populateOCLDeviceConstants() {
}
}
}
gpuvm_segment_max_alloc_ =
uint64_t(info_.globalMemSize_ * std::min(GPU_SINGLE_ALLOC_PERCENT, 100u) / 100u);
assert(gpuvm_segment_max_alloc_ > 0);
@@ -2128,7 +2128,8 @@ void* Device::hostAlloc(size_t size, size_t alignment, MemorySegment mem_seg) co
assert(segment.handle != 0);
hsa_status_t stat = hsa_amd_memory_pool_allocate(segment, size, 0, &ptr);
ClPrint(amd::LOG_DEBUG, amd::LOG_MEM, "Allocate hsa host memory %p, size 0x%zx", ptr, size);
ClPrint(amd::LOG_DEBUG, amd::LOG_MEM, "Allocate hsa host memory %p, size 0x%zx,"
" numa_node = %d", ptr, size, preferred_numa_node_);
if (stat != HSA_STATUS_SUCCESS) {
LogPrintfError("Fail allocation host memory with err %d", stat);
return nullptr;