Developer Reference

  • 2020
  • 10/21/2020
  • Public Content
Contents

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 the
pSrc[0]
element, index of
pSrc[n]
is equal to
srcIndex+n
.
srcLen
Number of elements in the source vector.
pDstValue
Maximum values found by the function.
dstIndex
Indexes of maximum values.
dstLen
Number of
K
values to be returned, the function returns
min(K, dstLen)
elements.
hint
Parameter to choose the optimization that is most suitable for the
srcLen+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 is
NULL
.
ippStsSizeErr
Indicates an error when at least one of the
srcLen
or
dstLen
values is less than, or equal to zero.
ippStsBadArgErr
Indicates an error when the
hint
value is not supported.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804