PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

device to device assignment

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
BeachHut



Joined: 14 Mar 2010
Posts: 11

PostPosted: Mon Mar 15, 2010 3:02 pm    Post subject: device to device assignment Reply with quote

It says on p. 20 of the user guide:
Quote:
An assignment statement with a device variable or device array or array section on both sides of the assignment statement will copy data between two device variables or arrays.


When I try this, however, I get the error:

Quote:
more than one device-resident object in assignment


Example code:
Code:

      program dev2dev

      use cudafor

      integer, device :: d1
      integer, device :: d2
      integer         :: h

      h = 1

      d1 = h

      d2 = d1

      h = d2

      write (*,*) h

      end program dev2dev


[/quote]
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6211
Location: The Portland Group Inc.

PostPosted: Tue Mar 16, 2010 4:09 pm    Post subject: Reply with quote

Hi BeachHut,

Unfortunately, implementation is slightly behind the CUDA Fortran spec and this is one of the few features left. I'll update this post once this is supported.

Thanks,
Mat
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6211
Location: The Portland Group Inc.

PostPosted: Mon May 03, 2010 3:20 pm    Post subject: Reply with quote

Hi BeachHut,

FYI, device to device copies will be supported in the 10.5 release.

- Mat
Back to top
View user's profile
JeremyAppleyard27093



Joined: 20 Apr 2010
Posts: 4

PostPosted: Mon May 24, 2010 6:01 am    Post subject: Reply with quote

This seems only partially fixed. If I use allocatables I still get an error.

dev2dev.cuf:
Code:

program dev2dev

      use cudafor

      integer, allocatable, device, dimension(:) :: d1
      integer, allocatable, device, dimension(:) :: d2

      allocate(d1(10))
      allocate(d2(10))

      d1(5) = 10

      d2(5) = d1(5)

end program dev2dev


Code:

$ pgfortran dev2dev.cuf

PGF90-S-0155-more than one device-resident object in assignment  (dev2dev.cuf: 13)
  0 inform,   0 warnings,   1 severes, 0 fatal for dev2dev
Back to top
View user's profile
toepfer



Joined: 04 Dec 2007
Posts: 50

PostPosted: Tue May 25, 2010 1:32 pm    Post subject: Reply with quote

This should work. I have duplicated the error and have filed a bug.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming 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