TopK
TopK
Returns maximum
K
values of an array.Syntax
IppStatus ippsTopK_32f(const Ipp32f
pSrc
, Ipp64s
srcIndex
, Ipp64s
srcLen
, Ipp32f*
pDstValue
, Ipp64s*
pDstIndex
, Ipp64s
dstLen
, IppTopKMode
hint
, Ipp8u*
pBuffer
);
IppStatus ippsTopK_32s(const Ipp32s
pSrc
, Ipp64s
srcIndex
, Ipp64s
srcLen
, Ipp32s*
pDstValue
, Ipp64s*
pDstIndex
, Ipp64s
dstLen
, IppTopKMode
hint
, Ipp8u*
pBuffer
);
Include Files
ipps.h
Domain Dependencies
Headers:
ippcore.h
,
ippvm.h
Libraries:
ippcore.lib
,
ippvm.lib
Parameters
- pSrc
- Pointer to the source vector.
- srcIndex
- Index of thepSrc[0]element, index ofpSrc[n]is equal tosrcIndex+n.
- srcLen
- Number of elements in the source vector.
- pDstValue
- Maximum values found by the function.
- dstIndex
- Indexes of maximum values.
- dstLen
- Number ofKvalues to be returned, the function returnsmin(K, dstLen)elements.
- hint
- Parameter to choose the optimization that is most suitable for thesrcLen+dstlen(K)combination, supported values:ippTopKAuto/ippTopKDirect/ippTopKRadix.
- pBuffer
- Pointer to the work buffer.
Description
This function searches for
dstLen
maximum
values and their indexes in an input vector. The function is
designed to process large input vectors by small blocks, it takes
into account results of previous blocks processing getting maximum
values of pSrc
and pDstValue
and then combining the final results into
pDstValue
. The
srcIndex
parameter stores the index of the
first element pSrc[0]
of each new block, thus supporting the
continuous numbering of elements. Before calling the ippsTopK
function, compute the required buffer size and initialize pDstValue
and pDstIndex
using the ippsTopKGetBufferSize
and ippsTopKInit_32s
functions, respectively.Return Values
- ippStsNoErr
- Indicates no error.
- ippStsNullPtrErr
- Indicates an error when at least one of the pointers isNULL.
- ippStsSizeErr
- Indicates an error when at least one of thesrcLenordstLenvalues is less than, or equal to zero.
- ippStsBadArgErr
- Indicates an error when thehintvalue is not supported.