In a CUDA C project, I have a pointer to float inside a structure called "p". It is a pointer to device memory and it is called "p->deviceOutput". I am using CUDA-GDB to check the content of this pointer during execution: when I try to print it this is what happens:
(gdb) p *p->deviceOutput
$1 = 0
As you can see the printing returns something that looks like an int, definitely not a float. I am really sure the pointer is a pointer to float so I am really confused by this behaviour. Specifying the float format does not help:
(gdb) p/f *p->deviceOutput
$2 = 0
Actually I get the same behaviour using GDB as well. I am working on Ubuntu 14.10 and my code was compiled with nvcc using -O0 and -g options.
Can anybody please explain what is going on and what should I do to inspect this memory location correctly? Thanks