def run_tiled

stelliferous@0.0.2.0 · tensor_indexed.bend:74

import stelliferous@0.0.2.0/tensor_indexed.bend as TensorIndexed
import Base

74# total positions in blocks(context) blocks of size(context) positions. The
75# blocks are used only when they are exactly the total and the total is
76# within the limit; any other count keeps the index function.
77def run_tiled(~Element: Data,~Context: Data,~index: Context -> U32 -> U32,~base: Context -> U32 -> U32,~blocks: Context -> U32,~size: Context -> U32,
78  ~operation: U32 -> Element -> Element,+total: U32,+context: Context,input: Array<Element>,output: Array<Element>) -> Array<Element> & Array<Element>:
79  run_whole(~Element,~Context,~index,~base,~operation,U32.is_le(total,block_limit()) && Nat.is_eq(Nat.mul(U32.to_nat(blocks(context)),U32.to_nat(size(context))),U32.to_nat(total)),
80    blocks(context),size(context),total,context,input,output)

Uses (10)

Used by (3)