Query information about a command-queue.
cl_int clGetCommandQueueInfo(cl_command_queue command_queue,
cl_command_queue_info param_name,
size_t param_value_size,
void *param_value,
size_t *param_value_size_ret)command_queue-
Specifies the command-queue being queried.
param_name-
Specifies the information to query.
param_value_size-
Specifies the size in bytes of memory pointed to by
param_value. This size must be ≥ size of return type as described in the table below. Ifparam_valueis NULL, it is ignored. param_value-
A pointer to memory where the appropriate result being queried is returned. If
param_valueis NULL, it is ignored. param_value_size_ret-
Returns the actual size in bytes of data being queried by
param_value. Ifparam_value_size_retis NULL, it is ignored.
::
+
The list of supported param_name values and the information returned in param_value by clGetCommandQueueInfo is described in the table below.
| cl_command_queue_info | Return Type and Information returned in param_value |
|---|---|
|
Return type: Return the context specified when the command-queue is created. |
|
Return type: Return the device specified when the command-queue is created. |
|
Return type: Return the command-queue reference count. The reference count returned with |
|
Return type: Return the currently specified properties for the command-queue.
These properties are specified by the value associated with the |
|
Return type: Return the currently specified size for the device command-queue. This query is only supported for device command queues. |
|
Return type: Return the current default command queue for the underlying device. |
It is possible that a device(s) becomes unavailable after a context and command-queues that use this device(s) have been created and commands have been queued to command-queues.
In this case the behavior of OpenCL API calls that use this context (and command-queues) are considered to be implementation-defined.
The user callback function, if specified, when the context is created can be used to record appropriate information in the errinfo, private_info arguments passed to the callback function when the device becomes unavailable.
Returns CL_SUCCESS if the function is executed successfully.
Otherwise, it returns one of the following errors:
-
Returns
CL_INVALID_COMMAND_QUEUEifcommand_queueis not a valid command-queue. -
Returns
CL_INVALID_VALUEifparam_nameis not one of the supported values or if size in bytes specified byparam_value_sizeis less than size of return type andparam_valueis not a NULL value. -
CL_OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device. -
CL_OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.