I am implementing compute intensive applications for iOS (i.e., iPhone or iPad) that heavily use fast Fourier transforms (and some signal processing operations such as interpolations and resampling). What are the best libraries and API that allows for running FFTs on iOS?
I have briefly looked into Apple Metal as well as Apple vDSP. I wasn't sure that vDSP utilizes GPUs although it seems to be highly parallelized and utilizes SIMD. Metal seems to allow to access GPU for compute intensive apps, but I am not able to find libraries for FFT and basic signal processing operations (something like AMD's clFFT). Does Apple provide such libraries?
Are there other APIs and libraries utilizing GPUs for iOS that are suitable for compute intensive apps?
Thanks.
Fast Fourier Transforms for NVIDIA GPUsThe cuFFT Library provides GPU-accelerated FFT implementations that perform up to 10X faster than CPU-only alternatives.
It would take the Fast Fourier Transform algorithm approximately 30 seconds to compute the Discrete Fourier Transform for a problem of size N = 10 ⁹. In contrast, the regular algorithm would need several decades.
vDSP actually uses the builtin (from iPhone 3GS onward) NEON vector arithmetic processor, which is, as you already said a SIMD engine and is really fast for certain tasks, including FFT.
I have no experience with computing an FFT on the GPU but i doubt it will be faster as the NEON instructions in vDSP, as its only purpose are these media and signal processing related tasks.
vDSP uses Arm NEON instructions under the hood and makes using them really easy. If you want to get down and dirty you could also use the NEON instruction set manually, but i think even getting on par with vDSP runtime wise will be a challenge, especially if you only need out of the box functions like FFT.
If you want to test the NEON engine yourself there is a great benchmark as APK for Android devices which tests regular vs NEON computation. The only thing you have to notice is, that if your data is larger than the L1 Cache the L2 Cache accessing becomes the limiting factor and if you even exceed this, there wont be a noticable runtime advantage.
vDSP and Accelerate use vector instructions on the CPU to parallelize and speed up signal processing tasks.
Regarding FFT via GPGPU on iOS systems, I think there is currently no such library available. Many signal processing algorithms are implemented in the GPGPU framework GPUImage but it looks like FFT is not supported, since these algorithms are implemented with OpenGL ES 2.0 shaders. The same goes for ogles_gpgpu.
OpenGL ES 3.1 Compute Shaders are not supported on iOS systems, so you should check out Metal then.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With