---
title: computeFunction
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlcomputepipelinedescriptor/computefunction
---

# computeFunction

The compute kernel the pipeline calls.

## Declaration

```swift
var computeFunction: (any MTLFunction)? { get set }
```

## Discussion

Discussion warning: Ensure that this value is non-nil before creating a new MTLComputePipelineState with the associated pipeline descriptor instance. The default value is nil.

## See Also

### Configuring the compute execution environment

- [threadGroupSizeIsMultipleOfThreadExecutionWidth](metal/mtlcomputepipelinedescriptor/threadgroupsizeismultipleofthreadexecutionwidth.md)
- [maxTotalThreadsPerThreadgroup](metal/mtlcomputepipelinedescriptor/maxtotalthreadsperthreadgroup.md)
- [maxCallStackDepth](metal/mtlcomputepipelinedescriptor/maxcallstackdepth.md)
