'\" t .\" Title: clGetKernelWorkGroupInfo .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 01/14/2021 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "CLGETKERNELWORKGROUP" "3clc" "01/14/2021" "The Khronos Group" "OpenCL Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" clGetKernelWorkGroupInfo \- Returns information about the kernel object that may be specific to a device\&. .SH "" .HP \w'cl_int\ clGetKernelWorkGroupInfo('u .BI "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" ");" .SH "PARAMETERS" .PP \fI kernel \fR .RS 4 Specifies the kernel object being queried\&. .RE .PP \fI device \fR .RS 4 Identifies a specific device in the list of devices associated with \fIkernel\fR\&. The list of devices is the list of devices in the OpenCL context that is associated with \fIkernel\fR\&. If the list of devices associated with \fIkernel\fR is a single device, \fIdevice\fR can be a NULL value\&. .RE .PP \fI param_name \fR .RS 4 Specifies the information to query\&. The list of supported \fIparam_name\fR types and the information returned in \fIparam_value\fR by \fBclGetKernelWorkGroupInfo\fR is described in the table below\&. .RE .PP \fI param_value \fR .RS 4 A pointer to memory where the appropriate result being queried is returned\&. If \fIparam_value\fR is NULL, it is ignored\&. .RE .PP \fI param_value_size \fR .RS 4 Used to specify the size in bytes of memory pointed to by \fIparam_value\fR\&. This size must be ≥ size of return type as described in the table below\&. .TS allbox tab(:); lB lB lB. T{ cl_kernel_work_group_info T}:T{ Return Type T}:T{ Info\&. returned in \fIparam_value\fR T} .T& l l l l l l l l l l l l l l l l l l. T{ \fBCL_KERNEL_GLOBAL_WORK_SIZE\fR T}:T{ size_t[3] T}:T{ This provides a mechanism for the application to query the maximum global size that can be used to execute a kernel (i\&.e\&. \fIglobal_work_size\fR argument to \fBclEnqueueNDRangeKernel\fR(3clc)) on a custom device given by \fIdevice\fR or a built\-in kernel on an OpenCL device given by \fIdevice\fR\&. If \fIdevice\fR is not a custom device or \fIkernel\fR is not a built\-in kernel, \fBclGetKernelArgInfo\fR(3clc) returns the error \fBCL_INVALID_VALUE\fR\&. T} T{ \fBCL_KERNEL_WORK_GROUP_SIZE\fR T}:T{ size_t T}:T{ This provides a mechanism for the application to query the maximum work\-group size that can be used to execute a kernel on a specific device given by \fIdevice\fR\&. The OpenCL implementation uses the resource requirements of the kernel (register usage etc\&.) to determine what this work\-group size should be\&. T} T{ \fBCL_KERNEL_COMPILE_\- WORK_GROUP_SIZE\fR T}:T{ size_t[3] T}:T{ Returns the work\-group size specified by the \fB__attribute__((reqd_work_group_size(X, Y, Z)))\fR qualifier\&. See \fBfunctionQualifiers\fR(3clc)\&. If the work\-group size is not specified using the above attribute qualifier (0, 0, 0) is returned\&. T} T{ \fBCL_KERNEL_LOCAL_MEM_SIZE\fR T}:T{ cl_ulong T}:T{ 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 \fBlocal\fR(3clc) address qualifier and local memory to be allocated for arguments to the kernel declared as pointers with the \fBlocal\fR(3clc) address qualifier and whose size is specified with \fBclSetKernelArg\fR(3clc)\&. .sp If the local memory size, for any pointer argument to the kernel declared with the \fBlocal\fR(3clc) address qualifier, is not specified, its size is assumed to be 0\&. T} T{ \fBCL_KERNEL_PREFERRED_WORK_\- GROUP_SIZE_MULTIPLE\fR T}:T{ size_t T}:T{ 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 \fBclEnqueueNDRangeKernel\fR(3clc)will not fail to enqueue the kernel for execution unless the work\-group size specified is larger than the device maximum\&. T} T{ \fBCL_KERNEL_PRIVATE_MEM_SIZE\fR T}:T{ cl_ulong T}:T{ Returns the minimum amount of private memory, in bytes, used by each workitem 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 \fBprivate\fR(3clc) qualifier\&. T} .TE .sp 1 .RE .PP \fI param_value_size_ret \fR .RS 4 Returns the actual size in bytes of data copied to \fIparam_value\fR\&. If \fIparam_value_size_ret\fR is NULL, it is ignored\&. .RE .SH "ERRORS" .PP Returns CL_SUCCESS if the function is executed successfully\&. Otherwise, it returns one of the following errors: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_DEVICE if \fIdevice\fR is not in the list of devices associated with \fIkernel\fR or if \fIdevice\fR is NULL but there is more than one device associated with \fIkernel\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if \fIparam_name\fR is not valid, or if size in bytes specified by \fIparam_value_size\fR is < size of return type as described in the table above and \fIparam_value\fR is not NULL\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if \fIparam_name\fR is \fBCL_KERNEL_GLOBAL_WORK_SIZE\fR and \fIdevice\fR is not a custom device or \fIkernel\fR is not a built\-in kernel\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_KERNEL if \fIkernel\fR is a not a valid kernel object\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host\&. .RE .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBclCreateKernel\fR(3clc), \fBclCreateKernelsInProgram\fR(3clc), \fBclReleaseKernel\fR(3clc), \fBclRetainKernel\fR(3clc), \fBclSetKernelArg\fR(3clc), \fBclGetKernelInfo\fR(3clc) .SH "AUTHORS" .PP \fBThe Khronos Group\fR .SH "COPYRIGHT" .br Copyright \(co 2007-2011 The Khronos Group Inc. .br Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials. .sp .SH "NOTES" .IP " 1." 4 OpenCL Specification .RS 4 \%page 164, section 5.7.3 - Kernel Object Queries .RE