For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
sum
def sum[dtype: DType, BN: Int, //, *, width: Int = Int(8)](x: TileTensor[dtype, Layout[*?, *?], MutUntrackedOrigin, address_space=AddressSpace.LOCAL]) -> SIMD[dtype, SIMDLength(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[*?, *?], MutUntrackedOrigin, address_space=AddressSpace.LOCAL]): Local tensor ofBNelements to reduce.
Returns:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!