PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

update clause gives error

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



Joined: 16 Mar 2012
Posts: 1

PostPosted: Tue Mar 20, 2012 9:06 am    Post subject: update clause gives error Reply with quote

Hi,

could anybody please give me a hint? Or even a solution? I have this very little program, it compiles alright. But when I start it, I get
call to cuMemcpyHtoD returned error 1: Invalid value
CUDA driver version: 4010
It is something with the update clause...

Thanks a lot!

Dirk



PROGRAM MAIN

IMPLICIT NONE

INTEGER :: zaehl
REAL, ALLOCATABLE :: eins(:)
!$acc mirror(eins)
REAL, ALLOCATABLE :: was(:)

ALLOCATE(eins(5))
ALLOCATE(was(5))

eins(:) = 1.

!$acc update device(eins)

!$acc kernels loop copy(was(1:5))
DO zaehl = 1, 100
was(zaehl) = eins(zaehl)
end do
!$acc end kernels
print *, was
END PROGRAM
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Mar 20, 2012 9:46 am    Post subject: Reply with quote

Hi Dirk,

The problem here is that you are mixing models. The "mirror" directive is part of the PGI Accelerator Model, not OpenACC. The equivalent OpenACC method, device_resident, is not yet implemented. Below are the two versions of your program, the first using just the PGI Accelerator Model and the second using just OpenACC.

Hope this helps,
Mat

PGI Accelerator Version
Code:
$ cat test_pgi.f90
PROGRAM MAIN

IMPLICIT NONE

INTEGER :: zaehl
REAL, ALLOCATABLE :: eins(:)
!$acc mirror(eins)
REAL, ALLOCATABLE :: was(:)

ALLOCATE(eins(5))
ALLOCATE(was(5))

eins(:) = 1.

!$acc update device(eins)

!$acc region
DO zaehl = 1, 100
was(zaehl) = eins(zaehl)
end do
!$acc end region
print *, was
END PROGRAM
$ pgf90 -ta=nvidia -Minfo test_pgi.f90
main:
      7, Generating local(eins(:))
     15, Generating update device(eins(:))
     17, Generating copyout(was(1:100))
         Generating compute capability 1.0 binary
         Generating compute capability 2.0 binary
     18, Loop is parallelizable
         Accelerator kernel generated
         18, !$acc do parallel, vector(96) ! blockidx%x threadidx%x
             CC 1.0 : 4 registers; 44 shared, 4 constant, 0 local memory bytes; 100% occupancy
             CC 2.0 : 8 registers; 4 shared, 56 constant, 0 local memory bytes; 50% occupancy
$ a.out
    1.000000        1.000000        1.000000        1.000000     
    1.000000   


OpenACC version:
Code:
$ cat test_acc.f90
PROGRAM MAIN

IMPLICIT NONE

INTEGER :: zaehl
REAL, ALLOCATABLE :: eins(:)
REAL, ALLOCATABLE :: was(:)

ALLOCATE(eins(5))
ALLOCATE(was(5))

!$acc data create(eins)

eins(:) = 1.

!$acc update device(eins)

!$acc kernels
DO zaehl = 1, 100
was(zaehl) = eins(zaehl)
end do
!$acc end kernels
!$acc end data

print *, was
END PROGRAM
$ pgf90 -acc -Minfo test_acc.f90
main:
     12, Generating local(eins(:))
     16, Generating update device(eins(:))
     18, Generating copyout(was(1:100))
         Generating compute capability 1.0 binary
         Generating compute capability 2.0 binary
     19, Loop is parallelizable
         Accelerator kernel generated
         19, !$acc loop gang, vector(32) ! blockidx%x threadidx%x
             CC 1.0 : 4 registers; 48 shared, 4 constant, 0 local memory bytes; 33% occupancy
             CC 2.0 : 8 registers; 4 shared, 60 constant, 0 local memory bytes; 16% occupancy
$ a.out
    1.000000        1.000000        1.000000        1.000000     
    1.000000   
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