SWDEV-436236 - Fixed integer division to float result in Heap::FindMemory

Change-Id: Ic72cfdbe1f62fabd3e25d33bfa540d82a02480d0


[ROCm/clr commit: 2ede1c9adb]
This commit is contained in:
Ioannis Assiouras
2023-12-06 14:17:57 +00:00
parent 5a141cbda4
commit 1868de1f7d
+1 -1
View File
@@ -50,7 +50,7 @@ amd::Memory* Heap::FindMemory(size_t size, hip::Stream* stream, bool opportunist
}
// Check if size can match and it's safe to use this resource.
// Runtime can accept an allocation with 12.5% on the size threshold
if ((it->first->getSize() >= size) && (it->first->getSize() <= (size / 8) * 9) &&
if ((it->first->getSize() >= size) && (it->first->getSize() <= (size / 8.0) * 9) &&
check_address && (it->second.IsSafeFind(stream, opportunistic))) {
memory = it->first;
total_size_ -= memory->getSize();