Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

memset / ippsZero

khalouda
Beginner
602 Views
hi all,
i use memset to initialize structures , for example
if i have an instance of a structure named struct1
i usually write
memset(&struct1,0,sizeof(someStructure));
if i want to do the same using IPP
i tried
ippsZero_8u ( (Ipp8u*) &struct1,sizeof(someStructure));
is this the optimal way ?
i mean if there is a direct way to pass the structure pointer instead of accessing it byte by byte
0 Kudos
1 Reply
Vladimir_Dudnik
Employee
602 Views
Hi,
The function ippsZero_8u is dedicated to work with vector of Ipp8u values, so it was declared in ipps.h as:
IPPAPI ( IppStatus, ippsZero_8u,( Ipp8u* pDst, int len ))
and though, you have to provide pointer to Ipp8u vector. But this does not mean that function will do their work just accessing byte-by-byte. On systems with SIMD instructions available it will perform vectorization inside.
Regards,
Vladimir
0 Kudos
Reply