I use One context and a command queue for each device.
After every clEnqueueWriteBuffer() i use
clEnqueueMigrateMemObjects(CommandQueue, 1, &Memory, CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED, 0, NULL, NULL);
If I want to Share Buffer Between Devices of the Same Platform would the above be the correct and fastest away?
Extra:
Is it faster to use clEnqueueWriteBuffer() after clEnqueueMigrateMemObjects()?
Also, does clSetKernelArg() have any overhead when calling it?