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) |
| |
The C interface for segsum.
Segmented sum of a set of elements
| 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_out | Output vector (same size of input) If reduce is true, performs inclusive sum for each segment. If reduce is false, performs reduction on each segment. |
| numel | Number of elements in the input |
| d_in | The input vector |
| d_keys | The vector denoting the segments |
| reduce | if true, performs segmented reduction |
| batch | Used for batched inputs (currently needs to be 1) |
| is_baseone | Specifies 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 |
|
) |
| |