C Specification
To return build information for each device in the program object, call the function
// Provided by CL_VERSION_1_0
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);
Parameters
- 
program specifies the program object being queried.
 - 
device specifies the device for which build information is being queried. device must be a valid device associated with program.
 - 
param_name specifies the information to query. The list of supported param_name types and the information returned in param_value by clGetProgramBuildInfo is described in the Program Build 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 Program Build 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
| Program Build Info | Return Type | Description | 
|---|---|---|
  | 
  | 
Returns the build, compile or link status, whichever was performed last on the specified program object for device. This can be one of the following:                                      | 
  | 
  | 
Return the build, compile or link options specified by the options argument in clBuildProgram, clCompileProgram or clLinkProgram, whichever was performed last on the specified program object for device.         If build status of the specified program for device is
          | 
  | 
  | 
Return the build, compile or link log for clBuildProgram, clCompileProgram or clLinkProgram, whichever was performed last on program for device.         If build status of the specified program for device is
          | 
 missing before version 1.2.  | 
  | 
Return the program binary type for device. This can be one of the following values:                                                      If processed with clCompileProgram, the result will be a binary of
        type   | 
 missing before version 2.0.  | 
  | 
The total amount of storage, in bytes, used by program variables in the global address space.  | 
clGetProgramBuildInfo returns CL_SUCCESS if the function is executed
successfully.
Otherwise, it returns one of the following errors:
- 
CL_INVALID_if program is a not a valid program object.PROGRAM  - 
CL_INVALID_if device is not in the list of devices associated with program.DEVICE  - 
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 Program Build Queries table and param_value is notVALUE NULL. - 
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  
| 
 A program binary (compiled binary, library binary or executable binary) built for a parent device can be used by all its sub-devices. If a program binary has not been built for a sub-device, the program binary associated with the parent device will be used. A program binary for a device specified with clCreateProgramWithBinary or queried using clGetProgramInfo 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.  | 
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.