Reputation: 406
I'm currently trying to debug some device code in MSVS2012 Ultimate. I want to put a breakpoint where I indicate in my code and have it set to only break when the hitcount is higher than certain value. I see how to do this by setting a breakpoint and adding the condition to it, but when I debug with CUDA, it stops on the first iteration and proceeds like a non-conditional breakpoint. The hitcount does not increase. I find it strange that the breakpoint hits but the hitcount doesn't increase. Any suggestions?
__global__ void rkf5()
{
for(int k = 0; k < numpoints; k++)
{
THIS IS WHERE I PUT MY BREAKPOINT.
do
{
stuff
} while (condition);
}
}
Upvotes: 0
Views: 118
Reputation: 15734
Try upgrading if you're not on CUDA 5.5 / nSight 3.2.
The release notes for some earlier versions of CUDA and nSight say that the hit count function does not work. However, that is not mentioned in the release notes for the latest version (CUDA 5.5 / nSight 3.2).
If you still can't get things to work, you can always work around this issue with an assert
in device code, such as:
assert(++my_hit_count != 100);
This will trigger a breakpoint when the assert is false. Supported only on compute capability >= 2.0. See the section on Assertion in the CUDA C Programming Guide for more information.
Upvotes: 1