tensor_halo.bend checks
raw source on the hub · import stelliferous@0.0.4.0/tensor_halo.bend as Tensor_halo
The input pieces a task of a window operation holds. The tasks own the input pieces in order: a piece belongs to the first task whose reach holds its first cell and that the tasks before it do not reach. A task also holds a copy of the cells of its reach before its own pieces, its halo. Two serial walks run before the tasks: the first copies every halo from the input pieces, the second hands the pieces to their tasks. A piece no task reaches is dropped.
7 imports
import Base import ./storage_buffer.bend as Storage import ./tensor_grid.bend as Grid import ./tensor_pieces.bend as Pieces import ./tensor_tasks.bend as Tasks import ./tensor_move.bend as Move import ./traversal_partition.bend as Partition
Types
type Reaching source · line 21 · raw
@-Element:Data -> @-Context:Data -> Data
Reaching@-Element:Data -> @-Context:Data -> @context:Context -> @grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @fill:Element -> Reaching<Element, Context>
type Halo source · line 30 · raw
@-Element:Data -> Type
A task's halo, cells [first, first + count), and its pieces [low, high).
Halo@-Element:Data -> @buffer:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @first:U32 -> @count:U32 -> @low:U32 -> @high:U32 -> Halo<Element>
type Reading source · line 35 · raw
@-Element:Data -> Type
The first walk reads the input pieces and knows where the tasks before reach to.
Reading@-Element:Data -> @holding:0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<Element> -> @reached:U32 -> Reading<Element>
type Handed source · line 62 · raw
@-Element:Data -> Type
The pieces of a task: after the first ones of the stack are dropped, the next count taken, in the other order.
Handed@-Element:Data -> @own:0xa2af805348d03b11eb853850859654f6/tensor_move.Stack<Element> -> @rest:0xa2af805348d03b11eb853850859654f6/tensor_move.Stack<Element> -> Handed<Element>
type Handing source · line 77 · raw
@-Element:Data -> Type
The second walk: the stack of input pieces not yet handed and the index of its first.
Handing@-Element:Data -> @stack:0xa2af805348d03b11eb853850859654f6/tensor_move.Stack<Element> -> @next:U32 -> Handing<Element>
Definitions
def piece_from source · line 25 · raw
@+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+index:U32 -> U32
The first piece of a grid that starts at or after cell index.
Templates
template Reach source · line 18 · raw
@-Context:Data -> Type
The range of input cells a task reads from the range of output cells it writes.
template halo_leaf source · line 38 · raw
@-Element:Data -> @+task_first:U32 -> @+task_count:U32 -> @+first:U32 -> @+count:U32 -> @+low:U32 -> @+high:U32 -> @+reached:U32 -> @copied:Pair(0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<Element>, 0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element>) -> Pair(Reading<Element>, 0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, Halo<Element>, Unit>)
template halo_spanned source · line 43 · raw
@-Element:Data -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+fill:Element -> @+task_first:U32 -> @+task_count:U32 -> @span:0xa2af805348d03b11eb853850859654f6/tensor_tasks.Span -> @reading:Reading<Element> -> Pair(Reading<Element>, 0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, Halo<Element>, Unit>)
template halo_task source · line 53 · raw
@-Element:Data -> @-Context:Data -> @-reach:Reach(Context) -> @context:Reaching<Element, Context> -> @first:U32 -> @count:U32 -> @reading:Reading<Element> -> Pair(Reading<Element>, 0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, Halo<Element>, Unit>)
template skipped source · line 65 · raw
@-Element:Data -> @count:Nat -> @stack:0xa2af805348d03b11eb853850859654f6/tensor_move.Stack<Element> -> 0xa2af805348d03b11eb853850859654f6/tensor_move.Stack<Element>
template handed source · line 70 · raw
@-Element:Data -> @count:Nat -> @stack:0xa2af805348d03b11eb853850859654f6/tensor_move.Stack<Element> -> @own:0xa2af805348d03b11eb853850859654f6/tensor_move.Stack<Element> -> Handed<Element>
template window_of source · line 80 · raw
@-Element:Data -> @empty:Bool -> @halo:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+first:U32 -> @+count:U32 -> @own:0xa2af805348d03b11eb853850859654f6/tensor_move.Stack<Element> -> 0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<Element>
template window_handed source · line 85 · raw
@-Element:Data -> @+task_first:U32 -> @+task_count:U32 -> @halo:0xa2af805348d03b11eb853850859654f6/storage_buffer.Buffer<Element> -> @+first:U32 -> @+count:U32 -> @+next:U32 -> @handed:Handed<Element> -> Pair(0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, 0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<Element>, Unit>, Handing<Element>)
template window_leaf source · line 90 · raw
@-Element:Data -> @context:Unit -> @task_first:U32 -> @task_count:U32 -> @halo:Halo<Element> -> @handing:Handing<Element> -> Pair(0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, 0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<Element>, Unit>, Handing<Element>)
template halos_of source · line 101 · raw
@-Element:Data -> @result:Pair(Reading<Element>, 0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, Halo<Element>, Unit>) -> @+fill:Element -> Pair(0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, Halo<Element>, Unit>, 0xa2af805348d03b11eb853850859654f6/tensor_move.Stack<Element>)
template windows_handed source · line 106 · raw
@-Element:Data -> @pair:Pair(0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, Halo<Element>, Unit>, 0xa2af805348d03b11eb853850859654f6/tensor_move.Stack<Element>) -> 0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, 0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<Element>, Unit>
template windows source · line 113 · raw
@-Element:Data -> @-Context:Data -> @-reach:Reach(Context) -> @+context:Context -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+fill:Element -> @tasks:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @pieces:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Pieces(Element) -> 0xa2af805348d03b11eb853850859654f6/traversal_partition.Tree<&1, 0xa2af805348d03b11eb853850859654f6/tensor_move.Holding<Element>, Unit>
Prepare: the pieces every task of tasks holds, its halo first. A task leaf holds them with the output range of the task.