PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

a question

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



Joined: 16 Mar 2012
Posts: 75

PostPosted: Mon Aug 13, 2012 6:40 pm    Post subject: a question Reply with quote

I have a question that may be only the developer of the compiler can answer.
in
#pragma acc kernels loop
for( i = 0; i < n; ++i ) r[i] = a[i]*2.0f;

it will be executed parallelizedly in the GPU. So at the beginning, host should copy array a[n] to the device. But how can the compiler know the size of a since a is point type?
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Aug 14, 2012 9:55 am    Post subject: Reply with quote

Quote:
host should copy array a[n] to the device. But how can the compiler know the size of a since a is point type?
It will try to use the loop bounds if possible. If it can't determine the size, it will issue a feedback message (-Minfo=accel) stating the the size can't be determined and the user will need to add a copy clause indicating the number of elements to copy.

- Mat
Back to top
View user's profile
Teslalady



Joined: 16 Mar 2012
Posts: 75

PostPosted: Tue Aug 14, 2012 7:12 pm    Post subject: Reply with quote

Thanks a lot ,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