There is a clEnqueueMigrateMemObjects function, which is new compared to OpenCL 1.2.
This function can be used to transfer memory buffers between devices in the same context.
I have never tried using it myself, so I donβt know if it really becomes less expensive than copying device-> host-> (most likely, this will happen in a number of implementations).
source share