[Numpy-discussion] numpy arrays, data allocation and SIMD alignement

David Cournapeau david at ar.media.kyoto-u.ac.jp
Fri Aug 3 23:28:34 EDT 2007


Andrew Straw wrote:
> Dear David,
>
> Both ideas, particularly the 2nd, would be excellent additions to numpy. 
> I often use the Intel IPP (Integrated Performance Primitives) Library 
> together with numpy, but I have to do all my memory allocation with the 
> IPP to ensure fastest operation. I then create numpy views of the data. 
> All this works brilliantly, but it would be really nice if I could 
> allocate the memory directly in numpy.
>
> IPP allocates, and says it wants, 32 byte aligned memory (see, e.g. 
> http://www.intel.com/support/performancetools/sb/CS-021418.htm ). Given 
> that fftw3 apparently wants 16 byte aligned memory, my feeling is that, 
>   if the effort is made, the alignment width should be specified at 
> run-time, rather than hard-coded.
I think that doing it at runtime would be overkill, no ? I was thinking 
about making it a compile option. Generally, at the ASM level, you need 
16 bytes alignment (for instructions like movaps, which takes 16 bytes 
in memory and put it in the SSE registers), this is not just fftw. Maybe 
the 32 bytes alignment is useful for cache reasons, I don't know.

I don't think it would be difficult to implement and validate; what I 
don't know at all is the implication of this at the binary level, if any.

cheers,

David



More information about the NumPy-Discussion mailing list