I am using Intel Vtune to profile a mex dll in Matlab:
but I got the following error after I set up the Vtune side and when I tried to launch the dll inside Matlab:
??? Invalid MEX-file 'C:MyProjects ry2.dll': Invalid access to memory location.
I believe this is a side-effect after Intel VTune instrumented my try2.dll. This didn't not happen before I set up the Intel VTune, i.e., try2.dll was running all successfully previously.
What can I do now? There must be some experts here who had played with Intel Vtune along with Matlab mex dll.
Thanks a lot!
I regularly do this, but most recently I have been using "calllib" in MATLAB to call a generic Windows DLL with my code in it. To profile, I create a VTune project with "no executable to launch".
I then start profiling (hit F5), switch to MATLAB and exercise the DLL, and then stop profiling (sh-F5). This will properly profile all modules in the system. You could then drill down into your "try2.dll" in the module list. This should give you basic timing info.(make sure all the debug info is generated for the mex file so you can view source. i.e. -g flag in MATLAB, or usual "debug build" in Visual Studio).
How are you generating the MEX file anyway? With Visual Studio, or with MATLAB's "mex" command?
I haven't yet figured out how to get more detailed profiling as many types of VTune events require multiple runs, which likely doesn't work for a project with "no executable".
At least that is a start...