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

ID 790148
Date 3/22/2024
Public
Document Table of Contents

Copy

Copies the contents of one vector into another.

Syntax

IppStatus ippsCopy_8u(const Ipp8u* pSrc, Ipp8u* pDst, int len);

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

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

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

IppStatus ippsCopy_64s(const Ipp64s* pSrc, Ipp64s* pDst, int len);

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

IppStatus ippsCopy_16sc(const Ipp16sc* pSrc, Ipp16sc* pDst, int len);

IppStatus ippsCopy_32sc(const Ipp32sc* pSrc, Ipp32sc* pDst, int len);

IppStatus ippsCopy_32fc(const Ipp32fc* pSrc, Ipp32fc* pDst, int len);

IppStatus ippsCopy_64sc(const Ipp64sc* pSrc, Ipp64sc* pDst, int len);

IppStatus ippsCopy_64fc(const Ipp64fc* pSrc, Ipp64fc* pDst, 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.

len

Number of elements to copy.

Description

This function copies the first len elements from a source vector pSrc into a destination vector pDst.

ippsCopy_1u. This function flavor copies elements of a vector that has a 8u data type. It means that each byte consists of eight consecutive elements of the vector (1 bit per element). You need to specify the start position of the source and destination vectors in the srcBitOffset and dstBitOffset parameters, respectively. The bit order of each byte is inverse to the element order. It means that the first element in a vector represents the last (seventh) bit of the first byte in a vector, as shown in the figure below.

Bit Layout for the Function ippsCopy_1u.

NOTE:

These functions perform only copying operations described above and are not intended to move data. Their behavior is unpredictable if source and destination buffers are overlapping. To move data, use ippsMove.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

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

ippStsSizeErr

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

Example

The example below shows how to use the ippsCopy function.

IppStatus copy(void) {
       char src[] = "to be copied\0";
       char dst[256];
       return ippsCopy_8u(src, dst, strlen(src)+1);
  } 

See Also