def candidates
stelliferous@0.0.2.0 · kernel_band_planning.bend:102
import stelliferous@0.0.2.0/kernel_band_planning.bend as KernelBandPlanning
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
102def candidates(remaining: Nat,allowed: Bool,+depth: U32,+tasks: U32,+ceiling: U32,+workers: U32,+batch: U32,+height: U32,
103 +work: KernelPlanning.Work,+window: BandWindow.Geometry,+config: Cost.Configuration,best: Plan) -> Plan:
104 match remaining allowed:
105 case 0n allowed: best
106 case 1n+rest False{}: best
107 case 1n+rest True{}:
108 +next_tasks = (tasks * 2 : U32)
109 candidates(rest,U32.is_le(next_tasks,ceiling) && U32.is_le(next_tasks,height),(depth + 1 : U32),next_tasks,ceiling,workers,batch,height,
110 work,window,config,initial_candidate(depth,Bands.image_plan(U32.to_nat(batch),0,U32.to_nat(depth),height),workers,work,window,config,best))