SWDEV-503760 - Only consider allocations that are less than X% larger in a mempool request

Change-Id: I94acbca606fd4c575e2e1a9e34959ce650571867


[ROCm/clr commit: 44b6b6813d]
Этот коммит содержится в:
Ioannis Assiouras
2024-12-19 23:55:02 +00:00
родитель 0a9315f5e0
Коммит 161d590405
+2 -4
Просмотреть файл
@@ -53,13 +53,11 @@ amd::Memory* Heap::FindMemory(size_t size, Stream* stream, bool opportunistic,
check_address = true;
}
// Runtime can accept an allocation with 12.5% on the size threshold
bool opp_mode = opportunistic;
if (it->first.first > (size / 8.0) * 9) {
// Disable opportunistic mode for more aggressive search
opp_mode = false;
return nullptr;
}
// Check if size can match and it's safe to use this resource.
if (check_address && (it->second.IsSafeFind(stream, opp_mode))) {
if (check_address && (it->second.IsSafeFind(stream, opportunistic))) {
memory = it->first.second;
total_size_ -= memory->getSize();
// Preserve event, since the logic could skip GPU wait on reuse