A high-performance general-purpose compute library

Scan an array (generalized) over a given dimension, according to an array of keys. More...

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 to scan an array (generalized) over a given dimension, according to an array of keys. 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 to scan an array (generalized) over a given dimension, according to an array of keys. More...
 

Detailed Description

Scan an array (generalized) over a given dimension, according to an array of keys.

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 to scan an array (generalized) over a given dimension, according to an array of keys.

Parameters
[out]outscan
[in]keykeys array
[in]ininput array
[in]dimdimension along which the scan occurs
[in]optype of binary operation used
[in]inclusive_scanflag specifying whether the scan is inclusive
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ scanByKey()

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

C++ Interface to scan an array (generalized) over a given dimension, according to an array of keys.

Parameters
[in]keykeys array
[in]ininput array
[in]dimdimension along which the scan occurs, 0 denotes the first non-singleton dimension
[in]optype of binary operation used
[in]inclusive_scanflag specifying whether the scan is inclusive
Returns
scan