0
votes

Just like sharing buffers with opengl but another opencl instead. Just like migrating a buffer to another opencl context but without event dependency.

I couldn't find any info about it but I need to copy an opencl buffer data to another opencl context buffer that uses same device and I need it stay away from host side copies. I need device-side (to/from same device) buffer copy. Also the buffers I'm using have many events attached to their operations.

A project I'm working on has multiple contexts computing with different kernels with multiple GPUs using double-buffered pipeline and I'm trying to fit same behavior to a single GPU without touching pci-e bridge.

1

1 Answers

1
votes

You cannot do that directly on OpenCL, since memory is allocated per-context. Note that there can be multiple devices in the same context if the platform supports it, and all devices in the same context will share the same memory object. A migration queue operation allows fine grain control over memory allocation on each device (although this is not required).

When using SYCL(A Khronos standard based on OpenCL), buffers are context-independent, and the runtime migrate data across context whenever is required. In this case, the runtime will chose the most appropriate method to do the transfer across contexts. For example, if the platform has a vendor-specific feature to allow this operation in an efficient way, the runtime will take advantage of it w/o requiring using interaction.