2D malloc pitch mem

Can anyone post a simple example using:

  1. a 2D mallocPitch array
  2. Bind that array to a 2D float texture
  3. Copy memory to the array
  4. add 1 to the mpitch array using the 2D texture
  5. read back and print results

Do this for a width!=height array and I will be very happy. I have tried this many ways and have not been able to achieve correct results for a 2d array where width!=height.

Thanks.