Handle OS-managed allocations in clGetMemAllocInfoINTEL

Change-Id: I9750bcc05f01aef3973cfac4f10e7d4d9d667bed
Related-To: NEO-3524
This commit is contained in:
Lukasz Towarek
2019-07-24 14:24:53 +02:00
committed by sys_ocldev
parent d9e02697bf
commit eea2a4451a
2 changed files with 19 additions and 2 deletions

View File

@ -3481,14 +3481,17 @@ cl_int clGetMemAllocInfoINTEL(
}
auto unifiedMemoryAllocation = allocationsManager->getSVMAlloc(ptr);
if (!unifiedMemoryAllocation) {
if (!unifiedMemoryAllocation && paramName != CL_MEM_ALLOC_TYPE_INTEL) {
return CL_INVALID_VALUE;
}
GetInfoHelper info(paramValue, paramValueSize, paramValueSizeRet);
switch (paramName) {
case CL_MEM_ALLOC_TYPE_INTEL: {
if (unifiedMemoryAllocation->memoryType == InternalMemoryType::HOST_UNIFIED_MEMORY) {
if (!unifiedMemoryAllocation) {
retVal = info.set<cl_int>(CL_MEM_TYPE_UNKNOWN_INTEL);
return retVal;
} else if (unifiedMemoryAllocation->memoryType == InternalMemoryType::HOST_UNIFIED_MEMORY) {
retVal = info.set<cl_int>(CL_MEM_TYPE_HOST_INTEL);
return retVal;
} else if (unifiedMemoryAllocation->memoryType == InternalMemoryType::DEVICE_UNIFIED_MEMORY) {