<!--
{
  "availability" : [
    "iOS: 14.0.0 - 17.4.0",
    "iPadOS: 14.0.0 - 17.4.0",
    "macCatalyst: 14.0.0 - 17.4.0",
    "macOS: 11.0.0 - 14.3.0",
    "tvOS: 14.0.0 - 17.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCDevice",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCDevice"
  },
  "title" : "MLCDevice"
}
-->

# MLCDevice

An object that represents the CPU or one or more GPUs the framework uses to execute a neural network.

```
class MLCDevice
```

## Topics

### Creating Devices

[`init(type:)`](/documentation/MLCompute/MLCDevice/init(type:))

Creates a device of the type you specify.

[`init(type:selectsMultipleComputeDevices:)`](/documentation/MLCompute/MLCDevice/init(type:selectsMultipleComputeDevices:))

Creates a device that you can configure to use multiple compute devices.

[`MLCDeviceType`](/documentation/MLCompute/MLCDeviceType)

A device type for execution of a neural network.

[`init(gpuDevices:)`](/documentation/MLCompute/MLCDevice/init(gpuDevices:)-4mj85)

Creates a device using the GPUs you specify.

[`cpu()`](/documentation/MLCompute/MLCDevice/cpu())

Creates a device that uses the CPU.

[`gpu()`](/documentation/MLCompute/MLCDevice/gpu())

Creates a device that uses a GPU, if one exists.

[`ane()`](/documentation/MLCompute/MLCDevice/ane())

Creates a device that uses the Apple Neural Engine, if one exists.

### Inspecting Devices

[`type`](/documentation/MLCompute/MLCDevice/type)

The type you specify when creating the device.

[`actualDeviceType`](/documentation/MLCompute/MLCDevice/actualDeviceType)

The active device.

[`gpuDevices`](/documentation/MLCompute/MLCDevice/gpuDevices)

An array that contains the specific Metal devices you use to execute neural networks.



---

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)