GPU Coder: compilation error

7 次查看(过去 30 天)
I am trying to create a MEX function from the following simple function:
function G = ft2(g, delta)
% Input
% - g: gpuArray, double, complex, size: N x N
% - delta: double, size: 1 x 1
G = fftshift(fft2(fftshift(g))) * delta^2;
end
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?

采纳的回答

Kumar Pallav
Kumar Pallav 2022-3-23
Hi,
Please go through the installation and configuration deatils for GPU coder.
After the above prerequisites, you can follow the example in documentation for code generation using GPU coder app.
Hope it helps!

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with GPU Coder 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by