<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLComputePipelineState/threadExecutionWidth",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLComputePipelineState(py)threadExecutionWidth"
  },
  "title" : "threadExecutionWidth"
}
-->

# threadExecutionWidth

The number of threads that the GPU executes simultaneously.

```
var threadExecutionWidth: Int { get }
```

## Discussion

For better performance, when dispatching a compute command, make the number of threads in the threadgroup a multiple of `threadExecutionWidth`.

See [Creating threads and threadgroups](/documentation/Metal/creating-threads-and-threadgroups) and [Calculating threadgroup and grid sizes](/documentation/Metal/calculating-threadgroup-and-grid-sizes) for more information on aligning data, thread width, and threadgroup size.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)