MATLAB: Which version of Visual Studio is fully supported by Matlab with Cuda Coding

cudagpuvisual studio

As you can read the title, which version of Visual Studio is good for coding cuda mex?
Some version, VS2008, VS2010 made an error… computer architecture 13… during running
mexcuda mexGPUExample.cu .....
I tried VS2015, but it also made an error.
Am I missing some setting? I set "mex -setup" to use VS as mex complier.
Cuda driver version is 7.5.
I am using Matlab 2016a.
Thank you~

Best Answer

Visual Studio 2012 and 2013 are supported in MATLAB R2016a and R2016b. These are the compilers that are supported by the CUDA compiler in CUDA 7.5. If you want to know what is supported in general, consult the CUDA toolkit documentation for the version of the toolkit compatible with your version of MATLAB (see the 'ToolkitVersion' field of the output from gpuDevice).
Use the function mexcuda (not mex) to compile your kernels using the CUDA compiler.