5.4 Creating a command queue

After creating your OpenCL context, use clCreateCommandQueue() to create a command queue.

OpenCL 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)
       return 1;

If you have multiple OpenCL devices, you must:

  1. Create a command queue for each device.
  2. Divide up the work.
  3. Submit commands separately to each device.
Non-ConfidentialPDF file icon PDF version101574_0302_00_en
Copyright © 2019 Arm Limited or its affiliates. All rights reserved.