Fast Fourier transforms on GPU on iOS

本秂侑毒 提交于 2020-01-02 02:53:11

问题


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.


回答1:


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.




回答2:


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.




回答3:


You'll find Surge to be precisely what you need. And it's written in pure Swift!




回答4:


Take a look at my answer here: https://stackoverflow.com/a/19966776/468812

Although the code in there uses FFT for audio processing, it can be applied to any signal.



来源:https://stackoverflow.com/questions/26020758/fast-fourier-transforms-on-gpu-on-ios

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!