No supported SDK or compiler found using mex from CUDA, should be able to use MinGW64 Compiler or Microsoft Windows SDK 7.1??

I get the following error message when I try to use the mexcuda(and mex function) in Matlab 2016b on Windows 7. I am confused because I have downloaded installed both MinGW64 Compiler and Microsoft Windows SDK 7.1. I also have Microsoft Visual Studio 2013 and 2015 (x64 and x86).

Warning: The selected C++ compiler is not supported for CUDA compilation.
Searching for a supported compiler.
In mexcuda (line 89)
In mexGPUall (line 5)
Error using mex
No supported compiler or SDK was found. For options, visit

Error in mexcuda (line 157)
[varargout{1:nargout}] = mex(mexArguments{:});

Error in mexGPUall (line 5)
mexcuda -largeArrayDims

It seems that Matlab/mex is able to find MinGW64 Compiler and Microsoft Windows SDK 7.1, however it says that they do not work with CUDA. I get the following message when I run mex -setup C++ :

MEX configured to use ‘MinGW64 Compiler (C++)’ for C++ language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the
new API. You can find more information about this at:

To choose a different C++ compiler, select one from the following:
MinGW64 Compiler (C++) mex -setup:C:\Users\allema\AppData\Roaming\MathWorks\MATLAB\R2016b\mex_C++_win64.xml C++
Microsoft Windows SDK 7.1 (C++) mex -setup:‘C:\Program Files\MATLAB\R2016b\bin\win64\mexopts\winsdk-7.1_cpp.xml’ C++

I am very confused, I thought that both MinGW64 and Microsoft Windows SDK 7.1 were specifically recommended for CUDA computation. Am I missing something? Any advice would be greatly appreciated.

No, neither of those are recommended for CUDA compilation.

The only officially supported host compiler for the NVIDIA CUDA toolchain on windows is cl.exe, the compiler that ships with Visual Studio:

Whether or not this actually is a problem for what you are trying to do with mex I cannot say. It depends on exactly what you are doing with mex. Since you appear to be attempting to compile a file which may contain CUDA device code:

I would say that probably won’t work unless you use a supported compiler - and the message from mex appears to be correct.