triton.experimental.gluon.language.amd.cdna3.buffer.make_buffer_descriptor
- triton.experimental.gluon.language.amd.cdna3.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 againstnum_records, countingsoffset: in bytes frombase, an access is in bounds only ifsoffset + offset + size <= num_records. Out-of-bounds loads return zero and out-of-bounds stores are dropped, sonum_records=0disables 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_recordsthat 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: usemultiple_of()onbaseto 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: