Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

AddProduct

Adds product of two vectors to the accumulator vector.

Syntax

Case 1. Operations on floating point data.

IppStatus ippsAddProduct_32f(const Ipp32f* pSrc1, const Ipp32f* pSrc2, Ipp32f* pSrcDst, int len);

IppStatus ippsAddProduct_64f(const Ipp64f* pSrc1, const Ipp64f* pSrc2, Ipp64f* pSrcDst, int len);

IppStatus ippsAddProduct_32fc(const Ipp32fc* pSrc1, const Ipp32fc* pSrc2, Ipp32fc* pSrcDst, int len);

IppStatus ippsAddProduct_64fc(const Ipp64fc* pSrc1, const Ipp64fc* pSrc2, Ipp64fc* pSrcDst, int len);

Case 2. Operations on integer data with scaling.

IppStatus ippsAddProduct_16s_Sfs(const Ipp16s* pSrc1, const Ipp16s* pSrc2, Ipp16s* pSrcDst, int len, int scaleFactor);

IppStatus ippsAddProduct_32s_Sfs(const Ipp32s* pSrc1, const Ipp32s* pSrc2, Ipp32s* pSrcDst, int len, int scaleFactor);

IppStatus ippsAddProduct_16s32s_Sfs(const Ipp16s* pSrc1, const Ipp16s* pSrc2, Ipp32s* pSrcDst, int len, int scaleFactor);

Include Files

ipps.h

Domain Dependencies

Headers: ippcore.h, ippvm.h

Libraries: ippcore.lib, ippvm.lib

Parameters

pSrc1, pSrc2

Pointers to the source vectors.

pSrcDst

Pointer to the destination accumulator vector.

len

The number of elements in the vectors.

scaleFactor

Scale factor, refer to Integer Scaling.

Description

This function multiplies each element of the source vector pSrc1 by the corresponding element of the vector pSrc2, and adds the result to the corresponding element of the accumulator vector pSrcDst as given by:

pSrcDst[n ] = pSrcDst[n ] + pSrc1[n ] * pSrc2[n ], 0 n < len.

Functions with Sfs suffixes perform scaling of the result value in accordance with the scaleFactor value. If the output value exceeds the data range, the result becomes saturated.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when any of the specified pointers is NULL.

ippStsSizeErr

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