fastlib / fCWT

The fast Continuous Wavelet Transform (fCWT) is a library for fast calculation of CWT.
Apache License 2.0
263 stars 53 forks source link

Fix for #8 #19

Closed felixdollack closed 1 year ago

felixdollack commented 1 year ago

Free fCWT input after plan has been executed and use aligned_free for IHat and O1. This fixes the segfault (mentioned in #8) and avoids corrupted heap memory.

fastlib commented 1 year ago

Thanks! Did not encountered this issue on my Intel Macbook.

lschneiderbauer commented 1 year ago

Hi, a question to that. For the WIN-version it's clear we need _aligned_free, but where is the (non-windows version) "aligned_free" coming from? It doesn't seem to be C++ -standard, "free" is supposed to work for non-windows architectures.

lschneiderbauer commented 1 year ago

Also, imho, we need an aligned mother wavelet (Morlet::mother) since it's used in conjunction with _mm256_set_ps which requires aligned arguments. And because of that also a similar "aligned free" in the destructor (_aligend_free for Windows, and otherwise free)

felixdollack commented 1 year ago

I simply mirrored this part: https://github.com/fastlib/fCWT/blob/e6e6c15303a4ade9a882bcd2cf2190d4f738bda0/src/fcwt/fcwt.cpp#L432-L439 I did not actually test it on macOS, since cmake is unable to find open_mp after the upgrade of fCWT to 2.0.