Profiling a mex-function

后端 未结 3 2389
醉话见心
醉话见心 2021-02-20 13:10

I have just rewritten a Matlab program in c++ as a mex-function to speed things up, with fantastic results. This optimization decision was a very very good idea, with up to a fa

3条回答
  •  孤独总比滥情好
    2021-02-20 13:50

    Two possible solutions in addition to the fine ones already suggested.

    1. It's possible to write a script which loads the data, runs your mex function, and then exits. You can then let the profiler call the Matlab executable with that script. This worked for me with nVidia's visual profiler when I was profiling my CUDA mex functions.

    2. If you built the mex function in Visual Studio, you should be able to do attach to the Matlab process and then run the function for either debugging or profiling.

提交回复
热议问题