5.4 Creating a
After creating your OpenCL context, use clCreateCommandQueue() to create a command queue.
OpenCL 1.2 does not support the automatic distribution of work to devices. If
you want to share work between devices, or have dependencies between operations enqueued on
devices, then you must create the command queues in the same OpenCL context.
Example command queue:
// Create a command-queue on the first device available
// on the created context
commandQueue = clCreateCommandQueue(context, device, properties, errcode_ref);
if (commandQueue == NULL)
If you have multiple OpenCL devices, you must:
- Create a command
queue for each device.
- Divide up the work.
- Submit commands separately to each device.