Find the sum of values in the input. More...
Functions | |
AFAPI array | sum (const array &in, const int dim=-1) |
C++ Interface for sum of elements in an array. More... | |
template<typename T > | |
T | sum (const array &in) |
C++ Interface for sum of all elements in an array. More... | |
AFAPI af_err | af_sum (af_array *out, const af_array in, const int dim) |
C Interface for sum of elements in an array. More... | |
AFAPI af_err | af_sum_all (double *real, double *imag, const af_array in) |
C Interface for sum of all elements in an array. More... | |
Find the sum of values in the input.
This function performs the operation across all batches present in the input simultaneously.
C Interface for sum of elements in an array.
[out] | out | will contain the sum of all values in in along dim |
[in] | in | is the input array |
[in] | dim | The dimension along which the add operation occurs |
C Interface for sum of all elements in an array.
[out] | real | will contain the real part of adding all elements in input in |
[out] | imag | will contain the imaginary part of adding all elements in input in |
[in] | in | is the input array |
imag
is always set to 0 when in
is real C++ Interface for sum of elements in an array.
[in] | in | is the input array |
[in] | dim | The dimension along which the add operation occurs |
dim
dim
is -1 by default. -1 denotes the first non-singleton dimension. T af::sum | ( | const array & | in | ) |
C++ Interface for sum of all elements in an array.
[in] | in | is the input array |
in