mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 01:48:50 +08:00
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:
committed by
Compute-Runtime-Automation
parent
f06df021b5
commit
d1a6054af9
@@ -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)) ||
|
||||
|
||||
Reference in New Issue
Block a user