Create storage info in one place

Related-To: NEO-2860

Change-Id: Ic37b89f2a80267b499227a8311aabd1fc6fb2754
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2019-04-02 13:17:57 +02:00
parent 3abfb7cb3f
commit 4e3f0e6ab2
6 changed files with 10 additions and 26 deletions

View File

@@ -48,14 +48,12 @@ Pipe *Pipe::create(Context *context,
MemoryManager *memoryManager = context->getMemoryManager();
DEBUG_BREAK_IF(!memoryManager);
MemoryProperties memoryProperties;
memoryProperties.flags = flags;
MemoryProperties memoryProperties{flags};
while (true) {
auto size = static_cast<size_t>(packetSize * (maxPackets + 1) + intelPipeHeaderReservedSpace);
AllocationProperties allocProperties =
MemObjHelper::getAllocationProperties(memoryProperties, true, size, GraphicsAllocation::AllocationType::PIPE);
StorageInfo storageInfo = MemObjHelper::getStorageInfo(memoryProperties);
GraphicsAllocation *memory = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, storageInfo, nullptr);
GraphicsAllocation *memory = memoryManager->allocateGraphicsMemoryWithProperties(allocProperties);
if (!memory) {
errcodeRet = CL_OUT_OF_HOST_MEMORY;
break;