logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

clCreateCommandQueue - Create a command-queue on a specific device.

Authors

TheKhronosGroup

Errors

clCreateCommandQueue returns a valid non-zero command-queue and errcode_ret is set to CL_SUCCESS if the
       command-queue is created successfully. Otherwise, it returns a NULL value with one of the following error
       values returned in errcode_ret:

       •   CL_INVALID_CONTEXT if context is not a valid context.

       •   CL_INVALID_DEVICE if device is not a valid device or is not associated with context.

       •   CL_INVALID_VALUE if values specified in properties are not valid.

       •   CL_INVALID_QUEUE_PROPERTIES if values specified in properties are valid but are not supported by the
           device.

       •   CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation
           on the device.

       •   CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL
           implementation on the host.

Name

       clCreateCommandQueue - Create a command-queue on a specific device.

       cl_command_queueclCreateCommandQueue(cl_contextcontext,cl_device_iddevice,cl_command_queue_propertiesproperties,cl_int*errcode_ret);

Notes

        1. OpenCL Specification
           page 61, section 5.1 - Command Queues

The Khronos Group                                  11/18/2024                         CLCREATECOMMANDQUEUE(3clc)

Parameters

context
           Must be a valid OpenCL context.

       device
           Must be a device associated with context. It can either be in the list of devices specified when
           context is created using clCreateContext(3clc) or have the same device type as the device type
           specified when the context is created using clCreateContextFromType(3clc).

       properties
           Specifies a list of properties for the command-queue. This is a bit-field described in the table
           below. Only command-queue properties specified in the table below can be set in properties; otherwise
           the value specified in properties is considered to be not valid.
           ┌────────────────────────────────────────┬───────────────────────────────────────┐
           │ Command-QueuePropertiesDescription                           │
           ├────────────────────────────────────────┼───────────────────────────────────────┤
           │ CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE │ Determines whether the commands       │
           │                                        │ queued in the command-queue are       │
           │                                        │ executed in-order or out-of-order. If │
           │                                        │ set, the commands in the              │
           │                                        │ command-queue are executed            │
           │                                        │ out-of-order. Otherwise, commands are │
           │                                        │ executed in-order. See note below for │
           │                                        │ more information.                     │
           ├────────────────────────────────────────┼───────────────────────────────────────┤
           │ CL_QUEUE_PROFILING_ENABLE              │ Enable or disable profiling of        │
           │                                        │ commands in the command-queue. If     │
           │                                        │ set, the profiling of commands is     │
           │                                        │ enabled. Otherwise profiling of       │
           │                                        │ commands is disabled. See             │
           │                                        │ clGetEventProfilingInfo(3clc) for     │
           │                                        │ more information.                     │
           └────────────────────────────────────────┴───────────────────────────────────────┘

       errcode_ret
           Returns an appropriate error code. If errcode_ret is NULL, no error code is returned.

See Also

clGetCommandQueueInfo(3clc), clReleaseCommandQueue(3clc), clRetainCommandQueue(3clc),
       clCreateContext(3clc), clCreateContextFromType(3clc), classDiagram(3clc)

Specification

OpenCLSpecification[1]

See Also