A high-performance general-purpose compute library

Locate the indices of the non-zero values in an array. More...

Functions

AFAPI array where (const array &in)
 C++ Interface to locate the indices of the non-zero values in an array. More...
 
AFAPI af_err af_where (af_array *idx, const af_array in)
 C Interface to locate the indices of the non-zero values in an array. More...
 

Detailed Description

Locate the indices of the non-zero values in an array.

Output type is u32.

The locations are provided by flattening the input into a linear array.

Function Documentation

◆ af_where()

AFAPI af_err af_where ( af_array idx,
const af_array  in 
)

C Interface to locate the indices of the non-zero values in an array.

Parameters
[out]idxlinear indices where in is non-zero
[in]ininput array
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ where()

AFAPI array where ( const array in)

C++ Interface to locate the indices of the non-zero values in an array.

Parameters
[in]ininput array
Returns
linear indices where in is non-zero