def layouts

stelliferous@0.0.2.0 · kernel_band_planning.bend:157

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

157def layouts(remaining: Nat,allowed: Bool,+depth: U32,+tasks: U32,+ceiling: U32,+height: U32,+batch: U32,+previous: Bands.Plan,
158  +work: KernelPlanning.Work,+window: BandWindow.Geometry,+workers: U32,+config: Cost.Configuration,best: LayoutPlan) -> LayoutPlan:
159  match remaining allowed:
160    case 0n allowed: best
161    case 1n+rest False{}: best
162    case 1n+rest True{}:
163      +next_tasks = (tasks * 2 : U32)
164      layouts(rest,U32.is_le(next_tasks,ceiling) && U32.is_le(next_tasks,height),(depth + 1 : U32),next_tasks,ceiling,height,batch,previous,work,window,workers,config,
165        layout_candidate(Bands.image_plan(U32.to_nat(batch),0,U32.to_nat(depth),height),previous,work,window,workers,config,best))

Uses (15)

Used by (1)