CLGETPROGRAMBUILDINF(3clc)
β¨ CLGETPROGRAMBUILDINF β¨
okay bestie, welcome to the OpenCL Manual π this one lives in section 3clc, and it's literally the vibe check for your build info. iykyk π«Ά
πΈ NAME πΈ
clGetProgramBuildInfo β it hands you back the build information for each device in the program object. yes, each device, not just one, we love a multitasker π
cl_int clGetProgramBuildInfo(cl_program program, cl_device_id device,
cl_program_build_info param_name,
size_t param_value_size, void *param_value,
size_t *param_value_size_ret);
like, that's the whole signature, copy it exactly, no cap π
π¦ PARAMETERS π¦
programβ Specifies the program object being queried. that's the lil guy you're asking all your questions about πdeviceβ Specifies the device for which build information is being queried. and listen βdevicemust be a valid device associated withprogram. not some random device you found in the group chat, it has to actually belong to the program or it's giving π π
okay so param_name is literally you going "hey bestie, which lil fact do you want me to pull up for you?" β¨ And param_value is where that fact lands. The full list of supported param_name types and the info returned in param_value by clGetProgramBuildInfo is right here:
real talk: the header row of this table in the source docs says cl_program_buid_info (not a drill, the typo is canon π). Anyway β the menu:
π CL_PROGRAM_BUILD_STATUS
Return type: cl_build_status
Returns the build, compile or link status, whichever was performed last on program for device.
This can be one of the following:
CL_BUILD_NONEβ the build status returned if noclBuildProgram(3clc),clCompileProgram(3clc)orclLinkProgram(3clc)has been performed on the specified program object for device.CL_BUILD_ERRORβ the build status returned ifclBuildProgram(3clc),clCompileProgram(3clc)orclLinkProgram(3clc)whichever was performed last on the specified program object for device generated an error.CL_BUILD_SUCCESSβ the build status returned ifclBuildProgram(3clc),clCompileProgram(3clc)orclLinkProgram(3clc)whichever was performed last on the specified program object for device was successful.CL_BUILD_IN_PROGRESSβ the build status returned ifclBuildProgram(3clc),clCompileProgram(3clc)orclLinkProgram(3clc)whichever was performed last on the specified program object for device has not finished.
πΈ CL_PROGRAM_BUILD_OPTIONS
Return type: char[]
Return the build, compile or link options specified by the options argument in clBuildProgram(3clc), clCompileProgram(3clc) or clLinkProgram(3clc), whichever was performed last on program for device.
If build status of program for device is CL_BUILD_NONE, an empty string is returned.
π¦ CL_PROGRAM_BUILD_LOG
Return type: char[]
Return the build, compile or link log for clBuildProgram(3clc), clCompileProgram(3clc) or clLinkProgram(3clc) whichever was performed last on program for device.
If build status of program for device is CL_BUILD_NONE, an empty string is returned.
π CL_PROGRAM_BINARY_TYPE
Return type: cl_program_binary_type
Return the program binary type for device. This can be one of the following values:
CL_PROGRAM_BINARY_TYPE_NONEβ there is no binary associated with device.CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECTβ a compiled binary is associated with device. This is the case if program was created usingclCreateProgramWithSource(3clc)and compiled usingclCompileProgram(3clc)or a compiled binary is loaded usingclCreateProgramWithBinary(3clc).CL_PROGRAM_BINARY_TYPE_LIBRARYβ a library binary is associated with device. This is the case if program was created byclLinkProgram(3clc)which is called with theβcreatelibrarylink option or if a library binary is loaded usingclCreateProgramWithBinary(3clc).CL_PROGRAM_BINARY_TYPE_EXECUTABLEβ an executable binary is associated with device.
...and that last row of the table? It's the one that tells you when the program's binary type is what it is:
- This is the case if
programwas created byclLinkProgram(3clc)without theβcreatelibrarylink option orprogramwas created byclBuildProgram(3clc)or an executable binary is loaded usingclCreateProgramWithBinary(3clc).
okay and now the three little parameter besties that every query hands you, one by one:
param_valueβ a pointer to memory where the appropriate result being queried gets returned. Ifparam_valueisNULL, bestie, it's just ignored. π«₯param_value_sizeβ specifies the size in bytes of the memory thatparam_valuepoints to. This size must be β₯ size of return type as described in the table above. No shrinking the cup, it needs to fit the whole drink. π₯€param_value_size_retβ returns the actual size in bytes of data copied toparam_value. Ifparam_value_size_retisNULL, it is ignored. π
β¨ NOTES β¨
A program binary (compiled binary, library binary or executable binary) built for a parent device can be used by all its sub-devices. And if a program binary has not been built for a sub-device? The program binary associated with the parent device will be used. it's giving "borrow your mom's card, she won't notice" energy π³
A program binary for a device specified with clCreateProgramWithBinary(3clc) or queried using clGetProgramInfo(3clc) can be used as the binary for the associated root device, and all sub-devices created from the root-level device or sub-devices thereof. the family tree is thriving π³
π ERRORS π
Returns CL_SUCCESS if the function is executed successfully. Otherwise it returns the following:
- Returns
CL_INVALID_DEVICEifdeviceis not in the list of devices associated withprogram. not your device, not your business. π« - Returns
CL_INVALID_VALUEifparam_nameis not valid, or if the size in bytes specified byparam_value_sizeis<size of return type as described in the table above andparam_valueis notNULL. - Returns
CL_INVALID_PROGRAMifprogramis a not a valid program 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.
π SPECIFICATION π
OpenCL Specification[1]
π SEE ALSO π
π«Ά 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 π
(yeah bestie, there are two NOTES sections on this page, that's not a typo, that's just how the manpage is built π )
- OpenCL Specification page 153, section 5.6.7 - Program Object Queries
and that's the whole page, start to finish π sourced from The Khronos Group, stamped 01/14/2021, living its life as CLGETPROGRAMBUILDINF(3clc) β go query some program build info, you absolute icon β¨π
π¦ 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