mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 06:23:01 +08:00
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:
committed by
Compute-Runtime-Automation
parent
ca2b26e87b
commit
68698c9a74
@@ -100,9 +100,24 @@ void ModuleTranslationUnit::freeGlobalBufferAllocation(const std::unique_ptr<NEO
|
||||
return;
|
||||
}
|
||||
|
||||
auto svmAllocsManager = device->getDriverHandle()->getSvmAllocsManager();
|
||||
auto gpuAddress = reinterpret_cast<void *>(globalBuffer->getGpuAddress());
|
||||
|
||||
if (auto usmPool = device->getNEODevice()->getUsmConstantSurfaceAllocPool();
|
||||
usmPool && usmPool->isInPool(gpuAddress)) {
|
||||
[[maybe_unused]] auto ret = usmPool->freeSVMAlloc(gpuAddress, false);
|
||||
DEBUG_BREAK_IF(!ret);
|
||||
return;
|
||||
}
|
||||
|
||||
if (auto usmPool = device->getNEODevice()->getUsmGlobalSurfaceAllocPool();
|
||||
usmPool && usmPool->isInPool(gpuAddress)) {
|
||||
[[maybe_unused]] auto ret = usmPool->freeSVMAlloc(gpuAddress, false);
|
||||
DEBUG_BREAK_IF(!ret);
|
||||
return;
|
||||
}
|
||||
|
||||
auto svmAllocsManager = device->getDriverHandle()->getSvmAllocsManager();
|
||||
|
||||
if (svmAllocsManager->getSVMAlloc(gpuAddress)) {
|
||||
svmAllocsManager->freeSVMAlloc(gpuAddress);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user