---
name: "clGetProgramBuildInfo"
section: "3clc"
platform: "linux"
package: "opencl-1.2-man-doc"
version: "1.0~svn33624-5.1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/clGetProgramBuildInfo"
---

# clGetProgramBuildInfo(3clc)

Returns build information for each device in the program object.

## NAME

clGetProgramBuildInfo - Returns build information for each device in the program object.

##

**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 table below.

| | |
| --- | --- |
| **cl\_program\_buid\_info** | **Return Type and Info. returned in *param\_value*** |
| **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 no [**clBuildProgram**(3clc)](/clBuildProgram/3clc.md), [**clCompileProgram**(3clc)](/clCompileProgram/3clc.md) or [**clLinkProgram**(3clc)](/clLinkProgram/3clc.md) has been performed on the specified program object for *device*. **CL\_BUILD\_ERROR**. The build status returned if [**clBuildProgram**(3clc)](/clBuildProgram/3clc.md), [**clCompileProgram**(3clc)](/clCompileProgram/3clc.md) or [**clLinkProgram**(3clc)](/clLinkProgram/3clc.md) whichever was performed last on the specified program object for device generated an error. **CL\_BUILD\_SUCCESS**. The build status returned if [**clBuildProgram**(3clc)](/clBuildProgram/3clc.md), [**clCompileProgram**(3clc)](/clCompileProgram/3clc.md) or [**clLinkProgram**(3clc)](/clLinkProgram/3clc.md) whichever was performed last on the specified program object for *device* was successful. **CL\_BUILD\_IN\_PROGRESS**. The build status returned if [**clBuildProgram**(3clc)](/clBuildProgram/3clc.md), [**clCompileProgram**(3clc)](/clCompileProgram/3clc.md) or [**clLinkProgram**(3clc)](/clLinkProgram/3clc.md) 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)](/clBuildProgram/3clc.md), [**clCompileProgram**(3clc)](/clCompileProgram/3clc.md) or [**clLinkProgram**(3clc)](/clLinkProgram/3clc.md), 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)](/clBuildProgram/3clc.md), [**clCompileProgram**(3clc)](/clCompileProgram/3clc.md) or [**clLinkProgram**(3clc)](/clLinkProgram/3clc.md) 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 using [**clCreateProgramWithSource**(3clc)](/clCreateProgramWithSource/3clc.md) and compiled using [**clCompileProgram**(3clc)](/clCompileProgram/3clc.md) or a compiled binary is loaded using [**clCreateProgramWithBinary**(3clc)](/clCreateProgramWithBinary/3clc.md). **CL\_PROGRAM\_BINARY\_TYPE\_LIBRARY**. A library binary is associated with *device*. This is the case if program was created by [**clLinkProgram**(3clc)](/clLinkProgram/3clc.md) which is called with the –createlibrary link option or if a library binary is loaded using [**clCreateProgramWithBinary**(3clc)](/clCreateProgramWithBinary/3clc.md). **CL\_PROGRAM\_BINARY\_TYPE\_EXECUTABLE**. An executable binary is associated with *device*. This is the case if program was created by [**clLinkProgram**(3clc)](/clLinkProgram/3clc.md) without the –createlibrary link option or program was created by [**clBuildProgram**(3clc)](/clBuildProgram/3clc.md) or an executable binary is loaded using [**clCreateProgramWithBinary**(3clc)](/clCreateProgramWithBinary/3clc.md). |

*param\_value*

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 ≥ size of return type as described in the table above.

*param\_value\_size\_ret*

Returns the actual size in bytes of data copied to *param\_value*. If *param\_value\_size\_ret* is NULL, 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. 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**(3clc)](/clCreateProgramWithBinary/3clc.md) or queried using [**clGetProgramInfo**(3clc)](/clGetProgramInfo/3clc.md) 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.

## ERRORS

Returns CL\_SUCCESS if the function is executed successfully. Otherwise it returns the following:

•

Returns CL\_INVALID\_DEVICE if *device* is not in the list of devices associated with *program*.

•

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

•

Returns CL\_INVALID\_PROGRAM if *program* is a not a valid program 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.

## SPECIFICATION

**OpenCL Specification**\[1\]

## SEE ALSO

[**clGetProgramInfo**(3clc)](/clGetProgramInfo/3clc.md)

## 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

- 1\.

  OpenCL Specification

  page 153, section 5.6.7 - Program Object Queries
