| Title: | TinyCC Backend Bridge from 'anvl' Traces to 'tccquickr' Kernels |
|---|---|
| Description: | Compiles 'anvl' traced array programs to C kernels through 'tccquickr' and the TinyCC just-in-time compiler from 'Rtinycc'. Traced graphs are lowered to declared R using anvl's own quickr lowering rules wherever those emit tccquickr's declared subset, with bridge-owned tinycc rules for primitives that have a native tccquickr surface form (matrix products as '%*%' contractions, aval-checked broadcast passthrough). The result is a millisecond-latency CPU compile path for anvl programs with no XLA dependency. |
| Authors: | Sounkou Mahamane Toure [aut, cre] |
| Maintainer: | Sounkou Mahamane Toure <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9000 |
| Built: | 2026-07-20 21:06:06 UTC |
| Source: | https://github.com/sounkou-bioinfo/anvltcc |
Walks an anvl::AnvlGraph's calls in order and emits one declared R
function in tccquickr's input dialect. Each primitive is lowered by its
tinycc bridge rule when one claims the configuration, and by anvl's own
quickr rule otherwise, so the bridge only owns the primitives whose
quickr code would leave tccquickr's declared subset.
graph_to_tinycc_r_function(graph)graph_to_tinycc_r_function(graph)
graph |
( |
Graph constants become trailing formals; their traced values are attached
as the anvltcc_constants attribute so callers can complete the call.
A function whose body starts with declare(type(...)), suitable
for tccquickr::tccq_analyze() and plain R evaluation alike.
Traces f with anvl::trace_fn(), lowers the graph through
graph_to_tinycc_r_function(), and JIT-compiles the result with
tccquickr's Rtinycc backend. The returned function takes plain R
scalars/vectors/arrays in the traced argument order and returns plain R
values; traced constants are bound automatically.
tinycc_jit(f, ...)tinycc_jit(f, ...)
f |
( |
... |
Named example arguments for tracing: |
A compiled function over plain R values.
Same pipeline as tinycc_jit() but stops at source emission.
tinycc_source(f, ...)tinycc_source(f, ...)
f |
( |
... |
Named example arguments for tracing: |
(character(1)) the generated C kernel source.