~/bend-docscommunity

lanes.bend checks

raw source on the hub · import bend-gpu-kernels@0.1.0.0/lanes.bend as Lanes

Index arithmetic of the kernels: which items a lane runs, and which cells an item owns. Plain safe Bend (no @unsafe), so LAWS.bend can check it; bang.bend and nn.bend compute every write position through these defs.

1 import
import Base

Definitions

def share source · line 6 · raw

@+t:U32 -> @+n:U32 -> @+l:U32 -> Nat

leaf t of l runs items t, t + l, t + 2l, ...: this many of them are below n

def cell source · line 10 · raw

@+i:U32 -> @+w:U32 -> U32

first cell of item i, when every item owns w consecutive cells

def width source · line 16 · raw

@+seg:U32 -> @+nseg:U32 -> U32

def row source · line 19 · raw

@+i:U32 -> @+nseg:U32 -> U32

def col source · line 23 · raw

@+i:U32 -> @+seg:U32 -> @+nseg:U32 -> U32

column of item i's first cell within its row

def first source · line 27 · raw

@+i:U32 -> @+nseg:U32 -> U32

first item of item i's row (where the row's per-segment partials start)

def leads source · line 31 · raw

@+i:U32 -> @+nseg:U32 -> Bool

whether item i is its row's first segment