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

# device

The device object that created the resource.

## Declaration

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

## Discussion

Discussion A resource can only be used with the MTLDevice that created it.

## See Also

### Related Documentation

- [Metal Shading Language Guide](apple-archive/documentation/Metal/Reference/MetalShadingLanguageGuide/Introduction.md)
- [Metal Programming Guide](apple-archive/documentation/Miscellaneous/Conceptual/MetalProgrammingGuide/Introduction.md)

### Identifying the resource

- [label](metal/mtlresource/label.md)
