PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Quirky 3D device array error

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
crip_crop



Joined: 28 Jul 2010
Posts: 68

PostPosted: Sun Jun 17, 2012 12:56 pm    Post subject: Quirky 3D device array error Reply with quote

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:

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


which is referring to the code:

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
Back to top
View user's profile
toepfer



Joined: 04 Dec 2007
Posts: 48

PostPosted: Mon Jun 18, 2012 4:15 pm    Post subject: Reply with quote

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:
    Code:

               subevec_host = subevec

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


Code:
       if(i.eq.1)then
            do x=1,subbasis(i)
               write(*,*)(subevec_host(1,x,y),y=1,x)
            end do
            stop
            end if
Back to top
View user's profile
crip_crop



Joined: 28 Jul 2010
Posts: 68

PostPosted: Thu Jun 28, 2012 3:45 am    Post subject: Reply with quote

Thanks very much, that worked. :)
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group