tensor_tasks.bend checks
raw source on the hub · import stelliferous@0.0.4.0/tensor_tasks.bend as Tensor_tasks
The work of one operation: its pieces grouped into tasks, and whether the tasks run in parallel. The pieces never move: a task owns the adjacent pieces of a complete subtree of the ranges.
8 imports
import Base import ./tensor_grid.bend as Grid import ./tensor_pieces.bend as Pieces import ./kernel_cost.bend as Cost import ./default_kernel_cost.bend as DefaultCost import ./tensor_view.bend as Views import ./tensor_move.bend as Move import ./math_choice.bend as Choice
Types
type Group source · line 13 · raw
Data
Group@first:U32 -> @count:U32 -> @layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> Group
type Size source · line 31 · raw
Data
Size@tasks:U32 -> @largest:U32 -> Size
type Extra source · line 64 · raw
Data
What the parallel plan pays and the serial plan does not: for every task after the first the bytes it allocates or clones and the boundary it prepares, and once the finish that joins the tasks.
Extra@task_bytes:F32 -> @boundary_ns:F32 -> @finish_ns:F32 -> Extra
type Decision source · line 72 · raw
Data
The tasks of an operation and whether they run in parallel. The serial plan is one task: one owner serves every piece in order and shares nothing.
Decision@parallel:Bool -> @tasks:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> Decision
type Cutting source · line 156 · raw
Data
A range of at least two grains of work and two units is cut in halves of whole units, so every part keeps a grain: a task of heavy work can be a part of a piece.
Cutting@unit:U32 -> @cell_ns:F32 -> @grain:F32 -> Cutting
type Source source · line 247 · raw
Data
How one target cell axis reads one source: the source axis it reads and the block of a source piece along it. Index i of the target axis reaches the virtual indices from (offset + step * i) / divisor to (offset + step * i + width - 1) / divisor, and the source holds bound of the virtual indices from shift on: past them a read is clipped, or clamped to the nearest end. A view reads one index of its source, a group of eight lanes reads eight indices of a lane axis, a lane axis reads the group of eight of its indices, and a part of a concatenation holds the indices from its place on. A target axis that reads no source axis repeats the same source cells. A target axis that runs past the end of the one source axis it steps reads across several source axes.
UnreadSource
Read@axis:U32 -> @block:U32 -> @step:U32 -> @offset:U32 -> @mirrored:Bool -> @width:U32 -> @divisor:U32 -> @shift:U32 -> @bound:U32 -> @clamped:Bool -> Source
CrossingSource
type Reading source · line 252 · raw
Data
Reading@extent:U32 -> @block:U32 -> @source:Source -> Reading
type Class source · line 256 · raw
Data
Consecutive target blocks of an axis and the source blocks they read.
Class@target_first:U32 -> @target_count:U32 -> @source_first:U32 -> @source_count:U32 -> Class
type Footprint source · line 260 · raw
Data
The source blocks a range of target indices reads, or none.
Footprint@first:U32 -> @last:U32 -> @empty:Bool -> Footprint
type Walk source · line 295 · raw
Data
Walk@current:Class -> @done:List<&2, Class> -> Walk
type Stepped source · line 371 · raw
Data
The source axis a stride steps: the first axis of more than one index whose stride divides it, with the step in indices of that axis and the coordinate of the view offset on it.
Stepped@axis:U32 -> @step:U32 -> @extent:U32 -> @first:U32 -> Stepped
UnsteppedStepped
type Classes source · line 506 · raw
Data
The classes of one target axis and how many there are.
Classes@count:U32 -> @list:List<&2, Class> -> Classes
type Components source · line 524 · raw
Data
The readings of every source and the common classes of every target axis. An inseparable source joins everything into one component.
Components@readings:List<&2, List<&2, Reading>> -> @classes:List<&2, Classes> -> @count:U32 -> @separate:Bool -> Components
type Chosen source · line 553 · raw
Data
The classes of the axes after one, and the index left for the axes before.
Chosen@classes:List<&2, Class> -> @index:U32 -> Chosen
type Span source · line 585 · raw
Data
An index range of one axis.
Span@first:U32 -> @count:U32 -> Span
type Segment source · line 797 · raw
Data
Along one axis, count target indices from first read the source indices from source on with step one, or the one index source with step zero.
Segment@first:U32 -> @count:U32 -> @source:U32 -> @step:U32 -> Segment
type Cut source · line 803 · raw
Data
The part of a segment inside a piece: its extent, the source stride and the offset of its first source index in source cells, and the piece stride and offset of its first target index.
Cut@count:U32 -> @source_stride:U32 -> @source_offset:U32 -> @target_stride:U32 -> @target_offset:U32 -> Cut
type Partial source · line 817 · raw
Data
A box of a piece being built, its axes innermost first.
Partial@axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_move.Axis> -> @source:U32 -> @target:U32 -> Partial
Definitions
def group_range source · line 16 · raw
@limit:U32 -> @first:U32 -> @count:U32 -> Group
def group_join source · line 21 · raw
@limit:U32 -> @left_ranges:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @right_ranges:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @left:Group -> @right:Group -> Group
def group_layout source · line 27 · raw
@group:Group -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges
def size_leaf source · line 34 · raw
@context:Unit -> @first:U32 -> @count:U32 -> Size
def size_join source · line 37 · raw
@left:Size -> @right:Size -> Size
def size source · line 42 · raw
@layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> Size
def divided_up source · line 45 · raw
@+count:U32 -> @+parts:U32 -> U32
def tasks_sized source · line 53 · raw
@+layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @+count:U32 -> @+pool:U32 -> @+whole:U32 -> @found:Size -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges
Complete subtrees of ranges over count cells joined up to one worker's share of the cells, up to whole cells, or up to one worker's share of the ranges at the largest, whichever is most. Some worker serves that share of the ranges in any plan, so joining up to it keeps the longest worker and leaves fewer tasks to prepare.
def tasks_over source · line 58 · raw
@+layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @+count:U32 -> @+workers:U32 -> @+whole:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges
def no_extra source · line 67 · raw
Extra
def whole_bounds source · line 75 · raw
@bounds:Pair(U32, U32) -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges
def planned source · line 79 · raw
@+parallel:Bool -> @+layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> Decision
def parallel_ns source · line 85 · raw
@+workers:U32 -> @+cell_ns:F32 -> @config:0xa2af805348d03b11eb853850859654f6/kernel_cost.Configuration -> @extra:Extra -> @+count:U32 -> @+largest:U32 -> F32
Costs both plans pay cancel. The serial plan computes every cell. The parallel plan adds two wake rounds, waves of its largest task, the dispatch of every task and its extra.
def worth source · line 92 · raw
@+workers:U32 -> @+cell_ns:F32 -> @config:0xa2af805348d03b11eb853850859654f6/kernel_cost.Configuration -> @extra:Extra -> @+total:U32 -> @size:Size -> Bool
def decided source · line 96 · raw
@+workers:U32 -> @+cell_ns:F32 -> @config:0xa2af805348d03b11eb853850859654f6/kernel_cost.Configuration -> @extra:Extra -> @+total:U32 -> @+layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> Decision
def pool_ns source · line 102 · raw
@+workers:U32 -> @+cell_ns:F32 -> @+config:0xa2af805348d03b11eb853850859654f6/kernel_cost.Configuration -> @+extra:Extra -> @+count:U32 -> @+whole:U32 -> @+ranges:U32 -> @+largest:U32 -> @+pool:U32 -> F32
What the tasks a pool groups cost, from the ranges alone: a complete subtree of the ranges holds a power of two of them, so the tasks hold the largest power of two of ranges the limit of the pool admits.
def pool_from source · line 111 · raw
@fuel:Nat -> @more:Bool -> @+workers:U32 -> @+cell_ns:F32 -> @+config:0xa2af805348d03b11eb853850859654f6/kernel_cost.Configuration -> @+extra:Extra -> @+count:U32 -> @+whole:U32 -> @+ranges:U32 -> @+largest:U32 -> @+pool:U32 -> @+best:U32 -> @+best_ns:F32 -> U32
Pools of twice the shares while a share holds more than one range. Smaller tasks can end the last wave sooner; the pool of the cheapest tasks is kept, the first of equal ones.
def waved_pool source · line 122 · raw
@+workers:U32 -> @+cell_ns:F32 -> @+config:0xa2af805348d03b11eb853850859654f6/kernel_cost.Configuration -> @+extra:Extra -> @+count:U32 -> @+whole:U32 -> @+found:Size -> U32
def tasks_waved source · line 130 · raw
@+layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @+count:U32 -> @+workers:U32 -> @+whole:U32 -> @+cell_ns:F32 -> @+config:0xa2af805348d03b11eb853850859654f6/kernel_cost.Configuration -> @+extra:Extra -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges
Tasks over complete subtrees of layout of one worker's share of its cells, or of a smaller power of two of it when those end the last wave sooner.
def decide_whole source · line 136 · raw
@+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+workers:U32 -> @+whole:U32 -> @+rows:F32 -> @+steps:F32 -> @+extra:Extra -> Decision
The decision over the pieces of a grid whose tasks hold runs of whole cells. rows and steps count one cell of the serial work.
def decide source · line 142 · raw
@+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+workers:U32 -> @+rows:F32 -> @+steps:F32 -> @extra:Extra -> Decision
def decide_copy source · line 147 · raw
@+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+workers:U32 -> @+bytes_per_cell:F32 -> Decision
The decision over the pieces of a grid whose cells a block copy copies, bytes_per_cell bytes a cell.
def cuts source · line 160 · raw
@+context:Cutting -> @+count:U32 -> Bool
Whether a range of count cells is cut.
def cut_range source · line 164 · raw
@fuel:Nat -> @cut:Bool -> @+context:Cutting -> @+first:U32 -> @+count:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges
def cut_leaf source · line 173 · raw
@context:Cutting -> @first:U32 -> @count:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges
def cut_join source · line 178 · raw
@context:Cutting -> @left_ranges:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @right_ranges:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @left:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @right:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges
def starts_within source · line 182 · raw
@tasks:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @+first:U32 -> @+count:U32 -> Bool
Whether a range of tasks starts inside the cells [first, first + count).
def crossed_leaf source · line 188 · raw
@tasks:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @first:U32 -> @count:U32 -> U32
The cells of a piece that a task boundary crosses: tasks compute its parts.
def crossed_join source · line 193 · raw
@tasks:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @left_ranges:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @right_ranges:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @left:U32 -> @right:U32 -> U32
def plan_ns source · line 198 · raw
@+workers:U32 -> @+cell_ns:F32 -> @config:0xa2af805348d03b11eb853850859654f6/kernel_cost.Configuration -> @extra:Extra -> @+total:U32 -> @found:Size -> F32
What the tasks of a layout cost in parallel; one task costs more than the serial plan.
def picked source · line 204 · raw
@+workers:U32 -> @+serial_ns:F32 -> @+whole_ns:F32 -> @+cut_ns:F32 -> @+whole_layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @+cut_layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> Decision
The cheapest of the serial plan, the tasks of whole pieces and the tasks of cut pieces.
def decide_cut_with source · line 212 · raw
@+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+workers:U32 -> @+whole:U32 -> @+cell_ns:F32 -> @+cut_cell_ns:F32 -> @+config:0xa2af805348d03b11eb853850859654f6/kernel_cost.Configuration -> @+extra:Extra -> Decision
The cut plan cuts the whole range of the grid, so its tasks share the cells evenly whatever the pieces. A piece that a task boundary crosses costs every one of its cells cut_cell_ns more: the input a part without its own pieces copies and the copy of the part into the piece.
def decide_cut source · line 225 · raw
@+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+workers:U32 -> @+whole:U32 -> @+rows:F32 -> @+steps:F32 -> @+cut_cell_ns:F32 -> @extra:Extra -> Decision
The decision over the pieces of a grid that may cut its cells into parts of whole units of a grain or more, when that plan costs least.
def decide_over source · line 230 · raw
@+layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> @+count:U32 -> @+workers:U32 -> @+whole:U32 -> @+rows:F32 -> @+steps:F32 -> Decision
The decision over ranges whose tasks hold runs of whole cells.
def virtual_first source · line 263 · raw
@+step:U32 -> @+offset:U32 -> @+mirrored:Bool -> @+divisor:U32 -> @+low:U32 -> @+high:U32 -> U32
def virtual_last source · line 266 · raw
@+step:U32 -> @+offset:U32 -> @+mirrored:Bool -> @+width:U32 -> @+divisor:U32 -> @+low:U32 -> @+high:U32 -> U32
def clamp source · line 269 · raw
@+value:U32 -> @+low:U32 -> @+high:U32 -> U32
def placed source · line 272 · raw
@clamped:Bool -> @+first:U32 -> @+last:U32 -> @+shift:U32 -> @+bound:U32 -> @+source_block:U32 -> Footprint
def range_footprint source · line 285 · raw
@+read:Source -> @+low:U32 -> @+high:U32 -> Footprint
The source blocks that the target indices from low to high read.
def block_footprint source · line 291 · raw
@+read:Source -> @+extent:U32 -> @+block:U32 -> @+index:U32 -> Footprint
def joined source · line 298 · raw
@+found:Footprint -> @current:Class -> Class
def started source · line 305 · raw
@+index:U32 -> @+found:Footprint -> Class
def overlapping source · line 310 · raw
@+found:Footprint -> @+current:Class -> Bool
Two runs share a source block only when both read one.
def stepped source · line 315 · raw
@overlap:Bool -> @+index:U32 -> @+found:Footprint -> @current:Class -> @done:List<&2, Class> -> Walk
def walk_step source · line 320 · raw
@+index:U32 -> @+found:Footprint -> @walk:Walk -> Walk
def reversed_classes source · line 324 · raw
@classes:List<&2, Class> -> @done:List<&2, Class> -> List<&2, Class>
def walked source · line 329 · raw
@remaining:Nat -> @+read:Source -> @+extent:U32 -> @+block:U32 -> @+index:U32 -> @walk:Walk -> List<&2, Class>
def target_blocks source · line 336 · raw
@+extent:U32 -> @+block:U32 -> U32
def read_classes_when source · line 341 · raw
@empty:Bool -> @+read:Source -> @+extent:U32 -> @+block:U32 -> List<&2, Class>
No target block has no class. The walk runs only when there is a block: both arguments of a Bool.pick run, and the count of the rest wraps at zero.
def read_classes source · line 346 · raw
@+read:Source -> @+extent:U32 -> @+block:U32 -> List<&2, Class>
def whole_class source · line 349 · raw
@+extent:U32 -> @+block:U32 -> List<&2, Class>
def stepped_classes source · line 352 · raw
@still:Bool -> @+read:Source -> @+extent:U32 -> @+block:U32 -> List<&2, Class>
def classes source · line 360 · raw
@+reading:Reading -> List<&2, Class>
The classes of one target axis for one source: maximal runs of target blocks whose source blocks overlap. A step of zero or an unread axis is one class.
def head_steps source · line 377 · raw
@extents:List<&2, U32> -> @strides:List<&2, U32> -> @+stride:U32 -> Bool
Whether the first axis of extents, of stride own, is the one a target stride steps.
def stepped_on source · line 382 · raw
@extents:List<&2, U32> -> @strides:List<&2, U32> -> @coordinates:List<&2, U32> -> @found:Bool -> @+stride:U32 -> @+axis:U32 -> Stepped
def stepped_axis source · line 388 · raw
@+extents:List<&2, U32> -> @coordinates:List<&2, U32> -> @+stride:U32 -> @+axis:U32 -> Stepped
def source_reading source · line 392 · raw
@+source_grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+extent:U32 -> @+block:U32 -> @+reversed:Bool -> @found:Stepped -> Reading
def unread source · line 403 · raw
@+extent:U32 -> @+stride:U32 -> Bool
A target axis reads no source axis when it repeats one index or has only one: the offset alone places it.
def readings source · line 408 · raw
@+source:List<&2, U32> -> @+source_grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+target_grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+coordinates:List<&2, U32> -> @axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis> -> @+reversed:List<&2, Bool> -> @+axis:U32 -> List<&2, Reading>
How every target axis of a view reads its one source, whose offset has the source coordinates coordinates.
def read_axes source · line 419 · raw
@readings:List<&2, Reading> -> List<&2, U32>
The source axes the readings read, in target order.
def holds source · line 425 · raw
@axes:List<&2, U32> -> @+axis:U32 -> Bool
def distinct source · line 430 · raw
@axes:List<&2, U32> -> Bool
def crossing source · line 435 · raw
@readings:List<&2, Reading> -> Bool
def separable source · line 443 · raw
@readings:List<&2, List<&2, Reading>> -> Bool
Every source reads each of its axes from at most one target axis, and no target axis reads across source axes.
def class_starts source · line 450 · raw
@classes:List<&2, Class> -> List<&2, U32>
def all_hold source · line 455 · raw
@lists:List<&2, List<&2, U32>> -> @+value:U32 -> Bool
def runs source · line 467 · raw
@starts:List<&2, U32> -> @+blocks:U32 -> List<&2, Class>
def starts_of source · line 473 · raw
@readings:List<&2, Reading> -> List<&2, List<&2, U32>>
def common_runs source · line 478 · raw
@starts:List<&2, List<&2, U32>> -> @+blocks:U32 -> List<&2, Class>
def reading_blocks source · line 483 · raw
@readings:List<&2, Reading> -> U32
def axis_classes source · line 490 · raw
@+readings:List<&2, Reading> -> List<&2, Class>
The classes of one target axis common to every source: a run ends where it ends for every source, so no two classes share a block of any source.
def heads source · line 493 · raw
@lists:List<&2, List<&2, Reading>> -> List<&2, Reading>
def tails source · line 499 · raw
@lists:List<&2, List<&2, Reading>> -> List<&2, List<&2, Reading>>
def counted source · line 509 · raw
@+list:List<&2, Class> -> Classes
def class_lists source · line 512 · raw
@remaining:Nat -> @+readings:List<&2, List<&2, Reading>> -> List<&2, Classes>
def target_rank source · line 517 · raw
@readings:List<&2, List<&2, Reading>> -> Nat
def count_of source · line 527 · raw
@lists:List<&2, Classes> -> U32
def components_of source · line 532 · raw
@+readings:List<&2, List<&2, Reading>> -> Components
def components source · line 538 · raw
@+source:List<&2, U32> -> @+source_grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+target_grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+view:0xa2af805348d03b11eb853850859654f6/tensor_view.View -> @+reversed:List<&2, Bool> -> Components
The components of a view of one source.
def components_count source · line 542 · raw
@components:Components -> U32
def class_at source · line 546 · raw
@classes:List<&2, Class> -> @index:Nat -> Class
def chosen_into source · line 556 · raw
@axis:Classes -> @inner:Chosen -> Chosen
def chosen_from source · line 562 · raw
@lists:List<&2, Classes> -> @+index:U32 -> Chosen
def chosen_classes source · line 567 · raw
@chosen:Chosen -> List<&2, Class>
def chosen source · line 573 · raw
@lists:List<&2, Classes> -> @+index:U32 -> List<&2, Class>
The class of every target axis of one component; the last axis varies fastest.
def readings_at source · line 576 · raw
@lists:List<&2, List<&2, Reading>> -> @index:Nat -> List<&2, Reading>
def found_footprint source · line 588 · raw
@found:Bool -> @+read:Source -> @+extent:U32 -> @+block:U32 -> @+first:U32 -> @+count:U32 -> @later:Maybe<&2, Footprint> -> Maybe<&2, Footprint>
def read_footprint source · line 597 · raw
@readings:List<&2, Reading> -> @classes:List<&2, Class> -> @+axis:U32 -> Maybe<&2, Footprint>
The source blocks a source axis is read at through a component's classes, when a target axis reads it.
def box_span source · line 608 · raw
@found:Maybe<&2, Footprint> -> @+extent:U32 -> @+block:U32 -> @+coordinate:U32 -> Span
The indices of a source axis a component reads: the blocks of its classes, none, or the block that holds the fixed index of an axis no target axis reads.
def boxed source · line 617 · raw
@+readings:List<&2, Reading> -> @+classes:List<&2, Class> -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @extents:List<&2, U32> -> @coordinates:List<&2, U32> -> @+axis:U32 -> List<&2, Span>
def whole_spans source · line 623 · raw
@extents:List<&2, U32> -> List<&2, Span>
def box_when source · line 628 · raw
@separate:Bool -> @+readings:List<&2, Reading> -> @+classes:List<&2, Class> -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+extents:List<&2, U32> -> @+offset:U32 -> List<&2, Span>
def source_box source · line 637 · raw
@+components:Components -> @+source:U32 -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+extents:List<&2, U32> -> @+offset:U32 -> @+index:U32 -> List<&2, Span>
The box of source source that component index reads: per source axis the indices it reads, none when the component reads nothing of it. offset is the source cell whose coordinates fix the axes no target axis reads. One component of an inseparable operation reads every source whole.
def span_count source · line 641 · raw
@spans:List<&2, Span> -> U32
def piece_extents source · line 648 · raw
@extents:List<&2, U32> -> @+prefix:U32 -> @+per:U32 -> @+axis:U32 -> List<&2, U32>
The extents of the pieces of a grid as an index: the prefix axes but the last, then the pieces of one outer index.
def piece_at source · line 655 · raw
@spans:List<&2, Span> -> @extents:List<&2, U32> -> @+index:U32 -> @+value:U32 -> U32
Piece index of position index in the row-major order of spans.
def pieces_listed source · line 662 · raw
@remaining:Nat -> @+spans:List<&2, Span> -> @+extents:List<&2, U32> -> @+index:U32 -> @done:List<&2, U32> -> List<&2, U32>
def pieces_in source · line 671 · raw
@+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+cells:List<&2, U32> -> @+spans:List<&2, Span> -> List<&2, U32>
The pieces whose blocks lie in the block spans of the prefix axes, in order. A grid without prefix axes is one piece.
def block_spans source · line 677 · raw
@spans:List<&2, Span> -> @+prefix:U32 -> @+units:U32 -> @+axis:U32 -> List<&2, Span>
The block spans of the prefix axes that an index box covers.
def box_pieces source · line 687 · raw
@+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+cells:List<&2, U32> -> @+box:List<&2, Span> -> List<&2, U32>
The source pieces a source box holds, in source order; an empty box holds none.
def target_spans source · line 691 · raw
@classes:List<&2, Class> -> @+prefix:U32 -> @+axis:U32 -> List<&2, Span>
def whole_blocks source · line 697 · raw
@extents:List<&2, U32> -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+prefix:U32 -> @+axis:U32 -> List<&2, Span>
def target_when source · line 703 · raw
@separate:Bool -> @+classes:List<&2, Class> -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+cells:List<&2, U32> -> @+prefix:U32 -> List<&2, U32>
def target_pieces source · line 709 · raw
@+components:Components -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+cells:List<&2, U32> -> @+index:U32 -> List<&2, U32>
The target pieces of component index, in target order.
def nth source · line 716 · raw
@values:List<&2, U32> -> @+index:U32 -> U32
def strides_of source · line 721 · raw
@extents:List<&2, U32> -> List<&2, U32>
def index_ranges source · line 727 · raw
@depth:Nat -> @single:Bool -> @+first:U32 -> @+count:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges
A left-complete tree of the indices [first, first + count), one index a leaf.
def component_ranges source · line 736 · raw
@+count:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges
def component_tasks source · line 740 · raw
@+count:U32 -> @+workers:U32 -> 0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges
Complete subtrees of the components joined up to one worker's share of them.
def classes_pieces source · line 746 · raw
@classes:List<&2, Class> -> U32
The target pieces of a component: the product of the extents of its classes.
def pieces_from source · line 754 · raw
@fuel:Nat -> @+lists:List<&2, Classes> -> @+index:U32 -> @+total:U32 -> U32
The target pieces of the components from index on, count of them.
def component_size_leaf source · line 759 · raw
@lists:List<&2, Classes> -> @first:U32 -> @count:U32 -> Size
def component_size source · line 770 · raw
@separate:Bool -> @+total:U32 -> @+lists:List<&2, Classes> -> @+layout:0xa2af805348d03b11eb853850859654f6/tensor_pieces.Ranges -> Size
The tasks and the cells of the largest; one component holds every cell.
def decide_components source · line 781 · raw
@+total:U32 -> @+components:Components -> @+workers:U32 -> @+rows:F32 -> @+steps:F32 -> Decision
The decision for the components of a target of total cells. Its tasks group components for the waves of the pool as the tasks of pieces do, each component taken as an equal share of the cells. rows and steps count what a target cell adds to its move.
def piece_cells source · line 790 · raw
@+extents:List<&2, U32> -> List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_view.Axis>
The view of a piece's own cells in row-major order.
def axis_cuts source · line 806 · raw
@segments:List<&2, Segment> -> @+low:U32 -> @+extent:U32 -> @+source_stride:U32 -> @+piece_stride:U32 -> List<&2, Cut>
def extended_partial source · line 820 · raw
@cuts:List<&2, Cut> -> @+axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_move.Axis> -> @+source:U32 -> @+target:U32 -> @later:List<&2, Partial> -> List<&2, Partial>
def extended source · line 827 · raw
@partials:List<&2, Partial> -> @+cuts:List<&2, Cut> -> List<&2, Partial>
def placed_axes source · line 832 · raw
@segments:List<&2, List<&2, Segment>> -> @coordinates:List<&2, U32> -> @extents:List<&2, U32> -> @source_strides:List<&2, U32> -> @piece_strides:List<&2, U32> -> @partials:List<&2, Partial> -> List<&2, Partial>
def reversed_axes source · line 839 · raw
@axes:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_move.Axis> -> @done:List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_move.Axis> -> List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_move.Axis>
def parts_of source · line 844 · raw
@partials:List<&2, Partial> -> List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_move.Part>
def placements source · line 851 · raw
@+segments:List<&2, List<&2, Segment>> -> @+source:List<&2, U32> -> @+grid:0xa2af805348d03b11eb853850859654f6/tensor_grid.Grid -> @+cells:List<&2, U32> -> @+first:U32 -> @+count:U32 -> List<&2, 0xa2af805348d03b11eb853850859654f6/tensor_move.Part>
The parts of the target piece of first cell first and count cells that one source of cell extents source places: per axis the segments of the source.