accum

- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Functions
accum
Complete List of ArrayFire Functions ArrayFire Functions by Category » Vector Algorithms » | Inclusive scan operations

Perform exclusive sum along specified dimension. More...

## Functions
AFAPI array | accum (const array &in, const int dim=0)
| C++ Interface exclusive sum (cumulative sum) of an array. More...
AFAPI af_err | af_accum (af_array *out, const af_array in, const int dim)
| C Interface exclusive sum (cumulative sum) of an array. More...

## Detailed Description

Perform exclusive sum along specified dimension.

This table defines the return value types for the corresponding input types

Input Type | Output Type
--- | ---
f32, f64, c32, c64 | same as input
s32, u32, s64, u64 | same as input
s16 | s32
u16, u8, b8 | u32

This function performs the operation across all batches present in the input simultaneously.

## Function Documentation

AFAPI array af::accum | ( | const array & | in,
|  | const int | dim = `0`
| ) |  |

C++ Interface exclusive sum (cumulative sum) of an array.

Parameters

  [in] | in | is the input array
  [in] | dim | The dimension along which exclusive sum is performed

Returns
  the output containing exclusive sums of the input

Examples:
  binary_thresholding.cpp.

AFAPI af_err af_accum | ( | af_array * | out,
|  | const af_array | in,
|  | const int | dim
| ) |  |

C Interface exclusive sum (cumulative sum) of an array.

Parameters

  [out] | out | will contain exclusive sums of the input
  [in] | in | is the input array
  [in] | dim | The dimension along which exclusive sum is performed

Returns
  AF_SUCCESS if the execution completes properly