---
title: device
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtl4commandallocator/device
---

# device

Returns the GPU device that this command allocator belongs to.

## Declaration

```swift
var device: any MTLDevice { get }
```
