Clear Filters
Clear Filters

How to build a cuda kernel from MATLAB m files?

2 views (last 30 days)
I have a set of ODE's that I'm solving with the Runge-Kutta method in MATLAB. In each iteration I implement around 30 calls to fft2 command. The convergence might take 50,000 to 1,000,000 iterations which lasts forever. One approach to speed it up is to perform the fft2 on the GPU. I do that and run it on a cluster. The speed up that I get is around 8 to 10 times.
The other approach which is supposed to be much faster is to convert the basic algorithm to a c-mex function and build a CUDA kernel. However, I'm quite naive in that and the only thing I know is that I can generate a C or C++ code out of my original mfile, but I don't know if it has anything to do that with the CUDA kernel.
Can anyone tell me what I should do from scratch providing that I have the m file?
Any answer is appreciated.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!