mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
HostPtr allocation with life time of buffer object for CL_MEM_USE_HOST_PTR
Related-To: NEO-3231 Change-Id: Ic112819c793482844aa712b4a8a1827ec9408812 Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
a5c4956bbd
commit
474c25eca6
@@ -268,8 +268,15 @@ Buffer *Buffer::create(Context *context,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
pBuffer->setHostPtrMinSize(size);
|
||||
if (properties.flags & CL_MEM_USE_HOST_PTR) {
|
||||
if (!zeroCopyAllowed && !isHostPtrSVM) {
|
||||
AllocationProperties properties{false, size, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, false};
|
||||
properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = true;
|
||||
mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, hostPtr);
|
||||
}
|
||||
}
|
||||
pBuffer->mapAllocation = mapAllocation;
|
||||
pBuffer->setHostPtrMinSize(size);
|
||||
|
||||
if (copyMemoryFromHostPtr) {
|
||||
auto gmm = memory->getDefaultGmm();
|
||||
|
||||
Reference in New Issue
Block a user