performance: move usm pool init to first alloc call

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2024-07-18 12:49:10 +00:00
committed by Compute-Runtime-Automation
parent 3fbcbcaef2
commit 20d6910b66
8 changed files with 53 additions and 15 deletions

View File

@@ -3933,6 +3933,8 @@ CL_API_ENTRY void *CL_API_CALL clHostMemAllocINTEL(
return nullptr;
}
neoContext->initializeUsmAllocationPools();
auto allocationFromPool = neoContext->getHostMemAllocPool().createUnifiedMemoryAllocation(size, unifiedMemoryProperties);
if (allocationFromPool) {
TRACING_EXIT(ClHostMemAllocINTEL, &allocationFromPool);
@@ -3995,6 +3997,8 @@ CL_API_ENTRY void *CL_API_CALL clDeviceMemAllocINTEL(
unifiedMemoryProperties.device = &neoDevice->getDevice();
neoContext->initializeUsmAllocationPools();
auto allocationFromPool = neoContext->getDeviceMemAllocPool().createUnifiedMemoryAllocation(size, unifiedMemoryProperties);
if (allocationFromPool) {
TRACING_EXIT(ClDeviceMemAllocINTEL, &allocationFromPool);