def apply_indexed_positive

stelliferous@0.0.2.0 · tensor.bend:451

import stelliferous@0.0.2.0/tensor.bend as Tensor
import Base
import stelliferous@0.0.2.0/tensor_band.bend as Bands
import stelliferous@0.0.2.0/tensor_band_schedule.bend as BandSchedule

451# Empty widths use the existing dense indexed operation after one gather.
452# The choice is made once, before the band scheduler or element loop.
453def apply_indexed_positive(~Element: Data,~operation: U32 -> Element -> Element,positive: Bool,operations: F32,bands: Bands.Bands(~Element),+geometry: Bands.Geometry,
454  +shape: List<&2,U32>,+fill: Element,+workers: U32) -> Tensor<Element>:
455  match positive:
456    case True{}: Banded{BandSchedule.indexed(~Element,~operation,geometry,workers,operations,fill,bands),geometry,shape,fill,Usable{},workers}
457    case False{}:
458      with_dense(~Element,~Tensor<Element>,Banded{bands,geometry,shape,fill,Usable{},workers},
459        storage => shape => fill => status => workers =>
460          apply_indexed_status(~Element,~operation,status,storage,shape,fill,workers))

Uses (11)

Used by (1)