Skip to main content

Module buffer

Module buffer 

Source
Expand description

Compact buffers: owned items of one element type, borrowed views of them, and the DType that names each. Booleans take one byte each. Integers come in four widths, floats in three and complex numbers in two, named by the width of their parts. Source reads an item of one element type as another.

Structs§

Fill
A fill that a call chooses: the item that a read gives at each position that reaches no item, as one native item, checked at the dtype that reads it. A read with no chosen fill gives its dtype’s Element::FILL. A frontend’s own storage, such as basedpl’s nested arrays, keeps its fills in the frontend.
Output
Scratch
Conversion buffers retained for one execution, by computing dtype and operand position.

Enums§

Buffer
Items of one element type.
ComplexBuf
ComplexWidth
Complexes
DType
The element type of a compact buffer. Numbers widen from Boolean through the integer widths to the float widths to the complex widths.
FloatBuf
FloatWidth
Floats
IntBuf
Ints
Items
Compact items at one dtype, borrowed or prepared by gathering and conversion.
MapOutput
Where a map appends: an owned buffer or the next slots of a caller’s result.
View
A buffer’s items, borrowed in their element type.
Width

Traits§

Cast
Convert stored items using the destination dtype’s checked conversion.
Element
An element type of compact buffers: bool, the integer widths u8, i16, i32 and i64, the float widths half::f16, f32 and f64, Complex32 and Complex64, and char.
OutputItem
Source
An item that reads as type A: a Boolean as a number, an integer as a wider integer, a float or a complex number, a float as a float of another width or a complex number, and a complex number as one of the other width.

Functions§

read_all
Every item of items, read as type A, through the same scheduler as native elementwise calls.