One of the benefits of __restrict__
is that it allows the compiler to be more aggressive with optimizations. When you have simple code like this that the compiler can completely optimize away, the __restrict__
keyword may help the compiler do just that.
One of the common reasons for not being able to inspect variables in the debugger is due to compiler optimizations, either locally (a variable going out of scope when you weren't expecting it) or globally (a variable that has been completely optimized away).
Note that the definition of the kernel you've shown in this question does nothing useful. Therefore the compiler may be optimizing things away.
To work around this (for this case), put a printf("%f", *boo);
statement immediately after the final boo
assignment, and the compiler will not be able to optimize the variable away. You should also be using the -G
switch for debugging.