GPU coder build error

2 views (last 30 days)
lim daehee
lim daehee on 8 Oct 2019
Edited: lim daehee on 25 Oct 2019
Hi, I executed the GPU coder on my code. However, build error has occurred by unknown problem. I cannot understand why am I got the build error.
캡처.PNG
Additionally, types of input data is stated below.
NodeNum : 1x1 double
Map_Obs : 1701x1701x11 double
PosMap : 31827411x3 double
  1 Comment
Walter Roberson
Walter Roberson on 8 Oct 2019
What was in the log?
Does the problem fit within the amount of memory of your gpu?
You are doing a lot of indexing. Indexing is pretty inefficient on the gpu. Much more efficient to vectorize computation. Even if that means extracting temporary vectors thatccan be much more effective.

Sign in to comment.

Answers (2)

lim daehee
lim daehee on 8 Oct 2019
Here is my build logs.
cl /c /Zp8 /GR /W3 /EHs /nologo /MD /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /DMATLAB_MEX_FILE /O2 /Oy- /DNDEBUG /fp:strict /I "C:\PROGRA~1\MATLAB\R2018b\simulink\include" /I "C:\PROGRA~1\MATLAB\R2018b\toolbox\shared\simtargets" /I "\\fdlserver3\fdl_data\02U3JA~G\048OUK~P\12ZRX0~5\_PW2U1~9\22AFMP~U\ACLMCT~Y\PRM_DH\codegen\mex\FVX5UF~V" /I "\\fdlserver3\fdl_data\02U3JA~G\048OUK~P\12ZRX0~5\_PW2U1~9\22AFMP~U\ACLMCT~Y\PRM_DH" /I ".\interface" /I "C:\PROGRA~1\MATLAB\R2018b\extern\include" /I "." "fcn_PRM_DH_data.cpp"
fcn_PRM_DH_data.cpp
cl /c /Zp8 /GR /W3 /EHs /nologo /MD /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /DMATLAB_MEX_FILE /O2 /Oy- /DNDEBUG /fp:strict /I "C:\PROGRA~1\MATLAB\R2018b\simulink\include" /I "C:\PROGRA~1\MATLAB\R2018b\toolbox\shared\simtargets" /I "\\fdlserver3\fdl_data\02U3JA~G\048OUK~P\12ZRX0~5\_PW2U1~9\22AFMP~U\ACLMCT~Y\PRM_DH\codegen\mex\FVX5UF~V" /I "\\fdlserver3\fdl_data\02U3JA~G\048OUK~P\12ZRX0~5\_PW2U1~9\22AFMP~U\ACLMCT~Y\PRM_DH" /I ".\interface" /I "C:\PROGRA~1\MATLAB\R2018b\extern\include" /I "." "fcn_PRM_DH_initialize.cpp"
fcn_PRM_DH_initialize.cpp
cl /c /Zp8 /GR /W3 /EHs /nologo /MD /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /DMATLAB_MEX_FILE /O2 /Oy- /DNDEBUG /fp:strict /I "C:\PROGRA~1\MATLAB\R2018b\simulink\include" /I "C:\PROGRA~1\MATLAB\R2018b\toolbox\shared\simtargets" /I "\\fdlserver3\fdl_data\02U3JA~G\048OUK~P\12ZRX0~5\_PW2U1~9\22AFMP~U\ACLMCT~Y\PRM_DH\codegen\mex\FVX5UF~V" /I "\\fdlserver3\fdl_data\02U3JA~G\048OUK~P\12ZRX0~5\_PW2U1~9\22AFMP~U\ACLMCT~Y\PRM_DH" /I ".\interface" /I "C:\PROGRA~1\MATLAB\R2018b\extern\include" /I "." "fcn_PRM_DH_terminate.cpp"
fcn_PRM_DH_terminate.cpp
cl /c /Zp8 /GR /W3 /EHs /nologo /MD /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /DMATLAB_MEX_FILE /O2 /Oy- /DNDEBUG /fp:strict /I "C:\PROGRA~1\MATLAB\R2018b\simulink\include" /I "C:\PROGRA~1\MATLAB\R2018b\toolbox\shared\simtargets" /I "\\fdlserver3\fdl_data\02U3JA~G\048OUK~P\12ZRX0~5\_PW2U1~9\22AFMP~U\ACLMCT~Y\PRM_DH\codegen\mex\FVX5UF~V" /I "\\fdlserver3\fdl_data\02U3JA~G\048OUK~P\12ZRX0~5\_PW2U1~9\22AFMP~U\ACLMCT~Y\PRM_DH" /I ".\interface" /I "C:\PROGRA~1\MATLAB\R2018b\extern\include" /I "." "fcn_PRM_DH.cpp"
fcn_PRM_DH.cpp
fcn_PRM_DH.cpp(29): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(30): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(30): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(35): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(36): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(36): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(41): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(42): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(42): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(123): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(124): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(124): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(148): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(149): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(149): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(155): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(156): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(156): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(162): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(163): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(163): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(184): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(186): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(186): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(195): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(197): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(197): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(206): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(208): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(208): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(217): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(219): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(219): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(235): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(237): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(237): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(243): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(245): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(245): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(254): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(256): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(256): error C2059: 구문 오류: '}'
fcn_PRM_DH.cpp(265): error C2146: 구문 오류: ')'이(가) 'x0a' 식별자 앞에 없습니다.
fcn_PRM_DH.cpp(267): error C2143: 구문 오류: ';'이(가) '}' 앞에 없습니다.
fcn_PRM_DH.cpp(267): error C2059: 구문 오류: '}'
gmake: *** [fcn_PRM_DH.obj] Error 2

Hariprasad Ravishankar
Hariprasad Ravishankar on 11 Oct 2019
Hi Lim,
Looks like the generated code is emitting .cpp files whereas I would expect GPU Coder to emit .cu files.
Did you use coder.gpuConfig to create the codegen config object?
Could you share the command used to generate code?
Further, I see that your are using Visual Studio C++. Can you provide information on the version of the Visual Studio you are using?
Hari
  1 Comment
lim daehee
lim daehee on 25 Oct 2019
Edited: lim daehee on 25 Oct 2019
Hi ravishankar, I'm sorry for late check of your reply. I want to share my command used to generate code, however, I don't clearly understand what the command means. If the command means the code, this is on the top of this page, or if the command means the main code which executes this code, here is the main code.
clc
clear
close all
%% Map Load
load MapFile_510km_Alt3km.mat
%% Parameter Setting
NodeNum = 1900; % Node 개수
CR = 25; % 연결반경 (Connection Range)
DrawCHK =1; % 연산 종료후 Plot 여부
Vec{1} = unique(PosMap(:,1),'sorted');
Vec{2} = unique(PosMap(:,2),'sorted');
Vec{3} = unique(PosMap(:,3),'sorted');
%% Initialize condition
% WP Sett
num_goals=1:size(WP,1); % Waypoint Num
com_goals=combnk(num_goals,2); % Combination of route Num
com_nodes=combnk(1:NodeNum,2);
WP_N = size(WP,1);
%% PRM
tic
% Initialization
idx_FS = find(Map_Obs == 1);
idx_temp = unique(ceil(rand(NodeNum,1)*length(idx_FS)));
node_PRM = idx_FS(idx_temp);
% [D,node_PRM]=fcn_PRM_DH(NodeNum,Map_Obs,PosMap,com_goals);
D=fcn_PRM_DH2(node_PRM,Map_Obs,PosMap,com_goals);
MapGenTime=toc
also, I use visual studio 2019
Daehee

Sign in to comment.

Categories

Find more on Get Started with GPU Coder in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!