Skip to main content

Module emit

Module emit 

Source
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§

ConstPool
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), which ConstPool::code defines 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§

Input
How a generated function takes an input.
Output
How a generated function gives an output.

Functions§

elem_ty
The Rust type of elements of dtype.
emit_function
Generates a Rust function name that computes f: arguments are the inputs of f (scalars by value, arrays as &[T; N]), and the result is the tuple of its outputs.
emit_function_pooled
emit_function_with whose constant arrays go to pool (defined once by ConstPool::code for all the functions that share it).
emit_function_with
emit_function with the arguments and results of sig.