---
title: "ATOMIC_INTRINSICS: constant in Backends, TypeShade API"
description: "ATOMIC_INTRINSICS, a constant in Backends. The atomic builtins, with the arity and result of each: atomicLoad takes the location alone and returns its value…"
url: https://typeshade.dev/api/atomicintrinsics/
language: en
---

# `ATOMIC_INTRINSICS`

Constant in Backends

The atomic builtins, with the arity and result of each: `atomicLoad` takes the location alone and returns its value; `atomicStore` takes a value and returns nothing; the eight read-modify-write forms take a value and return the value the location held before the update.

`import { ATOMIC_INTRINSICS } from 'typeshade'`

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

## Syntax

```ts
const ATOMIC_INTRINSICS: Readonly<Record<string, { readonly arity: 1 | 2 | 3; readonly returns: "value" | "void" | "casResult"; }>>
```

## Description

Every one takes its first argument as a location (`xs[i]`, a storage struct field, a bare atomic binding), which WGSL spells as a pointer, `&xs[i]`, and which the CPU backends resolve once and write back through. The GLSL lowering of an atomic is not supported yet ([Rule 10.5](https://typeshade.dev/reference/rules/10-5/)); a `@compute` entry that reaches no texture runs the atomics other than `atomicCompareExchangeWeak` on WebGL2 as its pass program ([Rule 11.8](https://typeshade.dev/reference/rules/11-8/)).

## Source

[`src/core/intrinsics.ts`, line 93](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/intrinsics.ts#L93), at commit af54ddad5
