CUDA & Matlab mex files mex compiler with cuda

i have written something like a little toolbox with rotation, fft, etc. and now i want them to be useable thru matlab so i thought of mex. now the problem is if i make mex and some cpp file (in this file i use the methods from cu files) mex tries to compile them. how can i tell mex which files mex should compile and which files nvcc should compile.

Download the files from:

There are a whitepaper and scripts for both Windows and Linux that show how to build mex files.