Returns information about the kernel object that may be specific to a device.
cl_int clGetKernelWorkGroupInfo(cl_kernel kernel, cl_device_id device, cl_kernel_work_group_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Specifies the kernel object being queried.
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
kernelis a single device,
devicecan be a NULL value.
Specifies the information to query. The list of supported
param_nametypes and the information returned in
clGetKernelWorkGroupInfois described in the table below.
A pointer to memory where the appropriate result being queried is returned. If
param_valueis NULL, it is ignored.
Used to specify 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.
cl_kernel_work_group_info Return Type Info. returned in
This provides a mechanism for the application to query the maximum global size that can be used to execute a kernel (i.e.
clEnqueueNDRangeKernel) on a custom device given by
deviceor a built-in kernel on an OpenCL device given by
deviceis not a custom device or
kernelis not a built-in kernel,
clGetKernelWorkGroupInforeturns the error
This provides a mechanism for the application to query the maximum work-group size that can be used to execute the 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.
As a result and unlike
CL_DEVICE_MAX_WORK_GROUP_SIZEthis value may vary from one kernel to another as well as one device to another.
CL_KERNEL_WORK_GROUP_SIZEwill be less than or equal to
CL_DEVICE_MAX_WORK_GROUP_SIZEfor a given kernel object.
Returns the work-group size specified in the kernel source or IL. If the work-group size is not specified in the kernel source or IL, (0, 0, 0) is returned.
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
localaddress qualifier and local memory to be allocated for arguments to the kernel declared as pointers with the
localaddress qualifier and whose size is specified with
If the local memory size, for any pointer argument to the kernel declared with the
__localaddress qualifier, is not specified, its size is assumed to be 0.
Returns the preferred multiple of workgroup size for launch. This is a performance hint. Specifying a workgroup size that is not a multiple of the value returned by this query as the value of the local work size argument to
clEnqueueNDRangeKernelwill not fail to enqueue the kernel for execution unless the work-group size specified is larger than the device maximum.
Returns the minimum amount of private memory, in bytes, used by each work-item in the kernel. This value may include any private memory needed by an implementation to execute the kernel, including that used by the language built-ins and variable declared inside the kernel with the
Returns the actual size in bytes of data copied to
param_value_size_retis NULL, it is ignored.
CL_SUCCESS if the function is executed successfully.
Otherwise, it returns one of the following errors:
deviceis not in the list of devices associated with
deviceis NULL but there is more than one device associated with
param_nameis not valid, or if size in bytes specified by
param_value_sizeis < size of return type as described in the table above and
param_valueis not NULL.
deviceis not a custom device and
kernelis not a built-in kernel.
kernelis a not a valid kernel object.
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.