[email protected] writes:

> On Sun, Dec 1, 2013 at 3:18 PM, Dima Kogan <[email protected]> wrote:
>> Chris Marshall <[email protected]> writes:
>>
>>> which suggests that it should work and that the crash is
>>> from some other place.  Does the piddle data change
>>> alignment between one call and the next?  If that were the
>>> case it might explain the problem.
>>>
>>> I think a feature request for improved memory allocation
>>> is definitely something of interest for PDL going forwards.
>>>
>>> However, it is invasive enough, low level, and very
>>> tricky to debug and get right so would need to be
>>> implemented and verified fully and extensively before
>>> any merge into the release PDL.  If you had a branch
>>> with a work-in-progress, we could always push a
>>> CPAN developers release from that instead of master.
>>>
>>> If the problem is changing alignment in PDL (maybe from
>>> the make physical stuff), you might work around the
>>> problem by checking alignment and then correcting it
>>> at runtime if needed.

Hi.

I made the changes I was thinking about, and the main patch is available
in a private branch for your perusal:

 https://github.com/dkogan/PDL/commit/3747821420bb6291484511e5de65d47c120970bf

This patch changes the PDL memory allocator to produce 16-byte-aligned
memory. I think we can all agree that this patch is very self-contained
and non-invasive. There's a second patch in that branch ('alignment'),
but it's more cosmetic than anything else.

With this branch all PDL tests pass on 64- and 32-bit POSIX boxes.
Furthermore, all PDL::FFTW3 tests pass as well.

The main call is 'memalign', which almost certainly has a different name
in windows, so the code probably doesn't work as is there. Should be
very easy to fix.

So yeah, I propose a developer branch release of this first, to test on
more arches. I'm feeling confident that this will mostly just work, but
not confident enough to push directly into master :)

As for fixing PDL::FFTW3 to work even without this, I just don't think
it's worth the effort. As it stands, it's only broken on 32-bit boxes,
and requiring a particular minimum version of PDL isn't really that
onerous; most packages do that already.

dima




_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to