| View previous topic :: View next topic |
| Author |
Message |
BeachHut
Joined: 14 Mar 2010 Posts: 11
|
Posted: Mon Mar 15, 2010 3:02 pm Post subject: device to device assignment |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Tue Mar 16, 2010 4:09 pm Post subject: |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Mon May 03, 2010 3:20 pm Post subject: |
|
|
Hi BeachHut,
FYI, device to device copies will be supported in the 10.5 release.
- Mat |
|
| Back to top |
|
 |
JeremyAppleyard27093
Joined: 20 Apr 2010 Posts: 4
|
Posted: Mon May 24, 2010 6:01 am Post subject: |
|
|
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 |
|
 |
toepfer
Joined: 04 Dec 2007 Posts: 45
|
Posted: Tue May 25, 2010 1:32 pm Post subject: |
|
|
| This should work. I have duplicated the error and have filed a bug. |
|
| Back to top |
|
 |
|