C Specification
To return information about the kernel object that may be specific to a device, call the function
// Provided by CL_VERSION_1_0
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);
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
NULLvalue. -
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 Kernel Object Device Queries table.
-
param_value is a pointer to memory where the appropriate result being queried is returned. If param_value is
NULL, it is ignored. -
param_value_size specifies the size in bytes of memory pointed to by param_value. This size must be greater than or equal to the size of the return type specified in the Kernel Object Device Queries table. If param_value is
NULL, it is ignored. -
param_value_size_ret returns the actual size in bytes of data being queried by param_name. If param_value_size_ret is
NULL, it is ignored.
Description
| Kernel Work-group Info | Return Type | Description |
|---|---|---|
missing before version 1.2. |
|
This provides a mechanism for the application to query the maximum global size that can be used to execute a kernel (i.e. the global_work_size argument to clEnqueueNDRangeKernel) on a custom device given by device or a built-in kernel on an OpenCL device given by device. If device is not a custom device and kernel is not a built-in
kernel, clGetKernelWorkGroupInfo returns 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 |
|
|
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
If the local memory size, for any pointer argument to the kernel
declared with the |
|
|
Returns the preferred multiple of work-group size for launch. This is a performance hint. Specifying a work-group size that is not a multiple of the value returned by this query as the value of the local work size argument to clEnqueueNDRangeKernel will 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
|
clGetKernelWorkGroupInfo returns CL_SUCCESS if the function is executed
successfully.
Otherwise, it returns one of the following errors:
-
CL_INVALID_if kernel is a not a valid kernel object.KERNEL -
CL_INVALID_if device is not in the list of devices associated with kernel or if device isDEVICE NULLbut there is more than one device associated with kernel. -
CL_INVALID_if param_name is not one of the supported values, or if the size in bytes specified by param_value_size is less than size of the return type specified in the Kernel Object Device Queries table and param_value is notVALUE NULL. -
CL_INVALID_if param_name isVALUE CL_KERNEL_and device is not a custom device and kernel is not a built-in kernel.GLOBAL_ WORK_ SIZE -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the device.OF_ RESOURCES -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the host.OF_ HOST_ MEMORY
Document Notes
For more information, see the OpenCL Specification
This page is extracted from the OpenCL Specification. Fixes and changes should be made to the Specification, not directly.