---
title: cpu()
framework: ML Compute
role: symbol
role_heading: Type Method
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: mlcompute/mlcdevice/cpu()
---

# cpu()

Creates a device that uses the CPU.

## Declaration

```swift
class func cpu() -> Self
```

## Return Value

Return Value A device that uses the CPU.

## See Also

### Creating Devices

- [init(type:)](mlcompute/mlcdevice/init(type:).md)
- [init(type:selectsMultipleComputeDevices:)](mlcompute/mlcdevice/init(type:selectsmultiplecomputedevices:).md)
- [MLCDeviceType](mlcompute/mlcdevicetype.md)
- [init(gpuDevices:)](mlcompute/mlcdevice/init(gpudevices:)-4mj85.md)
- [gpu()](mlcompute/mlcdevice/gpu().md)
- [ane()](mlcompute/mlcdevice/ane().md)
