---
title: "workgroupSizeOf(): function in IR, TypeShade API reference"
description: "workgroupSizeOf, a function in IR. The x workgroup size of a compute entry: the structured workgroupSize field first…"
url: https://typeshade.dev/api/workgroupsizeof/
language: en
---

# `workgroupSizeOf()`

Function in IR

The x workgroup size of a compute entry: the structured workgroupSize field first, then the `@workgroup_size(n)` attribute string; undefined when neither is present.

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

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

## Syntax

```ts
const workgroupSizeOf: (
  f: Pick<FuncDecl, "workgroupSize" | "attrs">,
) => number | undefined
```

## Parameters

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

## Return value

`number | undefined`

## Description

A two- or three-dimensional workgroup has more invocations than this; read [`workgroupShapeOf`](https://typeshade.dev/api/workgroupshapeof/) for the grid.

## See also

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

## Source

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