Hi there,

I’m tring to use the cudaMemcpy2DAsync extension in Cuda Fortran to copy my 2D arrays but I’m struggling to work out what dpitch and spitch represent.

If anyone could give me some advice it would be much appreciated.

Here’s an example of an array I’m trying to copy:

! Host array

double precision, allocatable, pinned,dimension(:,:) ARRAY_host

! Device array

doible precision, device,dimension(MAXELMNT,3):: ARRAY_device

allocate(ARRAY_host(MAXELMNT,3))

! So far I have

istat=cudaMemcpy2DAsync(dst=ARRAY_device,

dpitch= ,

src=ARRAY_host,

spitch= ,

width=3,

height=MAXELMNT,

kdir=cudaMemcpyHostToDevice,

stream=0)

I’m not sure if I have the height and width the right way round and what to put for dpitch and spitch.

Thanks in advance for your help,

Crip_crop