For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
sum
def sum[dtype: DType, BN: Int, //, *, width: Int = Int(8)](x: TileTensor[dtype, Layout[TypeList[ComptimeInt[BN]](), TypeList[ComptimeInt[Int(1)]]()], MutUntrackedOrigin, Engine=x.Engine, address_space=AddressSpace.LOCAL]) -> SIMD[dtype, 2]
Reduces a BN-element local tensor into a width-2 SIMD vector via vectorized accumulation.
Parameters:
- βdtype (
DType): Element dtype of the input tensor (inferred). - βBN (
Int): Number of elements in the input tensor; must be divisible bywidth(inferred). - βwidth (
Int): Vectorization width for the accumulation (defaults to 8).
Args:
- βx (
TileTensor[dtype, Layout[TypeList[ComptimeInt[BN]](), TypeList[ComptimeInt[Int(1)]]()], MutUntrackedOrigin, Engine=x.Engine, address_space=AddressSpace.LOCAL]): Local tensor ofBNelements to reduce.
Returns: