kernel_packing_samples.bend checks
raw source on the hub · import stelliferous@0.0.4.0/kernel_packing_samples.bend as Kernel_packing_samples
Pixel reads of an entry whose tile crosses an output row.
1 import
import Base
Types
type PixelAddress source · line 21 · raw
Data
PixelAddress@index:U32 -> @inside:Bool -> PixelAddress
type WindowPixelBlock source · line 33 · raw
Data
Reduction coordinates are invariant across the whole block, at any width.
WindowPixelBlock@position:U32 -> @kernel_row:U32 -> @kernel_column:U32 -> @channel_base:U32 -> @height:U32 -> @width:U32 -> @stride:U32 -> @row_origin:U32 -> @column_origin:U32 -> @output_width:U32 -> @step:U32 -> WindowPixelBlock
Definitions
def masked source · line 4 · raw
@value:F32 -> @inside:Bool -> F32
def mask_pixel source · line 11 · raw
@inside:Bool -> @pair:Pair(Array<F32>, F32) -> Pair(Array<F32>, F32)
def pixel source · line 15 · raw
@input_storage:Array<F32> -> @+output_position:U32 -> @+reduction_index:U32 -> @+input_height:U32 -> @+input_width:U32 -> @+kernel_size:U32 -> @+stride:U32 -> @+padding:U32 -> @+output_width:U32 -> Pair(Array<F32>, F32)
def window_pixel_address source · line 42 · raw
@context:WindowPixelBlock -> @index:Nat -> PixelAddress
Templates
template mask_field source · line 24 · raw
@-Element:Data -> @-field:(@_:Element -> F32) -> @inside:Bool -> @pair:Pair(Array<Element>, Element) -> Pair(Array<Element>, F32)
template read_pixel_address source · line 28 · raw
@-Element:Data -> @-field:(@_:Element -> F32) -> @input:Array<Element> -> @address:PixelAddress -> Pair(Array<Element>, F32)
template window_pixel_block source · line 37 · raw
@-located:(@_:U32 -> @_:U32 -> @_:U32 -> U32) -> @-spread:(@_:U32 -> U32) -> @position:U32 -> @+reduction:U32 -> @+base:U32 -> @+height:U32 -> @+width:U32 -> @+tap_rows:U32 -> @+tap_columns:U32 -> @stride:U32 -> @row_origin:U32 -> @column_origin:U32 -> @output_width:U32 -> @+groups:U32 -> WindowPixelBlock
Where the channel of an entry starts and how far apart its pixels lie.
template read_window_pixel source · line 49 · raw
@-Element:Data -> @-field:(@_:Element -> F32) -> @input:Array<Element> -> @context:WindowPixelBlock -> @index:Nat -> Pair(Array<Element>, F32)
template window_pixel source · line 52 · raw
@-Element:Data -> @-field:(@_:Element -> F32) -> @-located:(@_:U32 -> @_:U32 -> @_:U32 -> U32) -> @-spread:(@_:U32 -> U32) -> @input:Array<Element> -> @position:U32 -> @reduction:U32 -> @base:U32 -> @height:U32 -> @width:U32 -> @tap_rows:U32 -> @tap_columns:U32 -> @stride:U32 -> @row_origin:U32 -> @column_origin:U32 -> @output_width:U32 -> @groups:U32 -> Pair(Array<Element>, F32)