mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Store indirect residency at command queue level
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
81f2d04f5a
commit
1458602efc
@ -260,4 +260,22 @@ NEO::WaitStatus CommandQueueImp::CommandBufferManager::switchBuffers(NEO::Comman
|
||||
return waitStatus;
|
||||
}
|
||||
|
||||
void CommandQueueImp::handleIndirectAllocationResidency(UnifiedMemoryControls unifiedMemoryControls, std::unique_lock<std::mutex> &lockForIndirect) {
|
||||
NEO::Device *neoDevice = this->device->getNEODevice();
|
||||
auto svmAllocsManager = this->device->getDriverHandle()->getSvmAllocsManager();
|
||||
auto submitAsPack = this->device->getDriverHandle()->getMemoryManager()->allowIndirectAllocationsAsPack(neoDevice->getRootDeviceIndex());
|
||||
if (NEO::DebugManager.flags.MakeIndirectAllocationsResidentAsPack.get() != -1) {
|
||||
submitAsPack = !!NEO::DebugManager.flags.MakeIndirectAllocationsResidentAsPack.get();
|
||||
}
|
||||
|
||||
if (submitAsPack) {
|
||||
svmAllocsManager->makeIndirectAllocationsResident(*(this->csr), this->csr->peekTaskCount() + 1u);
|
||||
} else {
|
||||
lockForIndirect = this->device->getDriverHandle()->getSvmAllocsManager()->obtainOwnership();
|
||||
svmAllocsManager->addInternalAllocationsToResidencyContainer(neoDevice->getRootDeviceIndex(),
|
||||
this->csr->getResidencyAllocations(),
|
||||
unifiedMemoryControls.generateMask());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace L0
|
||||
|
Reference in New Issue
Block a user