Remove redundant/recursive checks in unmap operations

- Some of the paths were made only for ULTs
- Params like mappedPtr were ignored
- Improve confusing method names
- Fix for memory leak in map shared buffer path (not tested code)

Change-Id: I8a69035f1d1c340f2d131a6f8d7e13116e3ddabc
This commit is contained in:
Dunajski, Bartosz
2018-02-01 13:40:30 +01:00
parent ac3c032af0
commit 844f956244
18 changed files with 163 additions and 111 deletions

View File

@@ -45,7 +45,7 @@ void *CommandQueueHw<GfxFamily>::enqueueMapSharedBuffer(Buffer *buffer, cl_bool
auto memoryManager = device->getMemoryManager();
if (!buffer->getMappedPtr()) {
auto memory = memoryManager->allocateSystemMemory(buffer->getGraphicsAllocation()->getUnderlyingBufferSize(), 0);
buffer->setMappedPtr(memory);
buffer->setAllocatedMappedPtr(memory);
}
auto returnPtr = ptrOffset(buffer->getMappedPtr(), offset);
@@ -59,4 +59,4 @@ void *CommandQueueHw<GfxFamily>::enqueueMapSharedBuffer(Buffer *buffer, cl_bool
buffer->setMappedOffset(offset);
return returnPtr;
}
}
} // namespace OCLRT