Store a unified memory flags

Related-To: NEO-3610

Change-Id: Ie9f924f188d4024c7355b7655fea231229b4bf6a
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
This commit is contained in:
Jobczyk, Lukasz
2019-09-25 09:08:41 +02:00
committed by sys_ocldev
parent 3ec3ebfdbd
commit 62d5ed2c08
6 changed files with 158 additions and 8 deletions

View File

@@ -3407,7 +3407,13 @@ void *clHostMemAllocINTEL(
return nullptr;
}
return neoContext->getSVMAllocsManager()->createUnifiedMemoryAllocation(size, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY));
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY);
if (!MemObjHelper::parseUnifiedMemoryProperties(properties, unifiedMemoryProperties)) {
err.set(CL_INVALID_VALUE);
return nullptr;
}
return neoContext->getSVMAllocsManager()->createUnifiedMemoryAllocation(size, unifiedMemoryProperties);
}
void *clDeviceMemAllocINTEL(
@@ -3428,7 +3434,13 @@ void *clDeviceMemAllocINTEL(
return nullptr;
}
return neoContext->getSVMAllocsManager()->createUnifiedMemoryAllocation(size, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY));
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY);
if (!MemObjHelper::parseUnifiedMemoryProperties(properties, unifiedMemoryProperties)) {
err.set(CL_INVALID_VALUE);
return nullptr;
}
return neoContext->getSVMAllocsManager()->createUnifiedMemoryAllocation(size, unifiedMemoryProperties);
}
void *clSharedMemAllocINTEL(
@@ -3449,7 +3461,13 @@ void *clSharedMemAllocINTEL(
return nullptr;
}
return neoContext->getSVMAllocsManager()->createSharedUnifiedMemoryAllocation(size, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY), neoContext->getSpecialQueue());
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY);
if (!MemObjHelper::parseUnifiedMemoryProperties(properties, unifiedMemoryProperties)) {
err.set(CL_INVALID_VALUE);
return nullptr;
}
return neoContext->getSVMAllocsManager()->createSharedUnifiedMemoryAllocation(size, unifiedMemoryProperties, neoContext->getSpecialQueue());
}
cl_int clMemFreeINTEL(
@@ -3525,6 +3543,10 @@ cl_int clGetMemAllocInfoINTEL(
retVal = info.set<size_t>(unifiedMemoryAllocation->size);
return retVal;
}
case CL_MEM_ALLOC_FLAGS_INTEL: {
retVal = info.set<uint64_t>(unifiedMemoryAllocation->allocationFlagsProperty);
return retVal;
}
default: {
}
}