CLGETKERNELINFO(3clc)
๐ CLGETKERNELINFO ๐
okay so bestie, welcome to the OpenCL Manual page for clGetKernelInfo โ yes it's a 3clc page, yes it's iconic, and yes we're gonna get you fluent in it. no cap. โจ
๐ธ NAME ๐ธ
clGetKernelInfo โ returns information about the kernel object. literally just "tell me stuff about this kernel", that's the whole vibe ๐
cl_int clGetKernelInfo(cl_kernel kernel, cl_kernel_info param_name,
size_t param_value_size, void *param_value,
size_t *param_value_size_ret);
๐ฆ PARAMETERS ๐ฆ
kernelโ the kernel object you're interrogating. specify it, bestie. it's the main character here. ๐param_nameโ which piece of info you wanna know. the list of supportedparam_nametypes and what actually comes back inparam_valueis right below in the table. slay. ๐param_valueโ a pointer to memory where the result you asked for gets dropped off. ifparam_valueisNULL, it is ignored. ghosted. ๐param_value_sizeโ how big, in bytes, the memory pointed to byparam_valueis. this size must be โฅ size of return type as described in the table below. do not play with this. โ ๏ธ
here's the table, but make it a list because we're cute like that:
CL_KERNEL_FUNCTION_NAMEโ return typechar[]โ returns the kernel function name. โจCL_KERNEL_NUM_ARGSโ return typecl_uintโ returns the number of arguments to kernel. ๐ขCL_KERNEL_REFERENCE_COUNTโ return typecl_uintโ returns the kernel reference count. ๐งฎCL_KERNEL_CONTEXTโ return typecl_contextโ returns the context associated with kernel. ๐CL_KERNEL_PROGRAMโ return typecl_programโ returns the program object associated with kernel. ๐ฆCL_KERNEL_ATTRIBUTESโ return typechar[]โ returns any attributes specified using the__attribute(3clc)__qualifier with the kernel function declaration in the program source. these attributes include those on the__attribute(3clc)__page and other attributes supported by an implementation.
attributes are returned as they were declared inside __attribute(3clc)__((...)), with any surrounding whitespace and embedded newlines removed. when multiple attributes are present, they are returned as a single, space delimited string. ๐งผ (clean, tidy, no messy whitespace โ we love that for us)
param_value_size_retโ the actual size in bytes of data copied toparam_value. ifparam_value_size_retisNULL, it is ignored. again: ghosted. ๐ป
๐ ERRORS ๐
returns CL_SUCCESS if the function is executed successfully. otherwise, it returns one of the following errors:
CL_INVALID_VALUEifparam_nameis not valid, or if size in bytes specified byparam_value_sizeis< size of return typeas described in the table above andparam_valueis notNULL.CL_INVALID_KERNELifkernelis 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.
bestie if you get CL_INVALID_KERNEL that kernel is not real, it's not passing the vibe check, do not proceed. ๐ญ
๐ SPECIFICATION ๐
OpenCL Specification[1]
๐ SEE ALSO ๐
clCreateKernel(3clc), clCreateKernelsInProgram(3clc), clGetKernelArgInfo(3clc), clRetainKernel(3clc), clReleaseKernel(3clc), clSetKernelArg(3clc), clGetKernelWorkGroupInfo(3clc)
the whole friend group honestly ๐ซถ go read them too.
๐ AUTHORS ๐
The Khronos Group
๐ COPYRIGHT ๐
Copyright ยฉ 2007-2011 The Khronos Group Inc.
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.
๐ NOTES ๐
- OpenCL Specification โ page 162, section 5.7.3 - Kernel Object Queries (updated for 1.2 rev 14)
and that's the whole page, bestie!! ๐ brought to you by The Khronos Group, dated 01/14/2021 โ go forth and query those kernels, you absolute icon, periodt ๐ โจ
๐ฆ where this page comes from
- ubuntu jammy: opencl-1.2-man-doc 1.0~svn33624-5 ยท other
- ubuntu noble: opencl-1.2-man-doc 1.0~svn33624-5 ยท other
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms