<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Vision",
  "identifier" : "/documentation/Vision/VisionRequest/computeDevice(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Vision"
    ],
    "preciseIdentifier" : "s:6Vision0A7RequestP13computeDevice3for6CoreML09MLComputeD0OSgAA12ComputeStageO_tF"
  },
  "title" : "computeDevice(for:)"
}
-->

# computeDevice(for:)

Returns the compute device for a compute stage.

```
func computeDevice(for computeStage: ComputeStage) -> MLComputeDevice?
```

## Parameters

`computeStage`

The compute stage to inspect.

## Return Value

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)