KernelBandPlanning.select: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/kernel_band_planning.bend as KernelBandPlanning Lines 122-128 of stelliferous@0.0.2.0/kernel_band_planning.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/kernel_band_planning.bend&start_line=122&end_line=128 import Base import stelliferous@0.0.2.0/kernel_cost.bend as Cost import stelliferous@0.0.2.0/kernel_planning.bend as KernelPlanning import stelliferous@0.0.2.0/tensor_band.bend as Bands import stelliferous@0.0.2.0/tensor_band_window.bend as BandWindow # Grain bounds the operation's work; the two wake rounds are charged separately. def select(+work: KernelPlanning.Work,+window: BandWindow.Geometry,workers: U32,+config: Cost.Configuration) -> Plan: match work window: case KernelPlanning.Work{positions,inner,rows,owners,KernelPlanning.Geometry{channels,+height,width,k,s,p,ow},activation} BandWindow.Geometry{Bands.Geometry{batch,ci,h,w},kernel,stride,padding,oh,owidth}: +workers = U32.max(1,U32.min(workers,858993459)) candidates(31n,U32.is_lt(1,workers) && U32.is_le(2,height),1,2,(workers * 5 : U32),workers,batch,height,work,window,config, Plan{0,False{},dense_baseline(work,window,config)}) Uses (16): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and 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_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt 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_band_planning.bend&name=Plan https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/kernel_band_planning.bend&name=candidates https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/kernel_band_planning.bend&name=dense_baseline 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=Geometry 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/tensor_band.bend&name=Geometry https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_band_window.bend&name=Geometry