---
title: "computeDevice(for:)"
framework: vision
role: symbol
role_heading: Instance Method
path: "vision/vnrequest/computedevice(for:)"
---

# computeDevice(for:)

Returns the compute device for a compute stage.

## Declaration

```swift
@nonobjc func computeDevice(for computeStage: VNComputeStage) -> MLComputeDevice?
```

## Parameters

- `computeStage`: The compute stage to inspect.

## Return Value

Return Value The current compute device; otherwise, nil if one isn’t assigned.

## See Also

### Configuring the Compute Device

- [setComputeDevice(_:for:)](vision/vnrequest/setcomputedevice(_:for:).md)
- [supportedComputeStageDevices](vision/vnrequest/supportedcomputestagedevices.md)
