~/bend-docscommunity

main.bend relies on unsafe/foreign

raw source on the hub · import bend-ml-tensor-gpu@0.1.3.0/main.bend as Main

bend-ml-tensor-gpu: tensor-array's products on the GPU, with tensor-array's bits.

import ../tensor-array/main.bend as TA import bend-ml-tensor-gpu@0.1.3.0/main.bend as TG TG.matmul(n, k, m, par, a, b) # the same arguments, result type and bits as TA.Mat.matmul

The six products (matmul, matmul_nt, matmul_tn and their accumulating forms) take tensor-array's Mat values and return its result types; par is ignored (the GPU decides the split). Each product is one ! call (a bang): a balanced fork tree whose leaves each compute a 4 x 2 tile of C, every node sharing A, B and C through Base's Array.fork (two handles to one block, no copy), as upstream's one-block pattern does (bendlang/bend tests/run/stencil3d.bend). On a machine without a GPU, or with --gpu off, the same bang runs on the CPU threads.

The bits: a cell of C is computed in tensor-array's order. Product p of a dot goes to partial sum p mod 8, in increasing p, each sum starting at +0.0, and the eight sums are combined by TA.t8_comb with rot = k mod 8, as tensor-array's dotr and t8_dot do; an accumulating product adds the cell to C once with TA.cwr. The loop takes eight steps of k a turn; the steps past k in the last turn add +0.0, which leaves a sum unchanged (a sum that starts at +0.0 is never -0.0). Bend builds the device code with --fmad=false, so no multiply-add is fused. tests/bits.bend checks the bits against tensor-array on many shapes, on the GPU and the CPU.

Not proved, and marked so: Array.fork and Array.join are @unsafe in Base, so the defs below that call them, or take a shared array, are @unsafe, and bend main.bend names every def that relies on them. Nothing checks that a leaf writes only its own tile of C, or never writes A or B; the tiles are disjoint by construction (leaf t writes tile t). All of it is Bend: no foreign code. Written by bend-ml's scripts/gen_tensor_gpu.py (4 x 2 tiles).

2 imports
import Base
import bend-ml-tensor-array@0.1.15.0/main.bend as TA

Types

type E source · line 29 · raw

Data

the sizes and strides of one product: C[i][j] = sum_p A[oa + i*arow + p*sa] * B[ob + p*sb + j*bcol], n x m, k steps (oa, ob: 0 except for matmul_precise's blocks)

type GR source · line 39 · raw

Type

the values of one turn: A's 4 rows and B's 2 columns at 8 consecutive steps, read through the arrays in order

type T source · line 239 · raw

Type

the tile's cells after the 8 sums are combined, row by row

type ABC source · line 308 · raw

Type

type O2 source · line 427 · raw

Type

type O3 source · line 430 · raw

Type

type O4 source · line 433 · raw

Type

type R1 source · line 436 · raw

Type

type R2 source · line 439 · raw

Type

type R3 source · line 442 · raw

Type

type R4 source · line 445 · raw

Type

Definitions

def pk source · line 33 · raw

@ok:Bool -> @+x:F32 -> F32

a product that counts only when its step is inside k (the last turn's steps past k add +0.0)

def gr_47 source · line 42 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @+y1_0:F32 -> @+y1_1:F32 -> @+y2_0:F32 -> @+y2_1:F32 -> @+y3_0:F32 -> @+y3_1:F32 -> @+y4_0:F32 -> @+y4_1:F32 -> @+y5_0:F32 -> @+y5_1:F32 -> @+y6_0:F32 -> @+y6_1:F32 -> @+y7_0:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_46 source · line 46 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @+y1_0:F32 -> @+y1_1:F32 -> @+y2_0:F32 -> @+y2_1:F32 -> @+y3_0:F32 -> @+y3_1:F32 -> @+y4_0:F32 -> @+y4_1:F32 -> @+y5_0:F32 -> @+y5_1:F32 -> @+y6_0:F32 -> @+y6_1:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_45 source · line 50 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @+y1_0:F32 -> @+y1_1:F32 -> @+y2_0:F32 -> @+y2_1:F32 -> @+y3_0:F32 -> @+y3_1:F32 -> @+y4_0:F32 -> @+y4_1:F32 -> @+y5_0:F32 -> @+y5_1:F32 -> @+y6_0:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_44 source · line 54 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @+y1_0:F32 -> @+y1_1:F32 -> @+y2_0:F32 -> @+y2_1:F32 -> @+y3_0:F32 -> @+y3_1:F32 -> @+y4_0:F32 -> @+y4_1:F32 -> @+y5_0:F32 -> @+y5_1:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_43 source · line 58 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @+y1_0:F32 -> @+y1_1:F32 -> @+y2_0:F32 -> @+y2_1:F32 -> @+y3_0:F32 -> @+y3_1:F32 -> @+y4_0:F32 -> @+y4_1:F32 -> @+y5_0:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_42 source · line 62 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @+y1_0:F32 -> @+y1_1:F32 -> @+y2_0:F32 -> @+y2_1:F32 -> @+y3_0:F32 -> @+y3_1:F32 -> @+y4_0:F32 -> @+y4_1:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_41 source · line 66 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @+y1_0:F32 -> @+y1_1:F32 -> @+y2_0:F32 -> @+y2_1:F32 -> @+y3_0:F32 -> @+y3_1:F32 -> @+y4_0:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_40 source · line 70 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @+y1_0:F32 -> @+y1_1:F32 -> @+y2_0:F32 -> @+y2_1:F32 -> @+y3_0:F32 -> @+y3_1:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_39 source · line 74 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @+y1_0:F32 -> @+y1_1:F32 -> @+y2_0:F32 -> @+y2_1:F32 -> @+y3_0:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_38 source · line 78 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @+y1_0:F32 -> @+y1_1:F32 -> @+y2_0:F32 -> @+y2_1:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_37 source · line 82 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @+y1_0:F32 -> @+y1_1:F32 -> @+y2_0:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_36 source · line 86 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @+y1_0:F32 -> @+y1_1:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_35 source · line 90 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @+y1_0:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_34 source · line 94 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @+y0_1:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_33 source · line 98 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @+y0_0:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_32 source · line 102 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @+x7_3:F32 -> @a:Array<F32> -> @rv:Pair(Array<F32>, F32) -> GR

def gr_31 source · line 106 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @+x7_2:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_30 source · line 110 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @+x7_1:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_29 source · line 114 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @+x7_0:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_28 source · line 118 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @+x6_3:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_27 source · line 122 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @+x6_2:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_26 source · line 126 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @+x6_1:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_25 source · line 130 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @+x6_0:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_24 source · line 134 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @+x5_3:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_23 source · line 138 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @+x5_2:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_22 source · line 142 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @+x5_1:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_21 source · line 146 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @+x5_0:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_20 source · line 150 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @+x4_3:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_19 source · line 154 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @+x4_2:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_18 source · line 158 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @+x4_1:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_17 source · line 162 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @+x4_0:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_16 source · line 166 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @+x3_3:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_15 source · line 170 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @+x3_2:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_14 source · line 174 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @+x3_1:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_13 source · line 178 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @+x3_0:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_12 source · line 182 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @+x2_3:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_11 source · line 186 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @+x2_2:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_10 source · line 190 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @+x2_1:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_9 source · line 194 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @+x2_0:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_8 source · line 198 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @+x1_3:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_7 source · line 202 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @+x1_2:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_6 source · line 206 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @+x1_1:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_5 source · line 210 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @+x1_0:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_4 source · line 214 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @+x0_3:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_3 source · line 218 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @+x0_2:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_2 source · line 222 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @+x0_1:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_1 source · line 226 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+x0_0:F32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def gr_0 source · line 230 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @rv:Pair(Array<F32>, F32) -> @b:Array<F32> -> GR

def turn source · line 235 · raw

@+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @a:Array<F32> -> @b:Array<F32> -> GR

the turn whose A values start at ia and B values at ib

def wr source · line 253 · raw

@ok:Bool -> @+ac:Bool -> @+idx:U32 -> @+x:F32 -> @c:Array<F32> -> Array<F32>

writes cell (i, j) of C when it is inside n x m

def e_ofo source · line 316 · raw

@+ac:Bool -> @+n:Nat -> @+m:Nat -> @+k:Nat -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+oa:U32 -> @+ob:U32 -> E

the product's sizes and strides

def e_of source · line 319 · raw

@+ac:Bool -> @+n:Nat -> @+m:Nat -> @+k:Nat -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> E

def tiles source · line 322 · raw

@+n:Nat -> @+m:Nat -> Nat

def mm_fin source · line 335 · raw

@-n:Nat -> @-k:Nat -> @-m:Nat -> @g:ABC -> 0x054428f37dcef26dfcdf73a81af76b07/main.MMul<n, k, m>

def mm_nt_fin source · line 339 · raw

@-n:Nat -> @-k:Nat -> @-m:Nat -> @g:ABC -> 0x054428f37dcef26dfcdf73a81af76b07/main.MMulNT<n, k, m>

def mm_tn_fin source · line 343 · raw

@-n:Nat -> @-k:Nat -> @-m:Nat -> @g:ABC -> 0x054428f37dcef26dfcdf73a81af76b07/main.MMulTN<n, k, m>

def depth2 source · line 410 · raw

@big:Bool -> @+n:Nat -> Nat

def depth source · line 416 · raw

@+n:Nat -> Nat

leaves for n cells: 2^14 when there are that many, else the fewest powers of two that cover them

def share source · line 420 · raw

@+t:U32 -> @+n:U32 -> @+l:U32 -> Nat

how many of the cells t, t + l, t + 2l, .. lie below n

def none source · line 424 · raw

@u:Unit -> Array<F32>

an array of one cell, for an unused input

def blk_len source · line 605 · raw

@+bi:U32 -> @+k:U32 -> Nat

Unsafe

unsafe mm source · line 245 · raw

@kg:Nat -> @+ia:U32 -> @+ib:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+rem:U32 -> @+rot:Nat -> @+s0_0_0:F32 -> @+s1_0_0:F32 -> @+s2_0_0:F32 -> @+s3_0_0:F32 -> @+s4_0_0:F32 -> @+s5_0_0:F32 -> @+s6_0_0:F32 -> @+s7_0_0:F32 -> @+s0_0_1:F32 -> @+s1_0_1:F32 -> @+s2_0_1:F32 -> @+s3_0_1:F32 -> @+s4_0_1:F32 -> @+s5_0_1:F32 -> @+s6_0_1:F32 -> @+s7_0_1:F32 -> @+s0_1_0:F32 -> @+s1_1_0:F32 -> @+s2_1_0:F32 -> @+s3_1_0:F32 -> @+s4_1_0:F32 -> @+s5_1_0:F32 -> @+s6_1_0:F32 -> @+s7_1_0:F32 -> @+s0_1_1:F32 -> @+s1_1_1:F32 -> @+s2_1_1:F32 -> @+s3_1_1:F32 -> @+s4_1_1:F32 -> @+s5_1_1:F32 -> @+s6_1_1:F32 -> @+s7_1_1:F32 -> @+s0_2_0:F32 -> @+s1_2_0:F32 -> @+s2_2_0:F32 -> @+s3_2_0:F32 -> @+s4_2_0:F32 -> @+s5_2_0:F32 -> @+s6_2_0:F32 -> @+s7_2_0:F32 -> @+s0_2_1:F32 -> @+s1_2_1:F32 -> @+s2_2_1:F32 -> @+s3_2_1:F32 -> @+s4_2_1:F32 -> @+s5_2_1:F32 -> @+s6_2_1:F32 -> @+s7_2_1:F32 -> @+s0_3_0:F32 -> @+s1_3_0:F32 -> @+s2_3_0:F32 -> @+s3_3_0:F32 -> @+s4_3_0:F32 -> @+s5_3_0:F32 -> @+s6_3_0:F32 -> @+s7_3_0:F32 -> @+s0_3_1:F32 -> @+s1_3_1:F32 -> @+s2_3_1:F32 -> @+s3_3_1:F32 -> @+s4_3_1:F32 -> @+s5_3_1:F32 -> @+s6_3_1:F32 -> @+s7_3_1:F32 -> @g:GR -> T

kg more full turns; g holds the current turn's values. The last call (kg = 0) adds the turn that holds the steps past the last full turn (rem = k mod 8 of them), counting only those, and combines the sums.

unsafe put source · line 260 · raw

@+ac:Bool -> @+n:U32 -> @+m:U32 -> @+i0:U32 -> @+j0:U32 -> @c:Array<F32> -> @t:T -> Array<F32>

the tile at rows i0.., columns j0.. of C, from the loop's result; A and B are dropped (the caller holds them)

unsafe tile source · line 266 · raw

@+e:E -> @+i0:U32 -> @+j0:U32 -> @+a:Array<F32> -> @+b:Array<F32> -> @c:Array<F32> -> Array<F32>

unsafe leaf_if source · line 273 · raw

@ok:Bool -> @+e:E -> @+t:U32 -> @+tcols:U32 -> @+a:Array<F32> -> @+b:Array<F32> -> @c:Array<F32> -> Array<F32>

leaf t computes tile t (row-major over the tiles); leaves past the last tile write nothing

unsafe leaf source · line 279 · raw

@+e:E -> @+t:U32 -> @+a:Array<F32> -> @+b:Array<F32> -> @c:Array<F32> -> Array<F32>

unsafe tree source · line 285 · raw

@+e:E -> @d:Nat -> @+t:U32 -> @+a:Array<F32> -> @+b:Array<F32> -> @+c:Array<F32> -> Array<F32>

unsafe tree_new source · line 296 · raw

@+e:E -> @d:Nat -> @+a:Array<F32> -> @+b:Array<F32> -> @+cd:Nat -> Array<F32>

C made inside the bang: the root of the ! call allocates it on the device. Made on the host instead, a new C often reuses a block whose pages sit on the device, so zeroing it on the host pulls them back over PCIe and the bang moves them again (a 256 x 1536 product: 9.2 ms against 6.0, measured 2026-10-18). The leaves write every cell of C.

unsafe bang_new source · line 300 · raw

@+e:E -> @d:Nat -> @+a:Array<F32> -> @+b:Array<F32> -> @+cd:Nat -> Array<F32>

unsafe bang source · line 305 · raw

@+e:E -> @d:Nat -> @+a:Array<F32> -> @+b:Array<F32> -> @c:Array<F32> -> Array<F32>

one bang over the tiles; A and B are shared with every leaf and come back unchanged

unsafe run_e source · line 312 · raw

@+e:E -> @+tiles:U32 -> @+a:Array<F32> -> @+b:Array<F32> -> @c:Array<F32> -> ABC

unsafe gemm_new source · line 327 · raw

@+n:Nat -> @+m:Nat -> @+k:Nat -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+a:Array<F32> -> @+b:Array<F32> -> ABC

C (n x m) = A · B with k steps into a new C made on the device

unsafe gemm source · line 332 · raw

@+ac:Bool -> @+n:Nat -> @+m:Nat -> @+k:Nat -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @a:Array<F32> -> @b:Array<F32> -> @c:Array<F32> -> ABC

C (n x m) = A · B with k steps, or C + A · B when ac, C[i][j] = sum_p A[i*arow + p*sa] * B[p*sb + j*bcol]

unsafe matmul source · line 349 · raw

@+n:Nat -> @+k:Nat -> @+m:Nat -> @par:Nat -> @a:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<n, k> -> @b:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<k, m> -> 0x054428f37dcef26dfcdf73a81af76b07/main.MMul<n, k, m>

C = A · B (n x k) · (k x m), tensor-array's TA.Mat.matmul bits

unsafe matmul_acc source · line 356 · raw

@+n:Nat -> @+k:Nat -> @+m:Nat -> @par:Nat -> @a:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<n, k> -> @b:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<k, m> -> @c:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<n, m> -> 0x054428f37dcef26dfcdf73a81af76b07/main.MMul<n, k, m>

C + A · B, into C (n x m)

unsafe matmul_nt source · line 363 · raw

@+n:Nat -> @+k:Nat -> @+m:Nat -> @par:Nat -> @a:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<n, k> -> @b:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<m, k> -> 0x054428f37dcef26dfcdf73a81af76b07/main.MMulNT<n, k, m>

C = A · Bᵀ (n x k) · (m x k)ᵀ: for weights stored with one row per output

unsafe matmul_nt_acc source · line 370 · raw

@+n:Nat -> @+k:Nat -> @+m:Nat -> @par:Nat -> @a:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<n, k> -> @b:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<m, k> -> @c:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<n, m> -> 0x054428f37dcef26dfcdf73a81af76b07/main.MMulNT<n, k, m>

C + A · Bᵀ, into C (n x m)

unsafe matmul_tn source · line 377 · raw

@+n:Nat -> @+k:Nat -> @+m:Nat -> @par:Nat -> @a:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<k, n> -> @b:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<k, m> -> 0x054428f37dcef26dfcdf73a81af76b07/main.MMulTN<n, k, m>

C = Aᵀ · B (k x n)ᵀ · (k x m): weight gradient, Xᵀ · dY

unsafe matmul_tn_acc source · line 384 · raw

@+n:Nat -> @+k:Nat -> @+m:Nat -> @par:Nat -> @a:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<k, n> -> @b:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<k, m> -> @c:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<n, m> -> 0x054428f37dcef26dfcdf73a81af76b07/main.MMulTN<n, k, m>

C + Aᵀ · B, into C (n x m): dW += Xᵀ · dY

unsafe join2 source · line 449 · raw

@x:O2 -> @y:O2 -> O2

unsafe join3 source · line 454 · raw

@x:O3 -> @y:O3 -> O3

unsafe join4 source · line 459 · raw

@x:O4 -> @y:O4 -> O4

unsafe tree1 source · line 464 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> Array<F32>) -> @+d:Nat -> @+t:U32 -> @+l:U32 -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @+oa:Array<F32> -> Array<F32>

unsafe root1 source · line 472 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> Array<F32>) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @oa:Array<F32> -> Array<F32>

unsafe root1_new source · line 476 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> Array<F32>) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @+ca:Nat -> Array<F32>

unsafe go1 source · line 480 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> Array<F32>) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @oa:Array<F32> -> R1

unsafe go1_new source · line 484 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> Array<F32>) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @+ca:Nat -> R1

unsafe run1 source · line 489 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> Array<F32>) -> @+d:Nat -> @+e:E -> @x1:Array<F32> -> @x2:Array<F32> -> @x3:Array<F32> -> @x4:Array<F32> -> @oa:Array<F32> -> R1

one bang over 2^d leaves with 1 output written in place

unsafe run1_new source · line 494 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> Array<F32>) -> @+d:Nat -> @+e:E -> @x1:Array<F32> -> @x2:Array<F32> -> @x3:Array<F32> -> @x4:Array<F32> -> @+ca:Nat -> R1

one bang over 2^d leaves with 1 new output of 2^c.. cells, made on the device

unsafe tree2 source · line 498 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O2 -> O2) -> @+d:Nat -> @+t:U32 -> @+l:U32 -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @+oa:Array<F32> -> @+ob:Array<F32> -> O2

unsafe root2 source · line 506 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O2 -> O2) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @oa:Array<F32> -> @ob:Array<F32> -> O2

unsafe root2_new source · line 510 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O2 -> O2) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @+ca:Nat -> @+cb:Nat -> O2

unsafe go2 source · line 514 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O2 -> O2) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @oa:Array<F32> -> @ob:Array<F32> -> R2

unsafe go2_new source · line 518 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O2 -> O2) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @+ca:Nat -> @+cb:Nat -> R2

unsafe run2 source · line 523 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O2 -> O2) -> @+d:Nat -> @+e:E -> @x1:Array<F32> -> @x2:Array<F32> -> @x3:Array<F32> -> @x4:Array<F32> -> @oa:Array<F32> -> @ob:Array<F32> -> R2

one bang over 2^d leaves with 2 outputs written in place

unsafe run2_new source · line 528 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O2 -> O2) -> @+d:Nat -> @+e:E -> @x1:Array<F32> -> @x2:Array<F32> -> @x3:Array<F32> -> @x4:Array<F32> -> @+ca:Nat -> @+cb:Nat -> R2

one bang over 2^d leaves with 2 new outputs of 2^c.. cells, made on the device

unsafe tree3 source · line 532 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O3 -> O3) -> @+d:Nat -> @+t:U32 -> @+l:U32 -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @+oa:Array<F32> -> @+ob:Array<F32> -> @+oc:Array<F32> -> O3

unsafe root3 source · line 540 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O3 -> O3) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @oa:Array<F32> -> @ob:Array<F32> -> @oc:Array<F32> -> O3

unsafe root3_new source · line 544 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O3 -> O3) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @+ca:Nat -> @+cb:Nat -> @+cc:Nat -> O3

unsafe go3 source · line 548 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O3 -> O3) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @oa:Array<F32> -> @ob:Array<F32> -> @oc:Array<F32> -> R3

unsafe go3_new source · line 552 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O3 -> O3) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @+ca:Nat -> @+cb:Nat -> @+cc:Nat -> R3

unsafe run3 source · line 557 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O3 -> O3) -> @+d:Nat -> @+e:E -> @x1:Array<F32> -> @x2:Array<F32> -> @x3:Array<F32> -> @x4:Array<F32> -> @oa:Array<F32> -> @ob:Array<F32> -> @oc:Array<F32> -> R3

one bang over 2^d leaves with 3 outputs written in place

unsafe run3_new source · line 562 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O3 -> O3) -> @+d:Nat -> @+e:E -> @x1:Array<F32> -> @x2:Array<F32> -> @x3:Array<F32> -> @x4:Array<F32> -> @+ca:Nat -> @+cb:Nat -> @+cc:Nat -> R3

one bang over 2^d leaves with 3 new outputs of 2^c.. cells, made on the device

unsafe tree4 source · line 566 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O4 -> O4) -> @+d:Nat -> @+t:U32 -> @+l:U32 -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @+oa:Array<F32> -> @+ob:Array<F32> -> @+oc:Array<F32> -> @+od:Array<F32> -> O4

unsafe root4 source · line 574 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O4 -> O4) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @oa:Array<F32> -> @ob:Array<F32> -> @oc:Array<F32> -> @od:Array<F32> -> O4

unsafe root4_new source · line 578 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O4 -> O4) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @+ca:Nat -> @+cb:Nat -> @+cc:Nat -> @+cd:Nat -> O4

unsafe go4 source · line 582 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O4 -> O4) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @oa:Array<F32> -> @ob:Array<F32> -> @oc:Array<F32> -> @od:Array<F32> -> R4

unsafe go4_new source · line 586 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O4 -> O4) -> @+d:Nat -> @+e:E -> @+x1:Array<F32> -> @+x2:Array<F32> -> @+x3:Array<F32> -> @+x4:Array<F32> -> @+ca:Nat -> @+cb:Nat -> @+cc:Nat -> @+cd:Nat -> R4

unsafe run4 source · line 591 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O4 -> O4) -> @+d:Nat -> @+e:E -> @x1:Array<F32> -> @x2:Array<F32> -> @x3:Array<F32> -> @x4:Array<F32> -> @oa:Array<F32> -> @ob:Array<F32> -> @oc:Array<F32> -> @od:Array<F32> -> R4

one bang over 2^d leaves with 4 outputs written in place

unsafe run4_new source · line 596 · raw

@-E:Data -> @-f:(@+t:U32 -> @+l:U32 -> @+e:E -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:Array<F32> -> @_:O4 -> O4) -> @+d:Nat -> @+e:E -> @x1:Array<F32> -> @x2:Array<F32> -> @x3:Array<F32> -> @x4:Array<F32> -> @+ca:Nat -> @+cb:Nat -> @+cc:Nat -> @+cd:Nat -> R4

one bang over 2^d leaves with 4 new outputs of 2^c.. cells, made on the device

unsafe blocks_acc source · line 610 · raw

@nb:Nat -> @+bi:U32 -> @+n:Nat -> @+m:Nat -> @+k:U32 -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+a:Array<F32> -> @+b:Array<F32> -> @c:Array<F32> -> Array<F32>

the blocks after the first: nb more, from block bi, each added into C

unsafe precise_c source · line 616 · raw

@+n:Nat -> @+m:Nat -> @+k:Nat -> @+arow:U32 -> @+sa:U32 -> @+sb:U32 -> @+bcol:U32 -> @+a:Array<F32> -> @+b:Array<F32> -> Array<F32>

unsafe mm_precise3 source · line 620 · raw

@+n:Nat -> @+k:Nat -> @+m:Nat -> @+a:Array<F32> -> @+b:Array<F32> -> 0x054428f37dcef26dfcdf73a81af76b07/main.MMul<n, k, m>

unsafe mm_precise2 source · line 624 · raw

@long:Bool -> @+n:Nat -> @+k:Nat -> @+m:Nat -> @+par:Nat -> @a:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<n, k> -> @b:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<k, m> -> 0x054428f37dcef26dfcdf73a81af76b07/main.MMul<n, k, m>

unsafe matmul_precise source · line 631 · raw

@+n:Nat -> @+k:Nat -> @+m:Nat -> @+par:Nat -> @a:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<n, k> -> @b:0x054428f37dcef26dfcdf73a81af76b07/main.Mat<k, m> -> 0x054428f37dcef26dfcdf73a81af76b07/main.MMul<n, k, m>

C = A · B with k summed in blocks of 1024: TA.Mat.matmul_precise's bits (opt-in)