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)program-
Specifies the program object being queried.
device-
Specifies the device for which build information is being queried.
devicemust be a valid device associated withprogram. param_name-
Specifies the information to query. The list of supported
param_nametypes and the information returned inparam_valuebyclGetProgramBuildInfois described in the table below.cl_program_build_info Return Type and Info. returned in param_valueCL_PROGRAM_BUILD_STATUSReturn type: cl_build_status
Returns the build, compile or link status, whichever was performed last on
programfordevice.This can be one of the following:
CL_BUILD_NONE. The build status returned if noclBuildProgram,clCompileProgramorclLinkProgramhas been performed on the specified program object fordevice.CL_BUILD_ERROR. The build status returned ifclBuildProgram,clCompileProgramorclLinkProgramwhichever was performed last on the specified program object fordevicegenerated an error.CL_BUILD_SUCCESS. The build status returned ifclBuildProgram,clCompileProgramorclLinkProgramwhichever was performed last on the specified program object fordevicewas successful.CL_BUILD_IN_PROGRESS. The build status returned ifclBuildProgram,clCompileProgramorclLinkProgramwhichever was performed last on the specified program object fordevicehas not finished.CL_PROGRAM_BUILD_OPTIONSReturn type: char[]
Return the build, compile or link options specified by the
optionsargument inclBuildProgram,clCompileProgramorclLinkProgram, whichever was performed last onprogramfordevice.If build status of
programfordeviceisCL_BUILD_NONE, an empty string is returned.CL_PROGRAM_BUILD_LOGReturn type: char[]
Return the build, compile or link log for
clBuildProgramorclCompileProgramwhichever was performed last onprogramfordevice.If build status of
programfordeviceisCL_BUILD_NONE, an empty string is returned.CL_PROGRAM_BINARY_TYPEReturn 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 withdevice.CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT. A compiled binary is associated withdevice. This is the case ifprogramwas created usingclCreateProgramWithSourceand compiled usingclCompileProgramor a compiled binary is loaded usingclCreateProgramWithBinary.CL_PROGRAM_BINARY_TYPE_LIBRARY. A library binary is associated withdevice. This is the case ifprogramwas created byclLinkProgramwhich is called with the–create-librarylink option or if a library binary is loaded usingclCreateProgramWithBinary.CL_PROGRAM_BINARY_TYPE_EXECUTABLE. An executable binary is associated withdevice. This is the case ifprogramwas created byclLinkProgramwithout the–create-librarylink option or program was created byclBuildProgramor an executable binary is loaded usingclCreateProgramWithBinary.CL_PROGRAM_BINARY_TYPE_INTERMEDIATE. (Applies if extensioncl_khr_spiris enabled.) An intermediate (non-source) representation for the program is loaded as a binary. The program must be further processed withclCompileProgramorclBuildProgram. If processed withclCompileProgram, the result will be a binary of typeCL_PROGRAM_BINARY_TYPE_COMPILED_OBJECTorCL_PROGRAM_BINARY_TYPE_LIBRARY. If processed withclBuildProgram, the result will be a binary of typeCL_PROGRAM_BINARY_TYPE_EXECUTABLE.CL_PROGRAM_BUILD_GLOBAL_- VARIABLE_TOTAL_SIZEReturn 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_valueis 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. Ifparam_value_size_retis NULL, it is ignored.
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.
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. -
Returns
CL_INVALID_VALUEifparam_nameis not valid, or if size in bytes specified byparam_value_sizeis < size of return type as described in the table above andparam_valueis not NULL. -
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.