Skip to main content

Module buffer_list

Module buffer_list 

Source
Expand description

Opaque list of buffer handles for multi-buffer tensors (ADR-030).

A tensor whose descriptor references more than one buffer — per-channel, NF4 or MXFP quantization, sparse layouts, block-paged, composite — needs all of its buffers to travel together. HurrayBufferList is that carrier: an ordered, owning collection of HurrayBuffer handles.

§Ownership

The list owns every handle pushed into it. hurray_buffer_list_get returns a borrowed pointer — the caller MUST NOT destroy it. hurray_buffer_list_destroy destroys every owned handle exactly once and then frees the list.

§Order

Element i of the list is the buffer at index i of the tensor descriptor’s buffer table (ADR-030 § 3). Buffer indices appearing in quantization descriptors (scale_buffer_index, zero_point_buffer_index), layout descriptors, and composite members therefore index this list directly.

Structs§

HurrayBufferList
Opaque handle to an ordered, owning list of HurrayBuffer handles.

Functions§

hurray_buffer_list_destroy⚠
Destroys *list and every HurrayBuffer it owns, then writes null through list.
hurray_buffer_list_get⚠
Borrows the HurrayBuffer at index.
hurray_buffer_list_len⚠
Reads the number of buffers in list.
hurray_buffer_list_new⚠
Creates an empty HurrayBufferList.
hurray_buffer_list_push⚠
Appends buffer to list, transferring ownership of the handle to the list.