enable create subBuffer from pooled buffer

Allow creating subBuffer from buffer from buffer pool allocator
by redirecting the call to the pool buffer and adjusting offset

Related-To: NEO-7332

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2022-10-18 08:39:46 +00:00
committed by Compute-Runtime-Automation
parent f06df021b5
commit d1a6054af9
6 changed files with 106 additions and 8 deletions

View File

@@ -786,14 +786,16 @@ cl_mem CL_API_CALL clCreateSubBuffer(cl_mem buffer,
break;
}
if (parentBuffer->isSubBuffer() == true) {
if (!parentBuffer->getContext()->getBufferPoolAllocator().isPoolBuffer(parentBuffer->getAssociatedMemObject()) || parentBuffer->isSubBufferFromPool) {
retVal = CL_INVALID_MEM_OBJECT;
break;
}
}
cl_mem_flags parentFlags = parentBuffer->getFlags();
cl_mem_flags_intel parentFlagsIntel = parentBuffer->getFlagsIntel();
if (parentBuffer->isSubBuffer() == true) {
retVal = CL_INVALID_MEM_OBJECT;
break;
}
/* Check whether flag is valid. */
if (((flags & CL_MEM_HOST_READ_ONLY) && (flags & CL_MEM_HOST_NO_ACCESS)) ||
((flags & CL_MEM_HOST_READ_ONLY) && (flags & CL_MEM_HOST_WRITE_ONLY)) ||