CL_PROGRAM_BINARY_TYPE_LIBRARY. A
library binary is associated
with device.
This is the case if program was created by
clLinkProgram
which is called with the –create-library link
option or if a library binary is loaded using
clCreateProgramWithBinary.

CL_PROGRAM_BINARY_TYPE_EXECUTABLE.
An executable binary is associated
with device.
This is the case if program was created by
clLinkProgram
without the –create-library
link option or program was created by
clBuildProgram
or an executable binary is loaded using
clCreateProgramWithBinary.

CL_PROGRAM_BINARY_TYPE_INTERMEDIATE.
An intermediate (non-source) representation for
the program is loaded as a binary. The program
must be further processed with
clCompileProgram
or clBuildProgram.
If processed with
clCompileProgram,
the result
will be a binary of type
CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT or
CL_PROGRAM_BINARY_TYPE_LIBRARY. If
processed with
clBuildProgram,
the result will be
a binary of type CL_PROGRAM_BINARY_TYPE_EXECUTABLE.

CL_PROGRAM_BUILD_GLOBAL_-
VARIABLE_TOTAL_SIZE

Return type: size_t

The total amount of storage, in bytes, used by
program variables in the global address space.

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

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.