mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
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:
committed by
Compute-Runtime-Automation
parent
9a3fea9849
commit
6562828095
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user