Skip to main content

Mojo function

cumsum

cumsum(dst: Buffer[type, size, address_space=address_space, origin=origin], src: Buffer[type, size])

Computes the cumulative sum of all elements in a buffer. dst[i] = src[i] + src[i-1] + ... + src[0].

Args:

  • dst (Buffer[type, size, address_space=address_space, origin=origin]): The buffer that stores the result of cumulative sum operation.
  • src (Buffer[type, size]): The buffer of elements for which the cumulative sum is computed.