[Numpy-discussion] Byte aligned arrays
Wed Dec 19 12:48:29 CST 2012
On Wed, Dec 19, 2012 at 6:25 PM, Henry Gomersall <firstname.lastname@example.org> wrote:
> On Wed, 2012-12-19 at 19:03 +0100, Francesc Alted wrote:
>> > Finally, I think there is significant value in auto-aligning the
>> > based on an appropriate inspection of the cpu capabilities (or
>> > alternatively, a function that reports back the appropriate SIMD
>> > alignment). Again, this makes it easier to wrap libraries that may
>> > function with any alignment, but benefit from optimum alignment.
>> Hmm, NumPy seems to return data blocks that are aligned to 16 bytes
>> systems (Linux and Mac OSX):
> That is not true at least under Windows 32-bit. I think also it's not
> true for Linux 32-bit from my vague recollections of testing in a
> virtual machine. (disclaimer: both those statements _may_ be out of
> But yes, under Linux 64-bit I always get my arrays aligned to 16 bytes.
Currently numpy just uses whatever the system malloc() returns, so the
alignment guarantees are entirely determined by your libc.
More information about the NumPy-Discussion