Quirky 3D device array error

Hi all,

I’m getting an error I’ve never seen before.

I’ve got my code running on the gpu but it’s giving the wrong so I decided to run it in emulation mode and compare some of the output to that of the serial version.

When I tried to “write” part of a 3D array to the screen I got the following compiler error message:

The device array section actual argument was not stride-1 in the leading dimension

which is referring to the code:

  if(i.eq.1)then
            do x=1,subbasis(i)
               write(*,*)(subevec(1,x,y),y=1,x)
            end do
            stop
            end if

where i is the thread.

Does anyone know what this means because I don’t?

Cheers,
Crip_crop

I think this is a bug that you have found when using emulation mode.

You could workaround this by doing the following:

  • *) declare a host array that is the same size and shape as the array
    you want to print out. In this case, subevec.

*) Before printing the value’s from the device array subevec, copy
the device array to the host with the following statement:

           subevec_host = subevec

*) Now change the name of the array in the write statement to the
host version, in this case subevec_host.


       if(i.eq.1)then
            do x=1,subbasis(i)
               write(*,*)(subevec_host(1,x,y),y=1,x)
            end do
            stop
            end if

Thanks very much, that worked. :)