3D array copy wity cuMemcpy3D

I am a bit confused about cuMemcpy3D and
associated CUDA_MEMCPY_3D structure.

Some fields must be specified in bytes
(eg, srcXInBytes) and others just as
regular offsets (eg, srcY).

However, it’s not clear whether
srcPitch (and dstPitch) is in bytes
or not. What about srcHeight (and dstHeight)?

Can anybody shed some light on this?

I have not used this function. I am looking at the CUDA 4.0 documentation for it here:


“If specified, srcPitch must be greater than or equal to WidthInBytes + srcXInBytes, and dstPitch must be greater than or equal to WidthInBytes + dstXInBytes.”

This would imply that srcPitch and dstPitch are specified in bytes, which is also how pitch is typically specified in general. srcHeight and dstHeight would appear to refer to the number of element rows, so these are not in bytes. I will check with our driver team to see how we might be able to make the documentation of this function clearer.

Some of my tests confirm your interpretation.

It would be nice if it was unambiguously described
in the documentation or fields that require
to be in specified in bytes are named