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

# device

The device object that created the heap.

## Declaration

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

## Discussion

Discussion A heap is always associated with the MTLDevice that created it and can be used only with that device.

## See Also

### Checking a heap’s permanent configuration

- [type](metal/mtlheap/type.md)
- [storageMode](metal/mtlheap/storagemode.md)
- [cpuCacheMode](metal/mtlheap/cpucachemode.md)
- [hazardTrackingMode](metal/mtlheap/hazardtrackingmode.md)
- [resourceOptions](metal/mtlheap/resourceoptions.md)
