TensorBandPool.parallel: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor_band_pool.bend as TensorBandPool Lines 30-44 of stelliferous@0.0.2.0/tensor_band_pool.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor_band_pool.bend&start_line=30&end_line=44 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 # Bytes price loading, storing and the loop that moves them (copy_byte_ns is # measured on copy loops); operations count the rest. Per sample # (Access.read_line and the operation): an offset and a subtraction, one bound # check, a two-operation index, the padding select and the compare-and-select # maximum: 8. Each line adds ten for its origin (Access.line_at). An output is # one line along the rows; the lines along the columns are one for every # window row, stride for every output row. def parallel(window: BandWindow.Geometry,workers: U32,size: BandSchedule.Size) -> Bool: BandWindow.Geometry{Bands.Geometry{batch,channels,ih,iw},kernel,stride,padding,oh,ow} = window +config = DefaultCost.configuration() +samples = U32.to_f32(kernel) +lines = (U32.to_f32(stride) + 1.0 : F32) +line_bytes = (samples * 4.0 + 8.0 : F32) +line_operations = (samples * 8.0 + 10.0 : F32) BandSchedule.sized(Bands.Geometry{batch,channels,oh,ow},workers,Cost.element_ns((lines * line_bytes : F32),(lines * line_operations : F32),config),config,size) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_f32 https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/default_kernel_cost.bend&name=configuration https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/kernel_cost.bend&name=element_ns 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_schedule.bend&name=Size https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_band_schedule.bend&name=sized https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_band_window.bend&name=Geometry