I am trying to pass a row of pointers of a two dimensional array of pointers in CUDA. See my code below. Here the array of pointers is noLocal. Because I am doing an atomicAdd I am expecting a number different of zero in line printf("Holaa %d\n", local[0][0]);, but the value I get is 0. Could you help me to pass an arrow in CUDA by reference, please?
__global__ void myadd(int *data[8])
{
  unsigned int x = blockIdx.x;
  unsigned int y = threadIdx.x;
  unsigned int z = threadIdx.y;
  int tid = blockDim.x * blockIdx.x + threadIdx.x;
  //printf("Ola sou a td %d\n", tid);
  for (int i; i<8; i++)
      atomicAdd(&(*data)[i],10);
}
int main(void)
{
  int local[20][8] = { 0 };
  int *noLocal[20][8];
  for (int d = 0; d< 20;d++) {
      for (int dd = 0; dd< 8; dd++) {
          cudaMalloc(&(noLocal[d][dd]), sizeof(int));
          cudaMemcpy(noLocal[d][dd], &(local[d][dd]), sizeof(int), cudaMemcpyHostToDevice);
          
      }
      myadd<<<20, dim3(10, 20)>>>(noLocal[d]);
  }
  for (int d = 0; d< 20;d++)
      for (int dd = 0; dd < 8; dd++)
          cudaMemcpy(&(local[d][dd]), noLocal[d][dd], sizeof(int), cudaMemcpyDeviceToHost);
  printf("Holaa %d\n", local[0][0]);
  for (int d = 0; d < 20; d++)
      for (int dd = 0; dd < 8; dd++)
          cudaFree(noLocal[d][dd]);
}
 
     
     
    