---
title: "init(threadgroupsPerGrid:)"
framework: metal
role: symbol
role_heading: Initializer
path: "metal/mtldispatchthreadgroupsindirectarguments/init(threadgroupspergrid:)"
---

# init(threadgroupsPerGrid:)

Returns a new data layout for dispatching threadgroups over indirect buffer calls, with specified threadgroups per grid.

## Declaration

```swift
init(threadgroupsPerGrid: (UInt32, UInt32, UInt32))
```

## Parameters

- `threadgroupsPerGrid`: The number of threadgroups for the grid, in each dimension.

## See Also

### Specifying the size of the threadgroup

- [init()](metal/mtldispatchthreadgroupsindirectarguments/init().md)
- [threadgroupsPerGrid](metal/mtldispatchthreadgroupsindirectarguments/threadgroupspergrid.md)
