def gather

stelliferous@0.0.2.0 · tensor_band.bend:60

import stelliferous@0.0.2.0/tensor_band.bend as TensorBand
import Base
import stelliferous@0.0.2.0/storage_buffer.bend as Storage
import stelliferous@0.0.2.0/traversal_partition.bend as Partition

60# One allocation is provided by the caller. Each value is copied once, using
61# one contiguous range per channel per band. No intermediate dense images.
62def gather(~Element: Data,+geometry: Geometry,bands: Bands(~Element),output: Storage.Buffer<Element>) -> Storage.Buffer<Element>:
63  match bands:
64    case Partition.Leaf{input,first,rows,details}: gather_leaf(~Element,geometry,first,rows,input,output)
65    case Partition.Fork{left,right}: gather(~Element,geometry,right,gather(~Element,geometry,left,output))

Uses (5)

Used by (2)