cudaPitchedPtr got weird value

Hi,

As I understand, the size of pitch of cudaPitchedPtr should be xsize*sizeof(typedata) which means pitch is not equal to xsize if typedata is greater than 1.

// widthSize = 64, heightSize = 64

cudaExtent pitchedVolSize = make_cudaExtent(widthSize*sizeof(float4), widthSize, heightSize);

CUDA_SAFE_CALL(cudaMalloc3D(&writeablePitch, pitchedVolSize));

printf("%d, %d", writeablePitch.pitch, writeablePitch.xsize);  // here, it prints out 1024, 1024

I don’t know why the xsize is 1024, as I think it should be 64.

Am i missing anything??

thanks in advance!

widthSize*sizeof(float4) == 64 * 16 == 1024

this is the size for pitch, not for xsize.

xsize should be the size of widthSize, i think.