title: Cuda passing char** to kernel
body: <p>I am having a spot of bother with this basic CUDA code. </p>
  
  <p>I have a <code>char**</code> which is a flat 2d array of passwords, my current implementation is for CUDA simply to iterate through this list and display the passwords. However, when I go to display them I simply get "(NULL)". I'm not quite sure why this is. Can someone explain what it happening? </p>
  
  <p>Main:</p>
  
  <pre><code>char ** pwdAry;
  pwdAry = new char *[numberOfPwd];
  
  //pwdAry given some values (flat 2d array layout)
  const int pwdArySize = sizeof(pwdAry);    
  dim3 grid(gridSize,gridSize);
  dim3 block(blockSize,blockSize);
  
  searchKeywordKernel &lt;&lt; &lt;grid, block &gt;&gt; &gt;(pwdAry);
  
  return EXIT_SUCCESS;
  </code></pre>
  
  <p>Cuda:</p>
  
  <pre><code>__global__ void searchKeywordKernel(char **passwordList)
  {
      int x = threadIdx.x + blockIdx.x * blockDim.x;
      int y = threadIdx.y + blockIdx.y * blockDim.y;
      int pitch = blockDim.x * gridDim.x;
      int idx = x + y * pitch;
      int tidy = idx / pitch;
      int tidx = idx - (pitch * tidy);
      int bidx = tidx / blockDim.x;
      int bidy = tidy / blockDim.y;
      int currentThread = threadIdx.x + blockDim.x * threadIdx.y;
  
      printf("hi, i am thread: %i, and my block x: %i, and y: %i\n", currentThread, bidx, bidy);
      printf("My password is: %s\n", passwordList[currentThread]);
  }
  </code></pre>