I am trying to use cuda-gdb to check global device memory. It seems the values are all zero, even after cudaMemcpy. However, in the kernel, the values in the shared memory are good. Any idea? Does cuda-gdb even checks for global device memory at all. It seems host memory and device shared memory are fine. Thanks.
Suppose d_array is a pointer to device memory,
(cuda-gdb) print d_array
$1 = (double *) 0x13082c3000
To access its value, first convert it to a global memory pointer:
(cuda-gdb) print ((@global double *)d_array)[0]
$2 = 0.5
To access the array:
(cuda-gdb) print ((@global double *)d_array)[0]@3
$3 = {0.5, 0.4, 0.3}
Currently cuda-gdb can read the data you copied into global memory only after the CUDA kernel has launched. That might improve in future releases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With