[SciPy-user] numpy aligned memory

Sturla Molden sturla@molden...
Thu Mar 12 10:45:53 CDT 2009


On 3/12/2009 4:05 PM, Andrew Straw wrote:

> Sturla, I just tried your example, and I discovered that for a 2D array,
> it did not align rows on boundaries -- just the first element of the
> first row. 

The whole buffer is aligned, but not every row. The first element on row 
n is contiguous with the last element on row n-1 (with C ordering).


> My understanding is that for image processing with SIMD this
> is desired. For example, Intel IPP allocates images such that each image
> row is 32-byte aligned. (I just checked that Framewave does _not_ do
> this, so maybe times have changed or maybe Framewave just isn't
> optimized in this regard.)
> 
> So, what's your take on having each row aligned? 

In that case we must pad each row (or column with Fortran ordering). 
Sure it can be done. It gets a bit more complex, and wastes a bit more 
memory, but ok I can fix this.

Regards,

Sturla Molden






More information about the SciPy-user mailing list