PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

multiline Accelerate directive

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



Joined: 11 Jun 2009
Posts: 233

PostPosted: Sat Dec 19, 2009 10:05 am    Post subject: multiline Accelerate directive Reply with quote

What if I have a long Accelerate directive statement, can I split them into 2 lines, I tried to using the ampersand, yet I dont know if the continued line need to be commented or not. I try both cases and it doesn't work

Free-form
Code:

!$ACC data region copyin(a, b),
!$ACC  copyout(c) &


!$ACC END data region


Fixed-form
Code:

!$acc data region copyin(a, b),
!    x copyout(c)


!$ACC END data region

I followed the directive in the manual, with fixed-form format, on the 6th column of the continued line, add an 'x' character; yet i still get an error. I hope you can give me explain for both fixed-form format and free-form source format also.
Tuan
Back to top
View user's profile
mkcolg



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

PostPosted: Sat Dec 19, 2009 6:29 pm    Post subject: Reply with quote

Hi Tuan,

With fixed, you just need to add the "acc". For example:
Code:
       program test
          real, dimension(10,10) :: a, b
          integer :: i
!$ACC region
!$ACCx copyin(a)
          i = 19
          a = 1.1
          b = 3.0
!$acc end region
        end program


With free, the '&' needs to be on the line where the line break occurs. For example:
Code:
       program test
          real, dimension(10,10) :: a, b
          integer :: i
!$ACC region   &
!$ACC copyin(a)
          i = 19
          a = 1.1
          b = 3.0
!$acc end region
        end program


Hope this helps,
Mat
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