how do I prevent cuda-gdb from optimizing out any value ( whether device or host, local or global )? I have checked nvidia forums but most of them are years old and there seems to be not a solution for old cuda versions, but is there one for the newest one (cuda 9.2 and sm 61)?
I am using flags described in nvidia's documentation:
-g
- "Generate debug information for host code."
-G
- "Generate debug information for device code. Turns off all optimizations. Don't use for profiling; use -lineinfo instead."