Are there any requirements that are made by IPP on the data that it handles like alignment and so forth?
Asked
Active
Viewed 984 times
4
-
Generally if you align your data correctly then you'll get better performance from IPP, but it's not mandatory. – Paul R May 15 '12 at 08:33
-
1Regarding memory alignment – is the impact only on the “heading” and “trailing” portions of the buffer, and all the rest works on aligned memory, or does it impact the entire processing? – Dany May 15 '12 at 13:08
-
It depends on what the function does - e.g. if you want to add two vectors then the relative alignment between the two could be significant for all data points, not just the beginning and end. – Paul R May 15 '12 at 13:48
-
In that case, how to provide MathUtils a convenient way to allocate Vectors (and perhaps also row-aligned Matrices) so that we can ensure the best performance ? – Dany May 16 '12 at 07:04
-
1There are quite a few questions on SO already which cover this, e.g. how to override new[]/delete[] to get 16 byte aligned data etc. – Paul R May 16 '12 at 07:06
-
Is there a rational behind the wrapper interface for IPP? – Dany May 23 '12 at 17:12
1 Answers
3
On Windows, with x86 binaries (that's all I used so far), you don't need to align memory, but the userguide_win_ia32.pdf doc has a brief mention of alignment in Chapter 7 (from IPP v6.1):
Memory Alignment
The performance of Intel IPP functions can be significantly different
when operating on aligned or misaligned data. Access to memory is faster
if pointers to the data are aligned. Use the following Intel IPP
functions for pointer alignment, memory allocation and deallocation:
With some of the referenced functions: [see ippMalloc, ippAlignPtr, ippFree, etc...].
The bottom line is, alignment can help with performance, but you won't know to what extent until you profile with and without alignment.

Chris O
- 5,017
- 3
- 35
- 42