<!--
{
  "availability" : [
    "iOS: 8.0.0 - 12.0.0",
    "iPadOS: 8.0.0 - 12.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.4.0 - 10.14.0",
    "tvOS: -",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIKernel/makeKernels(source:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIKernel(cm)kernelsWithString:"
  },
  "title" : "makeKernels(source:)"
}
-->

# makeKernels(source:)

Creates and returns and array of  `CIKernel` objects.

```
class func makeKernels(source string: String) -> [CIKernel]?
```

## Parameters

`string`

A program in the Core Image Kernel Language that contains one or more routines, each of which is marked using the `kernel` keyword.

## Return Value

An array of  `CIKernel` objects. The array contains one `CIKernel` objects for each kernel routine in the supplied string. Each object in the array can be of class [`CIKernel`](/documentation/CoreImage/CIKernel), [`CIColorKernel`](/documentation/CoreImage/CIColorKernel), or [`CIWarpKernel`](/documentation/CoreImage/CIWarpKernel) depending on the corresponding routine specified in the Core Image Kernel Language source code string.

## Discussion

The Core Image Kernel Language is a dialect of the OpenGL Shading Language. See [Core Image Kernel Language Reference](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CIKernelLangRef/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004397) and [Core Image Programming Guide](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/CoreImaging/ci_intro/ci_intro.html#//apple_ref/doc/uid/TP30001185) for more details.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)