Problem to use the pitch, returned by cudaMallocPitch, with cudaMemcpy3D!

Hi all!

I have a problem! I try to copy a device buffer into a cudaArray and bind it to a texture 3D. Then, I copy the content of this texture to another device buffer trough a kernel!

In attachment you can find an example of my code which does not work! I try to run it with cuda 2.1 and cuda 2.0, without any difference.

The copy works only in device emulation when I replace the srcPitch variable ( line 134) by the pitch value: srcDimx*sizeof(float)!
But, I can do that in release mode because I got a cuda error:
Cuda error in file ‘’ in line 136 : invalid argument.

I have to put the pitch value returned by the cudaMallocPitch function, to solve this error, but I got an alignment of my cudaArray, which shift his values!

Could anyone help me?

Thank you (3.5 KB)