Add support for deletion of allocations that may be in use by GPU.

- fix deletion of constant program surface
- fix deletion of global program surface
- move program_data tests to shared code
- make program_data tests SKU agnostic

Change-Id: Icf3e9fd035416072699336c4f86e49703ef48cc5
This commit is contained in:
Mrozek, Michal
2018-01-19 10:55:36 +01:00
committed by sys_ocldev
parent d91d01fedd
commit 0066daf495
11 changed files with 130 additions and 63 deletions

View File

@@ -253,6 +253,15 @@ void MemoryManager::clearEvictionAllocations() {
void MemoryManager::freeGraphicsMemory(GraphicsAllocation *gfxAllocation) {
freeGraphicsMemoryImpl(gfxAllocation);
}
//if not in use destroy in place
//if in use pass to temporary allocation list that is cleaned on blocking calls
void MemoryManager::checkGpuUsageAndDestroyGraphicsAllocations(GraphicsAllocation *gfxAllocation) {
if (gfxAllocation->taskCount == ObjectNotUsed || gfxAllocation->taskCount <= *csr->getTagAddress()) {
freeGraphicsMemory(gfxAllocation);
} else {
storeAllocation(std::unique_ptr<GraphicsAllocation>(gfxAllocation), TEMPORARY_ALLOCATION);
}
}
void MemoryManager::waitForDeletions() {
if (deferredDeleter) {