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

# device

The device object that created the shader function.

## Declaration

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

## Discussion

Discussion You can only use this function object with this MTLDevice.

## 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 shader functions

- [label](metal/mtlfunction/label.md)
- [functionType](metal/mtlfunction/functiontype.md)
- [name](metal/mtlfunction/name.md)
- [MTLFunctionType](metal/mtlfunctiontype.md)
- [options](metal/mtlfunction/options.md)
- [MTLFunctionOptions](metal/mtlfunctionoptions.md)
