I am trying to copy a 2D array to the GPU using cudaMallocPitch(). I can get the destination pitch from this function, but how to I know the source pitch of my array.
For example:
float **numbers; //10x20 array
float **d_numbers;
size_t d_pitch;
cudaMallocPitch( (void)** &d_numbers, &d_pitch, 10*sizeof(float), 20)
cudaMemcpy2D(d_numbers, d_pitch, numbers, ????, 10, 20, cudaMemcpyHostToDevice);