---
name: "clCreateProgramWithBuiltInKernels"
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/clCreateProgramWithBuiltInKernels"
---

# clCreateProgramWithBuiltInKernels(3clc)

Creates a program object for a context, and loads the information related to the built-in kernels into a program object.

## NAME

clCreateProgramWithBuiltInKernels - Creates a program object for a context, and loads the information related to the built-in kernels into a program object.

##

**cl\_program clCreateProgramWithBuiltInKernels(cl\_context** *context***, cl\_uint** *num\_devices***, const cl\_device\_id \****device\_list***, const char \****kernel\_names***, cl\_int \****errcode\_ret***);**

## PARAMETERS

 *context*

Must be a valid OpenCL context.

 *num\_devices*

The number of devices listed in *device\_list*.

 *device\_list*

A pointer to a list of devices that are in *context*. *device\_list* must be a non-NULL value. The built-in kernels are loaded for devices specified in this list.

The devices associated with the program object will be the list of devices specified by *device\_list*. The list of devices specified by *device\_list* must be devices associated with context.

 *kernel\_names*

A semi-colon separated list of built-in kernel names.

## ERRORS

Returns a valid non-zero program object and *errcode\_ret* is set to CL\_SUCCESS if the program object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in *errcode\_ret*:

• CL\_INVALID\_CONTEXT if *context* is not a valid context.

• CL\_INVALID\_VALUE if *device\_list* is NULL or *num\_devices* is zero;

• CL\_INVALID\_VALUE if *kernel\_names* is NULL or *kernel\_names* contains a kernel name that is not supported by any of the devices in *device\_list*.

• CL\_INVALID\_DEVICE if devices listed in *device\_list* are not in the list of devices associated with *context*.

• 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

[**clCreateProgramWithSource**(3clc)](/clCreateProgramWithSource/3clc.md), [**clReleaseProgram**(3clc)](/clReleaseProgram/3clc.md), [**clRetainProgram**(3clc)](/clRetainProgram/3clc.md), [**classDiagram**(3clc)](/classDiagram/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 135, section 5.6.1 - Creating Program Objects
