Pass MultiGraphicsAllocation in Buffer 3/3

Related-To: NEO-4672
Change-Id: Ic6b696b1df798fcdadcf17f9e22f1c0999361e47
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Krzysztof Gibala
2020-07-15 12:53:15 +02:00
committed by sys_ocldev
parent 6224db771a
commit d957349f76
6 changed files with 19 additions and 10 deletions

View File

@@ -49,7 +49,11 @@ class D3DBuffer : public D3DSharing<D3D> {
auto d3dBufferObj = new D3DBuffer<D3D>(context, d3dBuffer, bufferStaging, sharedResource);
return Buffer::createSharedBuffer(context, flags, d3dBufferObj, alloc);
auto rootDeviceIndex = alloc->getRootDeviceIndex();
auto multiGraphicsAllocation = MultiGraphicsAllocation(rootDeviceIndex);
multiGraphicsAllocation.addAllocation(alloc);
return Buffer::createSharedBuffer(context, flags, d3dBufferObj, multiGraphicsAllocation);
}
~D3DBuffer() override = default;

View File

@@ -38,7 +38,11 @@ Buffer *GlBuffer::createSharedGlBuffer(Context *context, cl_mem_flags flags, uns
}
auto glHandler = new GlBuffer(sharingFunctions, bufferId);
return Buffer::createSharedBuffer(context, flags, glHandler, graphicsAllocation);
auto rootDeviceIndex = graphicsAllocation->getRootDeviceIndex();
auto multiGraphicsAllocation = MultiGraphicsAllocation(rootDeviceIndex);
multiGraphicsAllocation.addAllocation(graphicsAllocation);
return Buffer::createSharedBuffer(context, flags, glHandler, multiGraphicsAllocation);
}
void GlBuffer::synchronizeObject(UpdateData &updateData) {

View File

@@ -29,5 +29,9 @@ Buffer *UnifiedBuffer::createSharedUnifiedBuffer(Context *context, cl_mem_flags
UnifiedSharingFunctions *sharingFunctions = context->getSharing<UnifiedSharingFunctions>();
auto sharingHandler = new UnifiedBuffer(sharingFunctions, extMem.type);
return Buffer::createSharedBuffer(context, flags, sharingHandler, graphicsAllocation);
auto rootDeviceIndex = graphicsAllocation->getRootDeviceIndex();
auto multiGraphicsAllocation = MultiGraphicsAllocation(rootDeviceIndex);
multiGraphicsAllocation.addAllocation(graphicsAllocation);
return Buffer::createSharedBuffer(context, flags, sharingHandler, multiGraphicsAllocation);
}