def assembled

stelliferous@0.0.2.0 · tensor_band_window.bend:83

import stelliferous@0.0.2.0/tensor_band_window.bend as TensorBandWindow
import Base
import stelliferous@0.0.2.0/tensor_band.bend as Bands
import stelliferous@0.0.2.0/storage_buffer.bend as Storage

83# The window rows of every channel, stored contiguously. A window equal to
84# the core (for example a 1x1 stride-1 operation) is the core itself; any
85# other window is the shared range copy of its rows from the upper halo, the
86# core and the lower halo, one contiguous range per channel per source. The
87# three copies are direct calls: a leaf task must not reach a closure.
88def assembled(~Element: Data,exact: Bool,+fill: Element,+geometry: Bands.Geometry,+window: Rows,+core: Rows,+above: Rows,+below: Rows,
89  core_buffer: Storage.Buffer<Element>,above_buffer: Storage.Buffer<Element>,below_buffer: Storage.Buffer<Element>) -> Storage.Buffer<Element>:
90  match exact:
91    case True{}: core_buffer
92    case False{}:
93      Rows{+window_first,+window_rows} = window
94      Rows{core_first,core_rows} = core
95      Rows{above_first,above_rows} = above
96      Rows{below_first,below_rows} = below
97      copied_window(~Element,Bands.range_leaf(~Element,geometry,window_first,window_rows,0,below_first,below_rows,below_buffer,
98        copied_window(~Element,Bands.range_leaf(~Element,geometry,window_first,window_rows,0,core_first,core_rows,core_buffer,
99          copied_window(~Element,Bands.range_leaf(~Element,geometry,window_first,window_rows,0,above_first,above_rows,above_buffer,
100            Bands.allocate(~Element,fill,Bands.local_count(geometry,window_rows))))))))

Uses (8)

Used by (1)