Source code of the Fourier-spectral Poisson Solver

Hello everyone:

I’m a CUDA rookie. I try to implement the Fourier-spectral Poisson Solver from the training course by SDSC (pdf)
and from Nvida’s online docs (pdf).

Since got many errors, does anyone have the source code?

Thanks,