performance: usm device pool, compression handling

Use device compression defaults when allocating pool.
Ignore compression hints when allocating from pool.

Also remove unused late initialization methods.

Related-To: NEO-6893

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2025-05-06 14:38:32 +00:00
committed by Compute-Runtime-Automation
parent 24572eeaae
commit 6afefa1e31
5 changed files with 141 additions and 113 deletions

View File

@@ -307,9 +307,6 @@ ze_result_t DriverHandleImp::initialize(std::vector<std::unique_ptr<NEO::Device>
this->initHostUsmAllocPool();
for (auto &device : this->devices) {
this->initDeviceUsmAllocPool(*device->getNEODevice());
if (auto deviceUsmAllocPool = device->getNEODevice()->getUsmMemAllocPool()) {
deviceUsmAllocPool->ensureInitialized(this->svmAllocsManager);
}
if (auto deviceUsmAllocPoolsManager = device->getNEODevice()->getUsmMemAllocPoolsManager()) {
deviceUsmAllocPoolsManager->ensureInitialized(this->svmAllocsManager);
}
@@ -387,8 +384,17 @@ void DriverHandleImp::initDeviceUsmAllocPool(NEO::Device &device) {
}
if (enabled) {
device.resetUsmAllocationPool(new NEO::UsmMemAllocPool(rootDeviceIndices, deviceBitfields, &device, InternalMemoryType::deviceUnifiedMemory,
poolSize, minServicedSize, maxServicedSize));
device.resetUsmAllocationPool(new NEO::UsmMemAllocPool);
auto &hwInfo = device.getHardwareInfo();
auto &l0GfxCoreHelper = device.getRootDeviceEnvironment().getHelper<L0GfxCoreHelper>();
const bool compressionEnabledByDefault = l0GfxCoreHelper.usmCompressionSupported(hwInfo) && l0GfxCoreHelper.forceDefaultUsmCompressionSupport();
NEO::SVMAllocsManager::UnifiedMemoryProperties poolMemoryProperties(InternalMemoryType::deviceUnifiedMemory,
MemoryConstants::pageSize2M,
rootDeviceIndices,
deviceBitfields);
poolMemoryProperties.device = &device;
poolMemoryProperties.allocationFlags.flags.compressedHint = compressionEnabledByDefault;
device.getUsmMemAllocPool()->initialize(this->svmAllocsManager, poolMemoryProperties, poolSize, minServicedSize, maxServicedSize);
}
}