TensorSelect.selected_leaf: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_select.bend as TensorSelect Lines 42-49 of stelliferous@0.0.2.0/tensor_select.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor_select.bend&start_line=42&end_line=49 import Base import stelliferous@0.0.2.0/tensor_lanes.bend as Lanes import stelliferous@0.0.2.0/tensor_band.bend as Bands import stelliferous@0.0.2.0/storage_buffer.bend as Storage import stelliferous@0.0.2.0/traversal_partition.bend as Partition def selected_leaf(geometry: Bands.Geometry,first: U32,rows: U32, input: Bands.Paired,Bands.Paired,Storage.Buffer>>,resource: Unit) -> Bands.Bands(~F32): match input: case Bands.Both{yes,Bands.Both{mask,no}}: +rows = rows Partition.Leaf{Lanes.select(U32.to_nat(Bands.local_count(geometry,rows)),mask,yes,no),first,rows,Unit{}} case Bands.Both{yes,Bands.Only{mask,own_first,own_rows}}: Partition.Leaf{yes,first,rows,Unit{}} case Bands.Only{yes,own_first,own_rows}: Partition.Leaf{yes,own_first,own_rows,Unit{}} Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/storage_buffer.bend&name=Buffer https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_band.bend&name=Bands https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_band.bend&name=Geometry https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_band.bend&name=Paired https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_band.bend&name=local_count https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_lanes.bend&name=select https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/traversal_partition.bend&name=Tree