---
title: maxTotalThreadsPerThreadgroup
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlcomputepipelinestate/maxtotalthreadsperthreadgroup
---

# maxTotalThreadsPerThreadgroup

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

## Declaration

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

## Mentioned in

Calculating threadgroup and grid sizes

## Discussion

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 and Calculating threadgroup and grid sizes for more information on aligning data, thread width, and threadgroup size.

## See Also

### Checking threadgroup attributes

- [threadExecutionWidth](metal/mtlcomputepipelinestate/threadexecutionwidth.md)
- [staticThreadgroupMemoryLength](metal/mtlcomputepipelinestate/staticthreadgroupmemorylength.md)
