liveBook · Manning

Tl.store

As explained in GPU Programming with Triton

tl.store is Triton's operation for storing values to memory through pointer expressions, with optional per-element masking.

`tl.store` writes computed values from on-chip registers to global memory. A pointer expression identifies each destination; an optional mask limits writes to valid positions, protecting array boundaries. section 2.2.7

Masked vector output

In vector addition, each program writes its result slice with `tl.store(z_ptr + offsets, z, mask=mask)`. For incomplete matrix tiles, a store mask prevents writes beyond the output bounds. section 2.2.7 section 5.8.1

tl.store(z_ptr + offsets, z, mask=mask)

See the masked store expression used to write the vector-addition results. section 2.2.7

How GPU Programming with Triton covers it

How deep it goes
Explains pointer-based writes and masked edge handling in vector and matrix kernels, without detailing instruction-level store lowering.
Examples
Uses masked stores for vector-add results and to keep incomplete matrix tiles within output bounds.
What you can do after
Apply it via Triton to write computed vector or tile values while avoiding out-of-range output positions.
How it connects
Pairs with tl.load, offsets, masks, global memory, and GPU program instances.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of GPU Programming with Triton. The section links point to the parts of the book it draws on.