CLGETKERNELINFO(3clc)

๐Ÿ“ฆ
version 1.0~svn33624 ยท 3 versions
, in ubuntu jammy, ubuntu noble

๐Ÿ’– 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 supported param_name types and what actually comes back in param_value is right below in the table. slay. ๐Ÿ’…
  • param_value โ€” a pointer to memory where the result you asked for gets dropped off. if param_value is NULL, it is ignored. ghosted. ๐Ÿ™ˆ
  • param_value_size โ€” how big, in bytes, the memory pointed to by param_value is. 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 type char[] โ€” returns the kernel function name. โœจ
  • CL_KERNEL_NUM_ARGS โ€” return type cl_uint โ€” returns the number of arguments to kernel. ๐Ÿ”ข
  • CL_KERNEL_REFERENCE_COUNT โ€” return type cl_uint โ€” returns the kernel reference count. ๐Ÿงฎ
  • CL_KERNEL_CONTEXT โ€” return type cl_context โ€” returns the context associated with kernel. ๐ŸŒˆ
  • CL_KERNEL_PROGRAM โ€” return type cl_program โ€” returns the program object associated with kernel. ๐Ÿ“ฆ
  • CL_KERNEL_ATTRIBUTES โ€” return type char[] โ€” 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 to param_value. if param_value_size_ret is NULL, 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_VALUE if param_name is not valid, or if size in bytes specified by param_value_size is < size of return type as described in the table above and param_value is not NULL.
  • CL_INVALID_KERNEL if kernel is not a valid kernel object.
  • CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
  • CL_OUT_OF_HOST_MEMORY if 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 ยฉ 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 ๐Ÿ“

  1. 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