def parallel
stelliferous@0.0.2.0 · tensor_band_pool.bend:30
import stelliferous@0.0.2.0/tensor_band_pool.bend as TensorBandPool
import Base
import stelliferous@0.0.2.0/tensor_access.bend as Access
import stelliferous@0.0.2.0/tensor_band.bend as Bands
import stelliferous@0.0.2.0/tensor_band_window.bend as BandWindow
import stelliferous@0.0.2.0/tensor_band_schedule.bend as BandSchedule
import stelliferous@0.0.2.0/kernel_cost.bend as Cost
import stelliferous@0.0.2.0/default_kernel_cost.bend as DefaultCost
30
31
32
33
34
35
36
37def parallel(window: BandWindow.Geometry,workers: U32,size: BandSchedule.Size) -> Bool:
38 BandWindow.Geometry{Bands.Geometry{batch,channels,ih,iw},kernel,stride,padding,oh,ow} = window
39 +config = DefaultCost.configuration()
40 +samples = U32.to_f32(kernel)
41 +lines = (U32.to_f32(stride) + 1.0 : F32)
42 +line_bytes = (samples * 4.0 + 8.0 : F32)
43 +line_operations = (samples * 8.0 + 10.0 : F32)
44 BandSchedule.sized(Bands.Geometry{batch,channels,oh,ow},workers,Cost.element_ns((lines * line_bytes : F32),(lines * line_operations : F32),config),config,size)