IntelPerformancePrimitivesFFT Failing

I’m trying to use the Intel IPP version of juce::dsp::FFT (via juce::dsp::Convolution) but it’s randomly failing during the createContext call and so falling back to the fallback FFT.

You can see the reinterpret_cast comparison failing here:

But then sometimes it succeeds:

Because this is in a Convolution, multiple FFT instances are created so I get some using IPP and some using the fallback which obviously doesn’t really help much.

The odd thing is, if I comment out that reinterpret_cast line, everything seems to work all the time, the fallback FFT is never instantiated.
Any idea what could be going wrong here or what the cast is even checking for?

Presumably this is checking the buffer and ptr point to the same location so that the unique_ptr frees the correct buffer but do they have to be the same? Or is this some subtle alignment problem with the reinterpret_cast?

Just one bit of extra information, I rely on a 3rd party library which relies on these IPP libs:


Where as the JUCE FFT requires:


I’m not sure what the difference is here or if it’s some kind of symbol clash?

EDIT: Nope, removing those other libs doesn’t make any difference, the cast still fails.

I’m not sure why that check is there. The docs imply that the spec will be placed into the preallocated spec buffer, and I’d assumed that meant at the beginning of the buffer, but apparently that is not the case.

If your code works correctly with the check removed, I think it’s probably safe to depend on the error code returned by the ippsFFTInit call. I’ll remove the additional check.

Thanks for reporting!


Thanks for your patience. This is now on develop: