Correct logic in getBasePtrForMap

Add ULT to verify that all mapAllocations are destroyed

Related-To: NEO-4672
Change-Id: If7d00cc9101c15bedf7ecf14a24ca9893f3f7c51
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Krzysztof Gibala
2020-08-13 13:42:31 +02:00
committed by sys_ocldev
parent ef833ed334
commit eca0ef41a1
2 changed files with 48 additions and 9 deletions

View File

@@ -353,8 +353,11 @@ void *MemObj::getBasePtrForMap(uint32_t rootDeviceIndex) {
if (getMapAllocation(rootDeviceIndex)) {
return getMapAllocation(rootDeviceIndex)->getUnderlyingBuffer();
} else {
auto memory = memoryManager->allocateSystemMemory(getSize(), MemoryConstants::pageSize);
setAllocatedMapPtr(memory);
auto memory = getAllocatedMapPtr();
if (!memory) {
memory = memoryManager->allocateSystemMemory(getSize(), MemoryConstants::pageSize);
setAllocatedMapPtr(memory);
}
AllocationProperties properties{rootDeviceIndex,
false, // allocateMemory
getSize(), GraphicsAllocation::AllocationType::MAP_ALLOCATION,