An abstract representation of the GPU that serves as the primary interface for a Metal app.
- iOS 8.0+
- macOS 10.11+
- tvOS 9.0+
MTLDevice protocol defines the interface to a GPU. You use a specific device to query the features of the GPU and allocate Metal objects for your app.
You create many Metal objects, such as command queues, libraries, pipelines, and resources, from your device. Device-created objects are expensive but persistent; you can initialize them once and reuse them often, instead of creating new objects at the beginning of every render or compute loop (or any other performance-sensitive code). After you create an object from your device, that object can be used only with that device.