Parameters

kernel

Specifies the kernel object being queried.

device

Identifies a specific device in the list of devices associated with kernel. The list of devices
is the list of devices in the OpenCL context that is associated with kernel. If the list of devices
associated with kernel is a single device, device can be a NULL value.

param_name

Specifies the information to query. The list of supported param_name types and the
information returned in param_value by clGetKernelWorkGroupInfo is described in the table below.

param_value

A pointer to memory where the appropriate result being queried is returned. If param_value is NULL, it is ignored.

param_value_size

Used to specify the size in bytes of memory pointed to by param_value.
This size must be greater than or equal to size of return type as described in the table below.

cl_kernel_work_group_info

Return Type

Info. returned in param_value

CL_KERNEL_WORK_GROUP_SIZE

size_t

This provides a mechanism for the
application to query the work-group size
that can be used to execute a kernel on a
specific device given by device. The
OpenCL implementation uses the
resource requirements of the kernel
(register usage etc.) to determine what
this work-group size should be.

CL_KERNEL_COMPILE_WORK_GROUP_SIZE

size_t[3]

Returns the work-group size specified
by the
__attribute__((reqd_work_gr
oup_size(X, Y, Z))) qualifier.
See Function Qualifiers.
If the work-group size is not specified
using the above attribute qualifier (0, 0,
0) is returned.

CL_KERNEL_LOCAL_MEM_SIZE

cl_ulong

Returns the amount of local memory in
bytes being used by a kernel. This
includes local memory that may be
needed by an implementation to execute
the kernel, variables declared inside the
kernel with the __local address
qualifier and local memory to be
allocated for arguments to the kernel
declared as pointers with the __local
address qualifier and whose size is
specified with clSetKernelArg.

If the local memory size, for any pointer
argument to the kernel declared with the
__local address qualifier, is not
specified, its size is assumed to be 0.

param_value_size_ret

Returns the actual size in bytes of data copied to param_value. If param_value_size_ret is NULL, it is ignored.

Errors

Returns CL_SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:

CL_INVALID_DEVICE if device is not in the list of devices associated with kernel or if device is NULL but there is more than one device associated with kernel.

CL_INVALID_VALUE if param_name is not valid, or if size in bytes specified by param_value_size is less than the size of return type as described in the table above and param_value is not NULL.