mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 05:56:36 +08:00
Prepare for pool buffer enabling 2/n
Use correct offset for subBuffer created with clCreateSubBuffer Make calls to clGetMemObjectInfo for CL_MEM_OFFSET and CL_MEM_ASSOCIATED_MEMOBJECT return values like with pool buffer disabled Related-To: NEO-7332 Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
4fbd2fcc51
commit
8468d6c4b0
@@ -172,11 +172,21 @@ cl_int MemObj::getMemObjectInfo(cl_mem_info paramName,
|
||||
break;
|
||||
|
||||
case CL_MEM_OFFSET:
|
||||
if (nullptr != this->associatedMemObject) {
|
||||
if (this->getContext()->getBufferPoolAllocator().isPoolBuffer(this->associatedMemObject)) {
|
||||
offset = 0;
|
||||
} else {
|
||||
offset -= this->associatedMemObject->getOffset();
|
||||
}
|
||||
}
|
||||
srcParamSize = sizeof(offset);
|
||||
srcParam = &offset;
|
||||
break;
|
||||
|
||||
case CL_MEM_ASSOCIATED_MEMOBJECT:
|
||||
if (this->getContext()->getBufferPoolAllocator().isPoolBuffer(this->associatedMemObject)) {
|
||||
clAssociatedMemObject = nullptr;
|
||||
}
|
||||
srcParamSize = sizeof(clAssociatedMemObject);
|
||||
srcParam = &clAssociatedMemObject;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user