Hello there,
I found an interesting error whilst attempting to copy data from a host array to a device array.
If the host and device arrays are declared to be of different extents i.e.
integer,dimension(1000,2000)::host
integer,allocatable,device,dimension(:,:)::device
allocate(device(10,31))
and then an attempt is made to copy the relevant host array elements to the device array i.e.
device(1:10,1:31)=host(1:10,1:31)
it seems that the cpu is incapable of putting the correct array elements in the correct device array elements on the gpu. All the array elements get muddled up resulting in a segfault or WORSE!
Is there some restriction here that I’m missing or is this a compiler problem? Presumably it’s because of the conversion to C when the CUDA memcpy function is called in the background which makes me think there might be a way around it???
Thanks in advance,
Crip_crop