---
title: MLComputeUnits
framework: coreml
role: symbol
role_heading: Enumeration
path: coreml/mlcomputeunits
---

# MLComputeUnits

The set of processing-unit configurations the model can use to make predictions.

## Declaration

```swift
enum MLComputeUnits
```

## Overview

Overview Use this enumeration to set or inspect the processing units you allow a model to use when it makes a prediction. Use all to allow the OS to select the best processing unit to use (including the neural engine, if available). Use MLComputeUnits.cpuOnly to restrict the model to the CPU, if your app might run in the background or runs other GPU intensive tasks.

## Topics

### Processing Unit Configurations

- [MLComputeUnits.all](coreml/mlcomputeunits/all.md)
- [MLComputeUnits.cpuOnly](coreml/mlcomputeunits/cpuonly.md)
- [MLComputeUnits.cpuAndGPU](coreml/mlcomputeunits/cpuandgpu.md)
- [MLComputeUnits.cpuAndNeuralEngine](coreml/mlcomputeunits/cpuandneuralengine.md)

### Creating compute units

- [init(rawValue:)](coreml/mlcomputeunits/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Allowing access to processing units

- [computeUnits](coreml/mlmodelconfiguration/computeunits.md)
