---
title: "workgroupShapeOf(): function in IR, TypeShade API reference"
description: "workgroupShapeOf, a function in IR. The workgroup shape of a compute entry: the structured workgroupShape field first, then [workgroupSize, 1, 1]…"
url: https://typeshade.dev/api/workgroupshapeof/
language: en
---

# `workgroupShapeOf()`

Function in IR

The workgroup shape of a compute entry: the structured workgroupShape field first, then \[workgroupSize, 1, 1\], then the extents of the `@workgroup_size(x, y, z)` attribute string; undefined when none is present.

`import { workgroupShapeOf } from 'typeshade'`
`import { workgroupShapeOf } from 'typeshade/core/ir'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
const workgroupShapeOf: (
  f: Pick<FuncDecl, "workgroupSize" | "workgroupShape" | "attrs">,
) => WorkgroupShape | undefined
```

## Parameters

**`f` `Pick<FuncDecl, 'workgroupSize' | 'workgroupShape' | 'attrs'>`**

## Return value

`WorkgroupShape | undefined`

## Description

Every consumer that sizes a grid (the CPU dispatch, [`reflect`](https://typeshade.dev/api/reflect/), a runner) reads this, so the three extents have one source.

## See also

- [`reflect`](https://typeshade.dev/api/reflect/)

## Source

[`src/core/ir/nodes.ts`, line 627](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/nodes.ts#L627), at commit af54ddad5
