<!--
{
  "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/maxTotalThreadsPerThreadgroup",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLComputePipelineState(py)maxTotalThreadsPerThreadgroup"
  },
  "title" : "maxTotalThreadsPerThreadgroup"
}
-->

# maxTotalThreadsPerThreadgroup

The maximum number of threads in a threadgroup that you can dispatch to the pipeline.

```
var maxTotalThreadsPerThreadgroup: Int { get }
```

## Discussion

When you create a compute pipeline state, it calculates the maximum number of threads available on the device. This value never changes, but may be different for different pipeline objects.

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)