Expand description
Rust code from the IR: a function of fixed-size arrays and scalars.
Values of one element are Rust scalars, other arrays are [T; N] in
row-major order (inputs by reference, results by value). Elementwise
operations call the scalar operations of ruxla-kernels (or the Rust
operators with the same semantics), so the results are those of the
interpreter. Data movement (broadcasts, slices, concatenation, gathers
and scatters with constant or single start indices, …) is compiled to
copies: the positions are found by evaluating the operation on arrays
of position codes (“probes”) at generation time. Operations without a
specialized emission call the interpreter on the equation.
Structs§
- Const
Pool - The constant arrays of generated functions, shared by the functions of a
module: each distinct array becomes one
static(named by a hash of its type and elements), whichConstPool::codedefines for the module instead of each function defining its own copies. - Error
- An error of code generation.
- Signature
- The arguments and results of a generated function: by default, inputs by value or reference and outputs in the returned tuple.
Enums§
Functions§
- elem_ty
- The Rust type of elements of
dtype. - emit_
function - Generates a Rust function
namethat computesf: arguments are the inputs off(scalars by value, arrays as&[T; N]), and the result is the tuple of its outputs. - emit_
function_ pooled emit_function_withwhose constant arrays go topool(defined once byConstPool::codefor all the functions that share it).- emit_
function_ with emit_functionwith the arguments and results ofsig.