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

triton.experimental.gluon.language.amd.rdna4.buffer.make_buffer_descriptor(base, num_records, _semantic=None) → buffer_descriptor

Make a buffer resource descriptor from the hardware fields the program controls.

Accesses through the descriptor address base + soffset + offsets[i]. The hardware checks every access against num_records, counting soffset: in bytes from base, an access is in bounds only if soffset + offset + size <= num_records. Out-of-bounds loads return zero and out-of-bounds stores are dropped, so num_records=0 disables every access.

The check applies per hardware access, and accesses wider than 4 bytes are checked in 4-byte pieces. For elements of 4 bytes or more with a num_records that is a multiple of the element size, it is exact per element. Otherwise, elements sharing an access or a 4-byte piece with out-of-bounds bytes are out of bounds too, and an element wider than 4 bytes can be partly in bounds.

The descriptor is as aligned as base: use multiple_of() on base to let accesses through it vectorize when the compiler can’t prove the alignment.

Parameters:
  • base (pointer to scalar) – Global memory base pointer. Its pointee type is the element type of the descriptor; offsets count these elements.

  • num_records (int32 or uint32 scalar) – Bytes accessible from base, read as an unsigned 32-bit value: up to 2**32 - 1.

Returns:

the descriptor.

Return type:

buffer_descriptor