performance: prealloc internal heap on mtl

Preallocate 1 internal heap allocation per csr on mtl

Related-To: NEO-8152

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2023-11-17 12:14:15 +00:00
committed by Compute-Runtime-Automation
parent 9a3fea9849
commit 6562828095
9 changed files with 65 additions and 6 deletions

View File

@@ -262,8 +262,8 @@ void CommandStreamReceiver::ensureCommandBufferAllocation(LinearStream &commandS
commandStream.replaceGraphicsAllocation(allocation);
}
void CommandStreamReceiver::preallocateCommandBuffer() {
const AllocationProperties commandStreamAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER,
void CommandStreamReceiver::preallocateAllocation(AllocationType type, size_t size) {
const AllocationProperties commandStreamAllocationProperties{rootDeviceIndex, true, size, type,
isMultiOsContextCapable(), false, deviceBitfield};
auto allocation = this->getMemoryManager()->allocateGraphicsMemoryWithProperties(commandStreamAllocationProperties);
if (allocation) {
@@ -272,12 +272,25 @@ void CommandStreamReceiver::preallocateCommandBuffer() {
}
}
void CommandStreamReceiver::preallocateCommandBuffer() {
preallocateAllocation(AllocationType::COMMAND_BUFFER, MemoryConstants::pageSize64k);
}
void CommandStreamReceiver::preallocateInternalHeap() {
preallocateAllocation(AllocationType::INTERNAL_HEAP, MemoryConstants::pageSize64k);
}
void CommandStreamReceiver::fillReusableAllocationsList() {
auto &gfxCoreHelper = getGfxCoreHelper();
auto amountToFill = gfxCoreHelper.getAmountOfAllocationsToFill();
for (auto i = 0u; i < amountToFill; i++) {
preallocateCommandBuffer();
}
auto internalHeapsToFill = getProductHelper().getInternalHeapsPreallocated();
for (auto i = 0u; i < internalHeapsToFill; i++) {
preallocateInternalHeap();
}
}
void CommandStreamReceiver::requestPreallocation() {