The C interface for segsum. More...

afError af_segsum_S (float *d_out, unsigned numel, const float *d_in, const float *d_keys, bool reduce, unsigned batch, bool is_baseone)
 
afError af_segsum_D (double *d_out, unsigned numel, const double *d_in, const double *d_keys, bool reduce, unsigned batch, bool is_baseone)
 

Detailed Description

The C interface for segsum.

Segmented sum of a set of elements

Function Documentation

afError af_segsum_S ( float *  d_out,
unsigned  numel,
const float *  d_in,
const float *  d_keys,
bool  reduce,
unsigned  batch,
bool  is_baseone 
)
Parameters
d_outOutput vector (same size of input) If reduce is true, performs inclusive sum for each segment. If reduce is false, performs reduction on each segment.
numelNumber of elements in the input
d_inThe input vector
d_keysThe vector denoting the segments
reduceif true, performs segmented reduction
batchUsed for batched inputs (currently needs to be 1)
is_baseoneSpecifies if indices are base one(true) or zero(false)
afError af_segsum_D ( double *  d_out,
unsigned  numel,
const double *  d_in,
const double *  d_keys,
bool  reduce,
unsigned  batch,
bool  is_baseone 
)