OpenCL FFT on both Nvidia and AMD devices?

I am working on a project that should use FFT on Nvidia and AMD graphics cards. At first I was looking for a library that would work on both (thinking it would be OpenCL), but I had no luck.

Someone suggested that I use every implementation of the vendor’s FFT and write a package that chose what to do on the platform. I found the AMD implementation pretty easy, but I actually work with the Nvidia card in the meantime (and this is more important for my particular application).

The only Nvidia implementation I can find is CUFFT. Does anyone know how I can actually use the CUFFT library from OpenCL? The only way I can think of is to have CUDA code along with my OpenCL code. I read that I cannot just use OpenCL buffers as CUDA pointers ( Try to mix in OpenCL with CUDA in the NVIDIA SDK template ). Instead, will I have to copy the buffers back to the host after running OpenCL cores, and then copy them back to the GPU using CUDA data transfer procedures? I do not like this approach, since it seems to include meaningless memory transfers, I would prefer it if I could use CUFFT from OpenCL.

+8
opencl gpgpu cuda nvidia
source share
3 answers

NVIDIA has not performed any support for OpenCL libraries such as FFT. He also did not provide a source for his CUDA libraries, so there is no way to run them using OpenCL.

AMD FFT is the best bet and will work on any other OpenCL-compatible device, including NVIDIA GPUs. ArrayFire OpenCL uses the AMD FFT library, and I ran it on Intel, NVIDIA, and AMD devices in our lab.

+6
source share

In addition to the Ben AMD offer, you can also check out the Apple FFT sample code. However, their code only works on GPU devices, since it checks for what types of devices the specified command queue has been created.

+1
source share

The github SHOC test also includes code that I tested on the nvidia GPU 650M, intel gpu, and Intel CPU for FFT. it took several minutes in windows to create a project and set the inclusion path and links, but it was simple. working on intel gpu requires setting command line parameters or a slight modification to the code, since intel gpu is device 1, not device 0, which is used by default in the shoc test suite.

I did not check the correctness of the output, only that it was compiled and completed.

0
source share

All Articles