fix: Reuse private allocations during cmdList dispatch

Related-To: NEO-8201

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2023-08-10 15:40:21 +00:00
committed by Compute-Runtime-Automation
parent ba4867c3d0
commit 5807d512b3
20 changed files with 256 additions and 48 deletions

View File

@@ -389,6 +389,10 @@ void CommandStreamReceiver::cleanupResources() {
getMemoryManager()->freeGraphicsMemory(globalStatelessHeapAllocation);
globalStatelessHeapAllocation = nullptr;
}
for (auto &alloc : ownedPrivateAllocations) {
getMemoryManager()->freeGraphicsMemory(alloc.second);
}
ownedPrivateAllocations.clear();
}
WaitStatus CommandStreamReceiver::waitForCompletionWithTimeout(const WaitParams &params, TaskCountType taskCountToWait) {
@@ -567,6 +571,9 @@ ResidencyContainer &CommandStreamReceiver::getResidencyAllocations() {
ResidencyContainer &CommandStreamReceiver::getEvictionAllocations() {
return this->evictionAllocations;
}
std::unordered_map<uint32_t, GraphicsAllocation *> &CommandStreamReceiver::getOwnedPrivateAllocations() {
return this->ownedPrivateAllocations;
}
AubSubCaptureStatus CommandStreamReceiver::checkAndActivateAubSubCapture(const std::string &kernelName) { return {false, false}; }

View File

@@ -118,6 +118,7 @@ class CommandStreamReceiver {
ResidencyContainer &getResidencyAllocations();
ResidencyContainer &getEvictionAllocations();
std::unordered_map<uint32_t, GraphicsAllocation *> &getOwnedPrivateAllocations();
virtual GmmPageTableMngr *createPageTableManager() { return nullptr; }
bool needsPageTableManager() const;
@@ -460,6 +461,8 @@ class CommandStreamReceiver {
ResidencyContainer residencyAllocations;
ResidencyContainer evictionAllocations;
std::unordered_map<uint32_t, GraphicsAllocation *> ownedPrivateAllocations;
MutexType ownershipMutex;
MutexType hostPtrSurfaceCreationMutex;
ExecutionEnvironment &executionEnvironment;