mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
Early preallocate command buffer to reuse for csr
Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
502a9443f1
commit
06e5b1cd42
@@ -63,7 +63,6 @@ CommandStreamReceiver::CommandStreamReceiver(ExecutionEnvironment &executionEnvi
|
||||
indirectHeap[i] = nullptr;
|
||||
}
|
||||
internalAllocationStorage = std::make_unique<InternalAllocationStorage>(*this);
|
||||
|
||||
const auto &hwInfo = peekHwInfo();
|
||||
uint32_t subDeviceCount = static_cast<uint32_t>(deviceBitfield.count());
|
||||
bool platformImplicitScaling = HwHelper::get(hwInfo.platform.eRenderCoreFamily).platformSupportsImplicitScaling(hwInfo);
|
||||
@@ -235,6 +234,17 @@ void CommandStreamReceiver::ensureCommandBufferAllocation(LinearStream &commandS
|
||||
commandStream.replaceGraphicsAllocation(allocation);
|
||||
}
|
||||
|
||||
void CommandStreamReceiver::fillReusableAllocationsList() {
|
||||
auto amountToFill = HwHelper::get(peekHwInfo().platform.eRenderCoreFamily).getAmountOfAllocationsToFill();
|
||||
for (auto i = 0u; i < amountToFill; i++) {
|
||||
const AllocationProperties commandStreamAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER,
|
||||
isMultiOsContextCapable(), false, osContext->getDeviceBitfield()};
|
||||
auto allocation = this->getMemoryManager()->allocateGraphicsMemoryWithProperties(commandStreamAllocationProperties);
|
||||
getInternalAllocationStorage()->storeAllocation(std::unique_ptr<GraphicsAllocation>(allocation), REUSABLE_ALLOCATION);
|
||||
this->makeResident(*allocation);
|
||||
}
|
||||
}
|
||||
|
||||
MemoryManager *CommandStreamReceiver::getMemoryManager() const {
|
||||
DEBUG_BREAK_IF(!executionEnvironment.memoryManager);
|
||||
return executionEnvironment.memoryManager.get();
|
||||
|
||||
@@ -212,6 +212,7 @@ class CommandStreamReceiver {
|
||||
InternalAllocationStorage *getInternalAllocationStorage() const { return internalAllocationStorage.get(); }
|
||||
MOCKABLE_VIRTUAL bool createAllocationForHostSurface(HostPtrSurface &surface, bool requiresL3Flush);
|
||||
virtual size_t getPreferredTagPoolSize() const;
|
||||
virtual void fillReusableAllocationsList();
|
||||
virtual void setupContext(OsContext &osContext) { this->osContext = &osContext; }
|
||||
OsContext &getOsContext() const { return *osContext; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user