triton.experimental.gluon.language.amd.rdna4.buffer.load

triton.experimental.gluon.language.amd.rdna4.buffer.load(desc, offsets, mask=None, other=None, *, soffset=None, scope=None, cache_policy=None, _semantic=None)

Load from global memory through a buffer descriptor into registers.

Element i is read from base + soffset + offsets[i]. Out-of-bounds elements read zero, and masked-off elements read other, or zero without it. See make_buffer_descriptor() for the bounds.

Parameters:
  • desc (buffer_descriptor) – Descriptor of the global memory to load from.

  • offsets (tensor) – Offsets of the elements to load, in elements.

  • mask (tensor, optional) – Mask tensor for predicated loads. Defaults to None.

  • other (tensor or scalar, optional) – Values for masked-off elements. Defaults to None.

  • scope (str, optional) – "cta", "gpu" or "sys". The load reads data visible at that scope. It is not atomic and orders no other memory operation; pair it with an acquire to consume a payload. To poll a flag, use atomic_load() instead, which the compiler never hoists. Defaults to None, the CU scope: the same as "cta" with wgp_cu_mode="cu", but narrower in the default WGP mode, where a workgroup can span the two CUs of a WGP.

  • soffset (int32 scalar or tensor, optional) – Offset, in elements, added to every element’s offset and counted by the bounds check. It is held in the instruction’s scalar offset register, so a uniform advance costs no per-lane arithmetic. A tensor gives each wave its own value: it broadcasts to offsets and must have size 1 in every dimension the lanes of the offsets’ layout span, e.g. shape [M, 1] for [M, N] offsets whose rows each sit in one wave. Defaults to None (0).

  • cache_policy (CachePolicy, optional) – Cache hints. Defaults to None.

Returns:

The loaded values, with the shape and layout of offsets.

Return type:

tensor