KernelPlanning.select: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/kernel_planning.bend as KernelPlanning Lines 220-228 of stelliferous@0.0.2.0/kernel_planning.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/kernel_planning.bend&start_line=220&end_line=228 import Base import stelliferous@0.0.2.0/kernel_cost.bend as Cost import stelliferous@0.0.2.0/kernel_window.bend as KernelWindow # workers is the runtime's pool size. As in XNNPACK, several workers take up to # five tasks each, so idle workers pick up the remaining ones; one worker never # splits. Every leaf keeps at least one block and one grain of work, and the # scheduling bound must strictly improve. def select(+work: Work,workers: U32,+budget: Maybe<&2,Nat>,+config: Cost.Configuration) -> Plan: Work{positions,inner,rows,owners,geometry,activation} = work +workers = U32.max(1,U32.min(workers,858993459)) candidates(32n,True{},0,1,Bool.pick(U32,U32.is_eq(workers,1),1,(workers * 5 : U32)),workers,KernelWindow.padded(positions),work,config,budget, Plan{False{},0,0n,0.0}) Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.max https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.min https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/kernel_cost.bend&name=Configuration https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/kernel_planning.bend&name=Plan https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/kernel_planning.bend&name=Work https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/kernel_planning.bend&name=candidates https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/kernel_window.bend&name=padded