---
title: "kernels(withMetalString:)"
framework: coreimage
role: symbol
role_heading: Type Method
path: "coreimage/cikernel/kernels(withmetalstring:)"
---

# kernels(withMetalString:)

Load kernels from a Metal language string.

## Declaration

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

## Parameters

- `source`: A string containing the progam in Metal language.

## Return Value

Return Value An array of CIKernel objects.

## See Also

### Creating a Kernel Using Metal Shading Language

- [init(functionName:fromMetalLibraryData:)](coreimage/cikernel/init(functionname:frommetallibrarydata:).md)
- [init(functionName:fromMetalLibraryData:outputPixelFormat:)](coreimage/cikernel/init(functionname:frommetallibrarydata:outputpixelformat:).md)
- [kernelNames(fromMetalLibraryData:)](coreimage/cikernel/kernelnames(frommetallibrarydata:).md)
