Unable to inspect global memory using CUDA + MATLAB + Visual Studio

1 view (last 30 days)
I'm currently writing a code in MATLAB using CUDA from a MEX file. I attached the MATLAB process to Visual Studio, both on native (x64) and CUDA, but when I stop at a breakpoint in a kernel definition I'm unable to inspect the values in global memory, even when I can see any other variable defined on thread (local) memory.
This is something expected or I'm doing anything wrong? If not, there is something I can do to inspect the global memory while debugging a kernel?
Thanks in advance!

Answers (1)

Walter Roberson
Walter Roberson on 28 Jan 2016
I am not sure if you are in the MATLAB space or in the CUDA space at the time you try to do that. CUDA space is effectively its own process with no access to MATLAB's globals. If you need the value of at MATLAB global, you need to pass in the value to the CUDA space.
(The same issue occurs for parfor and other parallel processing: each worker is its own process and the global variables do not get copied over.)

Community Treasure Hunt

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

Start Hunting!