cuda-memcheck shows memory out of bound error in a kernl with large number of if else condition in k

I am using cuda for parallel computation. the program runs fine on normal execution but when I check with cuda-memcheck it shows error describing “memory out of bound” with error in read operation. with a lot of debugging , I couldnot find anything. Further in some cases commenting some of the if else condition removes the error.

in some of the documents, I learned about watchdog timer and if the kernal takes large amount of time to execute, cuda-memcheck shows unnatural error. what about this ?? Am I in the right Concept?

In case you haven’t already, make sure you compile with the “-lineinfo” option and when you run cuda-memcheck it will list the line where the offending memory operation occurred.

You can work backward from that point and find the programming error.

I’m old school and reflexively throw in assert() checks every time I suspect odd bounds errors. It is always better to look at problems in the debugger, but the crude asserts are still great because they give you passive warning even when you’re not debugging that specific problem.

I am using cuda in windows with visual studio to compile and run the cuda program, is there way to compile the program with -lineinfo ???

I am using cuda in windows with visual studio to compile and run the cuda program, is there way to compile the program with -lineinfo