mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
[33/n] Internal 4GB allocator.
- Move indirect heap to internal allocator domain. - Add logic in getIndirectHeap to allocate with proper API depending on heap type - Add State base Address programming, reflecting that now Indirect Object Heap is placed in 4GB domain. - For AddPatchInfoCommentsForAUBDump mode , keep all heaps in non 4GB mode. Change-Id: I6862f6a249e444d0d6cfe7e499a10d43f284553e
This commit is contained in:

committed by
sys_ocldev

parent
81362d5b7d
commit
d900bdffc6
@ -635,15 +635,24 @@ void CommandQueue::allocateHeapMemory(IndirectHeap::Type heapType,
|
||||
auto memoryManager = device->getMemoryManager();
|
||||
size_t reservedSize = 0;
|
||||
auto finalHeapSize = defaultHeapSize;
|
||||
bool requireInternalHeap = IndirectHeap::INDIRECT_OBJECT == heapType ? true : false;
|
||||
|
||||
if (DebugManager.flags.AddPatchInfoCommentsForAUBDump.get()) {
|
||||
requireInternalHeap = false;
|
||||
}
|
||||
|
||||
minRequiredSize += reservedSize;
|
||||
|
||||
finalHeapSize = alignUp(std::max(finalHeapSize, minRequiredSize), MemoryConstants::pageSize);
|
||||
|
||||
auto heapMemory = memoryManager->obtainReusableAllocation(finalHeapSize, false).release();
|
||||
auto heapMemory = memoryManager->obtainReusableAllocation(finalHeapSize, requireInternalHeap).release();
|
||||
|
||||
if (!heapMemory) {
|
||||
heapMemory = memoryManager->allocateGraphicsMemory(finalHeapSize, MemoryConstants::pageSize);
|
||||
if (requireInternalHeap) {
|
||||
heapMemory = memoryManager->createInternalGraphicsAllocation(nullptr, finalHeapSize);
|
||||
} else {
|
||||
heapMemory = memoryManager->allocateGraphicsMemory(finalHeapSize, MemoryConstants::pageSize);
|
||||
}
|
||||
} else {
|
||||
finalHeapSize = std::max(heapMemory->getUnderlyingBufferSize(), finalHeapSize);
|
||||
}
|
||||
@ -659,7 +668,7 @@ void CommandQueue::allocateHeapMemory(IndirectHeap::Type heapType,
|
||||
indirectHeap->replaceBuffer(heapMemory->getUnderlyingBuffer(), finalHeapSize);
|
||||
indirectHeap->replaceGraphicsAllocation(heapMemory);
|
||||
} else {
|
||||
indirectHeap = new IndirectHeap(heapMemory);
|
||||
indirectHeap = new IndirectHeap(heapMemory, requireInternalHeap);
|
||||
indirectHeap->overrideMaxSize(finalHeapSize);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user