- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
Agree. The example on pg. 35 is not clear. The "sizeof" there is very confusing. The "ippsMalloc_*" functions as a parameter take the number of elements. This is why ippsMalloc function has clones with data type suffixes - 8u, 16s, etc.
You may treat, for example, ippsMalloc_32f(n) as ippsMalloc_8u(n * sizeof(Ipp32f)). It's the same.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
what is the parameter 'len' referring to in ippsMalloc_XYZ(int len) function?
does it refer to "number of bytes", or "number" of elements"?
using examples on the reference: https://software.intel.com/en-us/ipp-9.0-ipps-manual-pdf
page 35:
Ipp8u* pBuf = ippsMalloc_8u(8*sizeof(Ipp8u));
seems referring to "number of bytes"
but the example on page 168:
Ipp32f *x = ippsMalloc_32f(1000), mean;
int i;
for(i = 0; i<1000; ++i) x = (float)rand() / RAND_MAX;
seemly referring to "number of elements": here 'array' x has 1000 'elements', and will take 1000*sizeof(Ipp32f), or 4000 bytes!