[PAL] Change free mem tracking logic to use PAL size
PAL may internally align up the allocation size to the page size reported by KMD. This will cause a mismatch in size between OCL and PAL. To avoid this, use PAL size when updating the free memory counter on both alloc and free. Change-Id: Ic6e8c861a52170476474fb70a769eef93be3261f
Этот коммит содержится в:
@@ -84,7 +84,7 @@ GpuMemoryReference* GpuMemoryReference::Create(const Device& dev,
|
||||
}
|
||||
if (!createInfo.flags.sdiExternal) {
|
||||
// Update free memory size counters
|
||||
dev.updateAllocedMemory(createInfo.heaps[0], createInfo.size, false);
|
||||
dev.updateAllocedMemory(memRef->gpuMem_->Desc().preferredHeap, memRef->gpuMem_->Desc().size, false);
|
||||
}
|
||||
return memRef;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ GpuMemoryReference* GpuMemoryReference::Create(const Device& dev,
|
||||
}
|
||||
}
|
||||
// Update free memory size counters
|
||||
dev.updateAllocedMemory(Pal::GpuHeap::GpuHeapGartCacheable, createInfo.size, false);
|
||||
dev.updateAllocedMemory(memRef->gpuMem_->Desc().preferredHeap, memRef->gpuMem_->Desc().size, false);
|
||||
return memRef;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ GpuMemoryReference* GpuMemoryReference::Create(const Device& dev,
|
||||
}
|
||||
}
|
||||
// Update free memory size counters
|
||||
dev.updateAllocedMemory(Pal::GpuHeap::GpuHeapGartCacheable, createInfo.size, false);
|
||||
dev.updateAllocedMemory(memRef->gpuMem_->Desc().preferredHeap, memRef->gpuMem_->Desc().size, false);
|
||||
return memRef;
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user