I am trying to debug my application using cuda-gdb. I need check values of array stored in GPU global memory. According to docs
i try use print command. But it always prints 0’s. Here is part of my code
double arr[3] =
{ 1, 2, 3 };
status = cublasSetVector(3, sizeof(double), &arr[0], 1,
&(gpu_matrix->gpu_matrix_tiles[0][0]), 1);
if (status != CUBLAS_STATUS_SUCCESS)
{
fprintf(stderr, "!!!! GPU access error (write)\n");
return;
}
arr[0] = 10;
status = cublasGetVector(3, sizeof(double),
&(gpu_matrix->gpu_matrix_tiles[0][0]), 1, arr, 1);
if (status != CUBLAS_STATUS_SUCCESS)
{
fprintf(stderr, "!!!! GPU access error (read)\n");
return;
}
After cublasSetVector function I execute print command
(cuda-gdb) print gpu_matrix->gpu_matrix_tiles[0][0]@3
$6 = {0, 0, 0}
As you can see it prints array of 0’s.
But cublasGetVector sets correct values to arr. Could you explain how should I use cuda-gdb print?
OS - Ubuntu.
NVIDIA (R) CUDA Debugger
5.0 release