I am trying to create a MEX function from the following simple function:
function G = ft2(g, delta)
G = fftshift(fft2(fftshift(g))) * delta^2;
Although the MEX generation was successful when I specify the input g as a double array (non-gpuArray), it was not successful when I specify it as a double gpuArray. The build was successful but the compilation seems to have failed. The buildLog is like below:
----
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\vcruntime.h(197): error #256: invalid redeclaration of type name "size_t"
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\vcruntime_new.h(48): error #351: first parameter of allocation function must be of type "size_t"
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\type_traits(407): error #247: class template "std::_Is_memfunptr" has already been defined
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include\crt/common_functions.h(117): error #351: first parameter of allocation function must be of type "size_t"
....
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include\sm_32_intrinsics.hpp(132): error #3041: asm operand type size(8) does not match type/size implied by constraint 'r'
Error limit reached.
100 errors detected in the compilation of "C:/Users/Daigo/AppData/Local/Temp/tmpxft_00002b68_00000000-10_ft2_initialize.cpp1.ii".
Compilation terminated.
ft2_initialize.cu
ninja: build stopped: subcommand failed.
----
There are more than 100 error messages. It seems like they have something to do with C complier and CUDA toolkit. I cannot imagine how much effort I will need to fix all the issues in the log. Does anyone have advice on the use of GPU Coder?