Developer Reference for Intel® Integrated Performance Primitives 2018

Abs

Computes absolute values of vector elements.

Syntax

IppStatus ippsAbs_16s(const Ipp16s* pSrc, Ipp16s* pDst, int len);

IppStatus ippsAbs_32s(const Ipp32s* pSrc, Ipp32s* pDst, int len);

IppStatus ippsAbs_32f(const Ipp32f* pSrc, Ipp32f* pDst, int len);

IppStatus ippsAbs_64f(const Ipp64f* pSrc, Ipp64f* pDst, int len);

IppStatus ippsAbs_16s_I(Ipp16s* pSrcDst, int len);

IppStatus ippsAbs_32s_I(Ipp32s* pSrcDst, int len);

IppStatus ippsAbs_32f_I(Ipp32f* pSrcDst, int len);

IppStatus ippsAbs_64f_I(Ipp64f* pSrcDst, int len);

Include Files

ipps.h

Domain Dependencies

Headers: ippcore.h, ippvm.h

Libraries: ippcore.lib, ippvm.lib

Parameters

pSrc

Pointer to the source vector.

pDst

Pointer to the destination vector.

pSrcDst

Pointer to the source and destination vector for in-place operations.

len

Number of elements in the vector.

Description

This function computes the absolute values of each element of the vector pSrc and stores the result in pDst. The in-place flavors of ippsAbs compute the absolute values of each element of the vector pSrcDst and store the result in pSrcDst.

To compute the absolute values of complex data, use the function ippsMagnitudeippsMagnitude.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when the pSrc, pDst, or pSrcDst pointer is NULL.

ippStsSizeErr

Indicates an error when len is less than or equal to 0.

Example

Abs.c

Abs_I.c