# \[FR\] Add IPP support for FFT

**URL:** <https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915>\
**Category:** General JUCE discussion\
**Created:** [February 22, 2019, 12:41am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915 "2019-02-22T00:41:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)\
**Post date:** [February 22, 2019, 12:41am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/1 "2019-02-22T00:41:52Z")

</div>

Please add Intel IPP support for FFT.

See:

> [@Which Intel FFT to use - IPP or MKL?](https://forum.juce.com/t/which-intel-fft-to-use-ipp-or-mkl/23809/5):
>
> It looks like Intel first made IPP with the focus of having the best performance (according to wp v2 is from 2002). I guess they then found out that many users won’t use it rather than FFTW because it isn’t feature complete (nothing that concerns us - JUCE only wraps power-of-2 ffts anyhow), so they released MKL’s FFT at 2003 with the focus of having the same features and API as FFTW, so that FFTW users could use it as a drop-in replacement. But it appears not to be as fast as IPP. EDIT: Corre…

Thanks,

Rail

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [April 17, 2020, 9:55am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/2 "2020-04-17T09:55:23Z")

</div>

This will be added in JUCE 6, and is currently available for preview:

> [@\`juce6\` technical preview branch](https://forum.juce.com/t/juce6-technical-preview-branch/38699/15):
>
> VST3 CC Improvements The VST3 wrapper has been taught to understand a wider variety of Vst::Event types. In particular, it now understands the kLegacyMIDICCOutEvent type, meaning that VST3 plugins can send and receive MIDI CC messages, as well as channel-pressure, pitch-bend, program-change, quarter-frame, and poly-pressure messages. It also fixes an issue where the kPolyPressureEvent was incorrectly being converted to a channel pressure MIDI message. Now, kPolyPressureEvents will be conve…

---

<div class="post-metadata">

**Author:** ![yairadix](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yairadix/32/1114_2.png) [@yairadix](https://forum.juce.com/u/yairadix)\
**Post date:** [April 23, 2020, 8:00am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/3 "2020-04-23T08:00:23Z")

</div>

Great!  
Can you also close the topic like was done for [DrawableText::replaceColour](https://forum.juce.com/t/drawabletext-replacecolour/34050/5) so that the votes go back to the users? So far I’ve manually removed my votes so I can vote for other things but if everyone does it then it would make the list weird (i.e “why did FRs with no votes got implemented while etc”)

---

<div class="post-metadata">

**Author:** ![yairadix](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yairadix/32/1114_2.png) [@yairadix](https://forum.juce.com/u/yairadix)\
**Post date:** [November 30, 2020, 9:10am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/6 "2020-11-30T09:10:49Z")

</div>

Looks like there’s now support for IPP’s FFT since [https://github.com/juce-framework/JUCE/commit/9fa6c195ee419c0be6e7c9c123db70faba795334](https://github.com/juce-framework/JUCE/commit/9fa6c195ee419c0be6e7c9c123db70faba795334), however:

iiuc IPP usage is enabled by the “Use IPP Library” option, which is only available for the Visual Studio exporters. How should one enable it for “Xcode (macOS)” and “Linux Makefile” targets?

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [November 30, 2020, 3:14pm UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/7 "2020-11-30T15:14:10Z")

</div>

Support for linking against IPP’s FFT in the Projucer has only been implemented on Windows. Until now we’ve not had any demand for it on the other platforms.

---

<div class="post-metadata">

**Author:** ![PeterRoos](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@PeterRoos](https://forum.juce.com/u/PeterRoos)\
**Post date:** [November 30, 2020, 3:49pm UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/8 "2020-11-30T15:49:08Z")

</div>

[Edited]

Using Intel’s IPP FFT on MacOS is just a matter of including some paths and lib files to link in your .jucer file.

Thanks for editing Tom!

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [November 30, 2020, 4:29pm UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/9 "2020-11-30T16:29:47Z")

</div>

Apologies, my post wasn’t very clear and I’ve edited it.

We can add support for the other platforms in the Projucer, but, as you’ve said, using IPP on those platforms is pretty straightforward so there hasn’t been much demand.

---

<div class="post-metadata">

**Author:** ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)\
**Post date:** [November 30, 2020, 4:43pm UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/10 "2020-11-30T16:43:10Z")

</div>

I think it should be consistent for both

Rail

---

<div class="post-metadata">

**Author:** ![yairadix](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yairadix/32/1114_2.png) [@yairadix](https://forum.juce.com/u/yairadix)\
**Post date:** [December 1, 2020, 9:16am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/11 "2020-12-01T09:16:09Z")

</div>

> [@t0m](#):
>
> Apologies, my post wasn’t very clear and I’ve edited it.
> 
> We can add support for the other platforms in the Projucer, but, as you’ve said, using IPP on those platforms is pretty straightforward so there hasn’t been much demand.

I think that you’re mixing two separate things:

- User-code using IPP. I’ve used IPP long before JUCE supported it via the Visual Studio Exporter option. This isn’t what I’m talking about
- JUCE’s FFT choosing to use the IPP-based implementation

I already use IPP on all platforms (directly in user code). How to I make JUCE’s FFT use it too?

---

<div class="post-metadata">

**Author:** ![PeterRoos](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@PeterRoos](https://forum.juce.com/u/PeterRoos)\
**Post date:** [December 1, 2020, 9:34am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/12 "2020-12-01T09:34:37Z")

</div>

I use the flag DEFINE \_IPP\_SEQUENTIAL\_STATIC 1 in my Extra Preprocessor definitions (Projucer) and make sure that I also add the correct IPP header path(s) and link the IPP libs I need (like you probably also do).

Check the juce\_FFT source file and see how it will use Intel’s IPP FFT.

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [December 1, 2020, 9:41am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/13 "2020-12-01T09:41:02Z")

</div>

BTW I would not get used to Mac IPP, because its incompatible with ARM-Macs, instead use Apple Accelerate framework, it has almost anything you need.

---

<div class="post-metadata">

**Author:** ![PeterRoos](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@PeterRoos](https://forum.juce.com/u/PeterRoos)\
**Post date:** [December 1, 2020, 9:46am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/14 "2020-12-01T09:46:53Z")

</div>

Yeah, I know and that’s new for me. Thanks

I am working on a project that I picked up again from 2 years ago (with IPP on Mac). I still need to read into this new Apple move…

---

<div class="post-metadata">

**Author:** ![yairadix](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yairadix/32/1114_2.png) [@yairadix](https://forum.juce.com/u/yairadix)\
**Post date:** [December 1, 2020, 11:19am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/15 "2020-12-01T11:19:18Z")

</div>

> [@PeterRoos](#):
>
> I use the flag DEFINE \_IPP\_SEQUENTIAL\_STATIC 1 in my Extra Preprocessor definitions (Projucer)

Note that the user code doesn’t really depends on which of these modes was defined. Why not make JUCE’s IPP-based FFT work if you defined `JUCE_IPP_AVAILABLE`?

---

<div class="post-metadata">

**Author:** ![yairadix](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yairadix/32/1114_2.png) [@yairadix](https://forum.juce.com/u/yairadix)\
**Post date:** [December 1, 2020, 11:33am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/16 "2020-12-01T11:33:54Z")

</div>

> [@chkn](#):
>
> BTW I would not get used to Mac IPP, because its incompatible with ARM-Macs

Yes, I’m actually asking for this so that I could gradually transition to Apple’s FFT implementation on macOS.

Plan:

- Make JUCE’s FFT wrap IPP’s FFT when available
- Transition from using IPP’s FFT directly in my code to use JUCE’s FFT (which should now just be a wrapper for it)
- Check that everything still works
- Transition to Apple’s vDSP FFT by simply removing the `JUCE_IPP_AVAILABLE=1` preprocessor setting on macOS builds
- Check that everything still works and compare the performance
- If it turns out that IPP’s FFT is faster on Intel CPUs, possibly keep using it on macOS but not on the Apple Silicon architecture

---

<div class="post-metadata">

**Author:** ![yairadix](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yairadix/32/1114_2.png) [@yairadix](https://forum.juce.com/u/yairadix)\
**Post date:** [December 1, 2020, 11:49am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/17 "2020-12-01T11:49:40Z")

</div>

Update: the missing piece for this was [very small](https://github.com/soundradix/JUCE/commit/de2f13d1c6c2a0c90bc32fd4e6d14a92f4273bca). Using our JUCE repo IPP appears to be working fine on macOS (will also test on Linux later and report)

---

<div class="post-metadata">

**Author:** ![PeterRoos](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@PeterRoos](https://forum.juce.com/u/PeterRoos)\
**Post date:** [December 1, 2020, 11:50am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/18 "2020-12-01T11:50:59Z")

</div>

Well, regarding the Define I mentioned, it works for me 🙂  
I can have another look at the other defines.

I can imagine that if you build a universal binary, you can still use Intel IPP on Mac for the `x86_64` slice and use vDSP for the ARM slice.

I have not yet Googled for comparisons between vDSP and IPP in the “old” x86\_64 mode.

What do you think? Would that be tricky to configure?

---

<div class="post-metadata">

**Author:** ![yairadix](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yairadix/32/1114_2.png) [@yairadix](https://forum.juce.com/u/yairadix)\
**Post date:** [December 1, 2020, 11:52am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/19 "2020-12-01T11:52:37Z")

</div>

See my comment just above. It works for me now after minor tweaks and Xcode compilation error fixes. And no I don’t think this should be tricky. I’ll update when I transition my code to JUCE’s FFT and then I could easily benchmark using either of them in my actual code.

---

<div class="post-metadata">

**Author:** ![PeterRoos](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@PeterRoos](https://forum.juce.com/u/PeterRoos)\
**Post date:** [December 1, 2020, 11:55am UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/20 "2020-12-01T11:55:38Z")

</div>

That is cool news, thanks!

---

<div class="post-metadata">

**Author:** ![yairadix](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yairadix/32/1114_2.png) [@yairadix](https://forum.juce.com/u/yairadix)\
**Post date:** [December 2, 2020, 12:54pm UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/21 "2020-12-02T12:54:16Z")

</div>

The results are in!

My process is 20% faster using IPP’s FFT than using Apple’s vDSP FFT.

Hence, we’ll keep using IPP for macOS Intel targets.

---

<div class="post-metadata">

**Author:** ![PeterRoos](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@PeterRoos](https://forum.juce.com/u/PeterRoos)\
**Post date:** [December 2, 2020, 2:51pm UTC](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915/22 "2020-12-02T14:51:02Z")

</div>

Thanks for this quick result!  
So linking the x86-64 slice with IPP in a universal binary is easy?  
Top!

[Next page](https://forum.juce.com/t/fr-add-ipp-support-for-fft/31915.md?page=2)
