Can matlab call acceleraterated c function by CUDA?

Hello everyone!
I’m a new user for CUDA & matlab.
And I have a question now:
If I have a mex c function called by matlab, and I want to accelerate this function by CUDA.
Finally I want to use matlab to call this accelerated function, should I set up some special parameter for matlab or CUDA?
Or I just re-mex it and follow the normal procedure for c calling CUDA?
Thanks to everyone! And forgive me the poor English!

Google for nvmex.

Please try this document:

You might also consider two other options:

  1. Using Jacket directly instead of writing your own CUDA kernels,


  1. If you definitely want to write your own CUDA, the Jacket SDK trumps standalone MEX, as described here: