---
title: "setThreadgroupMemoryLength(_:at:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlindirectcomputecommand/setthreadgroupmemorylength(_:at:)"
---

# setThreadgroupMemoryLength(_:at:)

Sets the size of a block of threadgroup memory.

## Declaration

```swift
func setThreadgroupMemoryLength(_ length: Int, at index: Int)
```

## Parameters

- `length`: The size of the threadgroup memory, in bytes, which needs to be a multiple of 16 bytes.
- `index`: The index in the threadgroup memory argument table.

## See Also

### Setting a command’s arguments

- [setComputePipelineState(_:)](metal/mtlindirectcomputecommand/setcomputepipelinestate(_:).md)
- [setImageblockWidth(_:height:)](metal/mtlindirectcomputecommand/setimageblockwidth(_:height:).md)
- [setKernelBuffer(_:offset:at:)](metal/mtlindirectcomputecommand/setkernelbuffer(_:offset:at:).md)
- [setThreadgroupMemoryLength(_:index:)](metal/mtlindirectcomputecommand/setthreadgroupmemorylength(_:index:).md)
- [setStageInRegion(_:)](metal/mtlindirectcomputecommand/setstageinregion(_:).md)
- [setStageIn(_:)](metal/mtlindirectcomputecommand/setstagein(_:).md)
