Functions

AFAPI array scanByKey (const array &key, const array &in, const int dim=0, binaryOp op=AF_BINARY_ADD, bool inclusive_scan=true)
 C++ Interface generalized scan by key of an array. More...
 
AFAPI af_err af_scan_by_key (af_array *out, const af_array key, const af_array in, const int dim, af_binary_op op, bool inclusive_scan)
 C Interface generalized scan by key of an array. More...
 

Detailed Description

Inclusive or exclusive scan of an array by key

Perform inclusive or exclusive scan using a given binary operation along a given dimension using a key.

Binary operations can be add, mul, min, max as defined by af_binary_op.

Function Documentation

◆ af_scan_by_key()

AFAPI af_err af_scan_by_key ( af_array out,
const af_array  key,
const af_array  in,
const int  dim,
af_binary_op  op,
bool  inclusive_scan 
)

C Interface generalized scan by key of an array.

Parameters
[out]outwill contain scan of the input
[in]keyis the key array
[in]inis the input array
[in]dimThe dimension along which scan is performed
[in]opis the type of binary operations used
[in]inclusive_scanis flag specifying whether scan is inclusive
Returns
AF_SUCCESS if the execution completes properly

◆ scanByKey()

AFAPI array af::scanByKey ( const array key,
const array in,
const int  dim = 0,
binaryOp  op = AF_BINARY_ADD,
bool  inclusive_scan = true 
)

C++ Interface generalized scan by key of an array.

Parameters
[in]keyis the key array
[in]inis the input array
[in]dimThe dimension along which scan is performed
[in]opis the type of binary operations used
[in]inclusive_scanis flag specifying whether scan is inclusive
Returns
the output containing scan of the input