traversal_lanes.bend checks
raw source on the hub · import stelliferous@0.0.2.0/traversal_lanes.bend as Traversal_lanes
The FP32 cells of Cells.map: eight consecutive values as one Tile8.
4 imports
import Base import ./kernel_tile.bend as Tile import ./traversal_cells.bend as Cells import ./traversal_array.bend as Traversal
Definitions
def scatter source · line 53 · raw
@values:Array<F32> -> @position:U32 -> @tile:0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8 -> Array<F32>
The lanes of a tile to position, position + 1, ...
def scratch source · line 65 · raw
Array<0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8>
def covered source · line 93 · raw
@+depth:Nat -> @+position:U32 -> @+count:Nat -> Bool
An array of 2^depth values holds the count positions from position, within the depths the refinement proof covers.
Templates
template gathered source · line 7 · raw
@-Context:Data -> @-map:(@_:Context -> @_:F32 -> F32) -> @+context:Context -> @+a:F32 -> @+b:F32 -> @+c:F32 -> @+d:F32 -> @+e:F32 -> @+f:F32 -> @+g:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8)
template gather7 source · line 12 · raw
@-Context:Data -> @-map:(@_:Context -> @_:F32 -> F32) -> @+position:U32 -> @+context:Context -> @+a:F32 -> @+b:F32 -> @+c:F32 -> @+d:F32 -> @+e:F32 -> @+f:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8)
template gather6 source · line 17 · raw
@-Context:Data -> @-map:(@_:Context -> @_:F32 -> F32) -> @+position:U32 -> @+context:Context -> @+a:F32 -> @+b:F32 -> @+c:F32 -> @+d:F32 -> @+e:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8)
template gather5 source · line 22 · raw
@-Context:Data -> @-map:(@_:Context -> @_:F32 -> F32) -> @+position:U32 -> @+context:Context -> @+a:F32 -> @+b:F32 -> @+c:F32 -> @+d:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8)
template gather4 source · line 27 · raw
@-Context:Data -> @-map:(@_:Context -> @_:F32 -> F32) -> @+position:U32 -> @+context:Context -> @+a:F32 -> @+b:F32 -> @+c:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8)
template gather3 source · line 32 · raw
@-Context:Data -> @-map:(@_:Context -> @_:F32 -> F32) -> @+position:U32 -> @+context:Context -> @+a:F32 -> @+b:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8)
template gather2 source · line 37 · raw
@-Context:Data -> @-map:(@_:Context -> @_:F32 -> F32) -> @+position:U32 -> @+context:Context -> @+a:F32 -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8)
template gather1 source · line 42 · raw
@-Context:Data -> @-map:(@_:Context -> @_:F32 -> F32) -> @+position:U32 -> @+context:Context -> @read:Pair(Array<F32>, F32) -> Pair(Array<F32>, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8)
template gather source · line 48 · raw
@-Context:Data -> @-map:(@_:Context -> @_:F32 -> F32) -> @values:Array<F32> -> @position:U32 -> @context:Context -> Pair(Array<F32>, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8)
The mapped values at position, position + 1, ... as one tile; the array is only read.
template finish source · line 69 · raw
@-Context:Data -> @-map:(@_:Context -> @_:F32 -> F32) -> @rest:Nat -> @state:0x9be3b13bf249759bc81e1958bcd1a4c0/traversal_cells.State<Array<F32>, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8, Context> -> Array<F32>
The values the rounds leave: fewer than eight, mapped one by one.
template rounds_with source · line 75 · raw
@-Owner:Type -> @-Context:Data -> @-gather:(@_:Owner -> @_:U32 -> @_:Context -> Pair(Owner, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8)) -> @-scatter:(@_:Owner -> @_:U32 -> @_:0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8 -> Owner) -> @-finish:(@_:Nat -> @_:0x9be3b13bf249759bc81e1958bcd1a4c0/traversal_cells.State<Owner, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8, Context> -> Owner) -> @count:Nat -> @state:0x9be3b13bf249759bc81e1958bcd1a4c0/traversal_cells.State<Owner, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8, Context> -> Owner
One eight-value loop for any owned input bundle; gather and scatter decide which owners are read or updated. The unary path is its Array specialization.
template rounds source · line 83 · raw
@-Context:Data -> @-map:(@_:Context -> @_:F32 -> F32) -> @count:Nat -> @state:0x9be3b13bf249759bc81e1958bcd1a4c0/traversal_cells.State<Array<F32>, 0x9be3b13bf249759bc81e1958bcd1a4c0/kernel_tile.Tile8, Context> -> Array<F32>
template map source · line 88 · raw
@-Context:Data -> @-map:(@_:Context -> @_:F32 -> F32) -> @count:Nat -> @position:U32 -> @context:Context -> @values:Array<F32> -> Array<F32>
map over the count values from position, in order: Traversal.map_in_place with the values of each round computed together.
template map_when source · line 98 · raw
@-Context:Data -> @-operation:(@_:Context -> @_:F32 -> F32) -> @covered:Bool -> @count:Nat -> @position:U32 -> @context:Context -> @values:Array<F32> -> Array<F32>
map over count values from position when the array is known to hold them, and the scalar map otherwise: the same array either way.