mreineck / pocketfft

Fork of https://gitlab.mpcdf.mpg.de/mtr/pocketfft to simplify external contributions
BSD 3-Clause "New" or "Revised" License
75 stars 34 forks source link

emulate aligned_alloc for MSVC regardless of declared C++ version #7

Closed ahesford closed 1 year ago

ahesford commented 1 year ago

Recent versions of MSVC (apparently Visual Studio 2017 and later) now advertise more current C++ compliance and are subject to the aligned_alloc bug that was biting MinGW users. The fix for MinGW will have to apply for these clients as well.

mreineck commented 1 year ago

Thanks a lot! I wonder whether I should enable this unconditionally ... in the ducc0 package I'm already doing this (https://github.com/mreineck/ducc/blob/7f022525b0392e82848b10d9393f27c3c51f5654/src/ducc0/infra/aligned_array.h#L64).

ahesford commented 1 year ago

Having a user-settable flag like you do in DUCC seems like a good way to handle this issue.

mreineck commented 1 year ago

To be honest, DUCC0_WORKAROUND_ALIGNED_ALLOC is not meant to be changed by the user. I had this as an internal macro, which is automatically set/unset depending on som other macro checks, and for the moment I'm setting it unconditionally, since that always works and it really makes no measurable difference.