Is it possible to call cufft library calls in device function?
Asked Answered
T

3

9

I use the cuFFT library calls in a host code they work fine, but I want to call the cuFFT library from a kernel. Earlier versions of the CUDA didn't have this kind of support but with the dynamic parallelism is this possible ?

It will be great if there are any examples on how to achieve this.

Titanic answered 24/6, 2013 at 7:49 Comment(2)
possible duplicate of Is there a method of FFT that will run inside CUDA Kernel?Monopolist
@PavanYalamanchili: I asked because it was more because of the dynamic parallelism is now supported with cuda 5(The link ur referring to is a year old). Anyways thanks for the info. I just got registered today with nvidia developer zone and there is new version coming out cuda 5.5 went through the release note and couldnt find anything related to device callable library functions.. :(Titanic
H
6

Despite the introduction of dynamic parallelism on Kepler (cc 3.5) cards, cuFFT remains a host API and there is currently no way of creating or executing FFT operations in device code using cuFFT.

Hollerman answered 24/6, 2013 at 10:35 Comment(1)
Thank you for the info.. Is there any other third party FFT library ported to CUDA ? which allow this ?Titanic
L
1

I already answered this in the duplicate thread: Is there a method of FFT that will run inside CUDA Kernel?. In short, since CUDA 11.0, there is cuFFTDx (Device Extensions), which allows you to do exactly that.

Link to my answer there: https://mcmap.net/q/1317965/-is-there-a-method-of-fft-that-will-run-inside-cuda-kernel.

Linneman answered 27/5, 2022 at 13:41 Comment(0)
O
0

there is NO way to call the APIs from the GPU kernel. You must call them from the host. If you want to run a FFT without passing from DEVICE -> HOST -> DEVICE to continue your elaboration, the only solution is to write a kernel that performs the FFT in a device function. Actually I'm doing this because I need to run more FFTs in parallel without passing again the datas to the HOST. If you find/have another solution let me know. There are a lot of example on the web to how to achieve this: -https://hackage.haskell.org/package/pure-fft-0.2.0/docs/Numeric-FFT.html

Orb answered 9/10, 2015 at 17:8 Comment(1)
I didnt find any other solution. The algorithm I was implementing had an alternative analytic solution to the problem. So we used that and totally avoided this problem of FFT from the device. You could have left your answer as comment to the question.Titanic

© 2022 - 2024 — McMap. All rights reserved.