[英]Profiling MATLAB mex CUDA applications with the NVIDIA visual profiler
I am trying to profile a CUDA code that is embedded in a mex file, called from MATLAB. 我正在尝试分析嵌入在从MATLAB调用的mex文件中的CUDA代码。 Running on a win7 x64 machine, MATLAB r2014b
在Win7 x64计算机上运行,MATLAB R2014B
The code is structured as follows: 该代码的结构如下:
MATLAB test.m
->contains some standard code generating variables (and calling 1 or 2 minor own MATLAB fucntions)
-> calls testcuda.mex
->contains small, standard, no library C++ code
-> calls either test1.cu or test2.cu
->.cu files end in cudaDeviceReset();
I did the following, as stated in several places on the internet: 正如互联网上多个地方所述,我做了以下工作:
exit
in the end of test.m. exit
。 C:\\Program Files\\MATLAB\\R2014b\\bin\\matlab.exe
C:\\Program Files\\MATLAB\\R2014b\\bin\\matlab.exe
C:\\CUDA_MATLABtests\\MyToolbox
-nojvm -nosplash -r test
-nojvm -nosplash -r test
However, when I run the profiler,I get 但是,当我运行探查器时,我得到
======== Warning: No CUDA application was profiled, exiting
And nothing more. 仅此而已。
I am missing some instruction? 我缺少指导吗?
Is there any particular code structure that would make the profiler not to profile? 是否有任何特定的代码结构会使分析器无法进行分析?
A Matlab installation comes with two binaries, a launcher in <matlabroot>\\bin
and the main application in <matlabroot>\\bin\\<arch>
. Matlab安装附带两个二进制文件,一个是
<matlabroot>\\bin
的启动器,另一个是<matlabroot>\\bin\\<arch>
的主应用程序。 The later is the executable which also executes the mex functions in it's address space. 后者是可执行文件,它还在其地址空间中执行mex函数。
<matlabroot>\\bin\\<arch>
. <matlabroot>\\bin\\<arch>
启动一个。 <matlabroot>\\bin
setting the -wait
parameter. <matlabroot>\\bin
设置-wait
参数即可启动二进制文件。 Seeing the launcher application terminating, debugging tools often stop. Never use the binary in <matlabroot>\\bin\\<arch>
directly unless you have to. 除非必须,否则请勿直接在
<matlabroot>\\bin\\<arch>
使用二进制文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.