feature: add pooling of USM global/constant surface

Related-To: NEO-12287
Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
This commit is contained in:
Fabian Zwoliński
2025-09-19 14:53:48 +00:00
committed by Compute-Runtime-Automation
parent 0b6b0e3954
commit a1c5fa1a13
15 changed files with 635 additions and 42 deletions

View File

@@ -77,6 +77,13 @@ Device::~Device() {
if (deviceUsmMemAllocPoolsManager) {
deviceUsmMemAllocPoolsManager->cleanup();
}
if (usmConstantSurfaceAllocPool) {
usmConstantSurfaceAllocPool->cleanup();
}
if (usmGlobalSurfaceAllocPool) {
usmGlobalSurfaceAllocPool->cleanup();
}
secondaryCsrs.clear();
executionEnvironment->memoryManager->releaseSecondaryOsContexts(this->getRootDeviceIndex());
commandStreamReceivers.clear();
@@ -222,6 +229,10 @@ bool Device::initializeCommonResources() {
deviceBitfields.emplace(getRootDeviceIndex(), getDeviceBitfield());
deviceUsmMemAllocPoolsManager.reset(new UsmMemAllocPoolsManager(getMemoryManager(), rootDeviceIndices, deviceBitfields, this, InternalMemoryType::deviceUnifiedMemory));
}
this->resetUsmConstantSurfaceAllocPool(new UsmMemAllocPool);
this->resetUsmGlobalSurfaceAllocPool(new UsmMemAllocPool);
return true;
}
@@ -267,6 +278,14 @@ void Device::cleanupUsmAllocationPool() {
}
}
void Device::resetUsmConstantSurfaceAllocPool(UsmMemAllocPool *usmMemAllocPool) {
this->usmConstantSurfaceAllocPool.reset(usmMemAllocPool);
}
void Device::resetUsmGlobalSurfaceAllocPool(UsmMemAllocPool *usmMemAllocPool) {
this->usmGlobalSurfaceAllocPool.reset(usmMemAllocPool);
}
bool Device::initDeviceFully() {
if (!getRootDeviceEnvironment().isExposeSingleDeviceMode()) {