tensor_tiled_cells.bend checks
raw source on the hub · import stelliferous@0.0.4.0/tensor_tiled_cells.bend as Tensor_tiled_cells
The cells of a logical tensor in the canonical order, and the values back. A logical shape reads around its lane axis as before indices, lanes values along the axis and after indices after it. A cell holds eight lanes of the axis: the cell of outer index o = b * after + r and group g lies at o * groups + g with the groups innermost and at g * outer + o with the groups outermost, and its lane l is the value at (b * lanes + 8 * g + l) * after + r, +0 past lanes. The source array is only read.
6 imports
import Base import ./kernel_tile.bend as Tile import ./storage_buffer.bend as Storage import ./tensor_grid.bend as Grid import ./traversal_blocks.bend as Blocks import ./traversal_array.bend as Traversal
Types
type Cells source · line 19 · raw
Data
The axes of a logical shape around its lane axis: outer indices of the other axes, after of them after the lane axis, lanes values and groups cells along it, and where the groups lie among the cell axes.
Cells@outer:U32 -> @after:U32 -> @lanes:U32 -> @groups:U32 -> @position:0xa2af805348d03b11eb853850859654f6/tensor_grid.Position -> Cells
type Spot source · line 24 · raw
Data
One lane read: its channel, where that channel holds the position, the plane size and the true channel count.
Spot@channel:U32 -> @index:U32 -> @plane:U32 -> @lanes:U32 -> Spot
type Tiling source · line 69 · raw
Data
With the groups innermost the cells of one outer index are a run of groups cells: cell g of the run of outer index o reads from lane 8 * g of o.
Tiling@after:U32 -> @lanes:U32 -> @groups:U32 -> @first:U32 -> Tiling
type Run source · line 72 · raw
Data
Run@first:Spot -> @start:U32 -> Run
type Outer source · line 97 · raw
Data
With the groups outermost every cell finds its group and outer index.
Outer@outer:U32 -> @after:U32 -> @lanes:U32 -> @first:U32 -> Outer
type Field source · line 117 · raw
Data
A lane selection is resolved before its tile is read.
Field0Field
Field1Field
Field2Field
Field3Field
Field4Field
Field5Field
Field6Field
Field7Field
type Pick source · line 160 · raw
Data
The values in logical order: the block of before index b and lane c reads, for its after index r, lane c % 8 of the cell of outer index b * after + r and group c / 8.
Pick@lane:U32 -> @base:U32 -> @step:U32 -> @start:U32 -> Pick
type Tail source · line 184 · raw
Data
The lanes of a cell from its first lane on: those below the true count lanes keep their value, the others become +0.
Tail@first:U32 -> @lanes:U32 -> Tail
Definitions
def next source · line 27 · raw
@spot:Spot -> Spot
def read_spot source · line 31 · raw
@input:Array<F32> -> @spot:Spot -> Pair(Array<F32>, F32)
def lane8 source · line 35 · raw
@+a:F32 -> @+b:F32 -> @+c:F32 -> @+d:F32 -> @+e:F32 -> @+f:F32 -> @+g:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8)
def lane7 source · line 39 · raw
@+spot:Spot -> @+a:F32 -> @+b:F32 -> @+c:F32 -> @+d:F32 -> @+e:F32 -> @+f:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8)
def lane6 source · line 43 · raw
@+spot:Spot -> @+a:F32 -> @+b:F32 -> @+c:F32 -> @+d:F32 -> @+e:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8)
def lane5 source · line 47 · raw
@+spot:Spot -> @+a:F32 -> @+b:F32 -> @+c:F32 -> @+d:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8)
def lane4 source · line 51 · raw
@+spot:Spot -> @+a:F32 -> @+b:F32 -> @+c:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8)
def lane3 source · line 55 · raw
@+spot:Spot -> @+a:F32 -> @+b:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8)
def lane2 source · line 59 · raw
@+spot:Spot -> @+a:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8)
def lane1 source · line 63 · raw
@+spot:Spot -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8)
def group_run source · line 76 · raw
@context:Tiling -> @block:U32 -> @start:U32 -> Run
Block block of a piece whose first outer index is first.
def run_spot source · line 82 · raw
@run:Run -> @position:U32 -> Spot
def cell_read source · line 87 · raw
@input:Array<F32> -> @run:Run -> @position:U32 -> Pair(Array<F32>, 0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8)
def tiled source · line 92 · raw
@+blocks:U32 -> @context:Tiling -> @input:Array<F32> -> @output:Array<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Pair(Array<F32>, Array<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>)
The cells of blocks outer indices, groups cells each.
def outer_spot source · line 100 · raw
@context:Outer -> @position:U32 -> Spot
def outer_read source · line 107 · raw
@input:Array<F32> -> @context:Outer -> @position:U32 -> Pair(Array<F32>, 0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8)
def tiled_outermost source · line 112 · raw
@+count:U32 -> @context:Outer -> @input:Array<F32> -> @output:Array<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> Pair(Array<F32>, Array<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>)
count cells of the groups outermost, from cell first on.
def field_of source · line 127 · raw
@lane:U32 -> Field
def field_value source · line 138 · raw
@field:Field -> @tile:0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8 -> F32
def lane_of source · line 150 · raw
@tile:0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8 -> @+lane:U32 -> F32
Lane lane of a tile, for lane below 8.
def lane_read source · line 153 · raw
@+lane:U32 -> @read:Pair(Array<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, 0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8) -> Pair(Array<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, F32)
def picked source · line 163 · raw
@position:0xa2af805348d03b11eb853850859654f6/tensor_grid.Position -> @+outer:U32 -> @+after:U32 -> @+groups:U32 -> @+before:U32 -> @+channel:U32 -> @+start:U32 -> Pick
def channel_pick source · line 168 · raw
@context:Cells -> @block:U32 -> @start:U32 -> Pick
def value_read source · line 173 · raw
@input:Array<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @pick:Pick -> @position:U32 -> Pair(Array<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, F32)
def untiled source · line 178 · raw
@+blocks:U32 -> @context:Cells -> @input:Array<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8> -> @output:Array<F32> -> Pair(Array<0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8>, Array<F32>)
The values of every before index and lane, a block of after values each.
def tail_lane source · line 187 · raw
@+first:U32 -> @+lanes:U32 -> @+lane:U32 -> @value:F32 -> F32
def tail source · line 190 · raw
@context:Tail -> @tile:0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8 -> 0xa2af805348d03b11eb853850859654f6/kernel_tile.Tile8