fftw icon indicating copy to clipboard operation
fftw copied to clipboard

Can plan executions take &self instead of &mut self?

Open dodomorandi opened this issue 3 years ago • 4 comments

I am asking this, because I am having a hard time trying to check whether this is possible or not. According to this documentation, execution of plans should take a const pointer to the plan (which AFAIK is nearly meaningless in the C world, because you are totally safe (ahem) to change nested values...).

Maybe it could be possible, but I am completely unable to hack through the code of FFTW3 to find the answer by myself. I could not find a similar question, therefore, even if c2c/r2c/c2r really need to use &mut self, at least there is an issue explicitly discussing this.

dodomorandi avatar Aug 01 '21 16:08 dodomorandi

Yes this should definitely work!

miili avatar Oct 24 '21 18:10 miili

Implemented in https://github.com/rust-math/fftw/pull/117

miili avatar Oct 24 '21 18:10 miili

I'm attempting to do this, but getting the error that,

| |_________^ `*mut fftw_sys::fftw_plan_s` cannot be shared between threads safely

As plans don't implement Sync, required by rayon's parallel iterator

Edit, Oh I see it hasn't been merged into master, are there any plans to do this?

skailasa avatar Jul 17 '23 11:07 skailasa

I'd hope! The repo unfortunately looks unmaintained...

miili avatar Jul 17 '23 14:07 miili