<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIKernel/kernels(withMetalString:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIKernel(cm)kernelsWithMetalString:error:"
  },
  "title" : "kernels(withMetalString:)"
}
-->

# kernels(withMetalString:)

Load kernels from a Metal language string.

```
class func kernels(withMetalString source: String) throws -> [CIKernel]
```

## Parameters

`source`

A string containing the progam in Metal language.

## Return Value

An array of [`CIKernel`](/documentation/CoreImage/CIKernel) objects.

## Discussion

---

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)