---
title: cpuAndGPU
framework: coreml
role: symbol
role_heading: Type Property
path: coreml/mlcomputepolicy/cpuandgpu
---

# cpuAndGPU

Execute ML workloads using the GPU if available, otherwise falling back to the CPU.

## Declaration

```swift
static var cpuAndGPU: MLComputePolicy { get }
```

## See Also

### Compute policies

- [cpuOnly](coreml/mlcomputepolicy/cpuonly.md)
