I want to write a code that utilizes both CUDA and MEX of MATLAB. I have taken some couple of tries to compile simple combined codes but I cannot handle. What is the best method to combine these two? Is it possible to write CUDA code directly inside MEX or do I need to write them separately and link them together? If it is the case how do I handle to link these two? I am not very comfortable with c++ but getting to learn little by little. Please be expressive at your answers. Thanks in advance.
By the way I am working on linux.