PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Initialize global variables with OpenACC pragma?

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



Joined: 01 Mar 2013
Posts: 9

PostPosted: Sun May 19, 2013 5:13 am    Post subject: Initialize global variables with OpenACC pragma? Reply with quote

Hello,

I wonder, is there any pragma or API which helps to initialize global variables to a particular value, for example, 0. I know acc_malloc and create(Y[0:n][0:m]) help us allocate global variables only. I think this would help us reduce the data movement from host to device memory. For some output variables, we create in global memory, initialize to zero, perform some computation and copyout to host memory.

Thank you,
Regards,
Minh
Back to top
View user's profile
mkcolg



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

PostPosted: Mon May 20, 2013 10:17 am    Post subject: Reply with quote

Hi Minh,

Quote:
I wonder, is there any pragma or API which helps to initialize global variables to a particular value, for example, 0.
No, sorry. You need to put this initialization in a loop with an accelerator compute region.

Though, I do have an open feature request (TPR#18614) asking that the compiler perform idiom recognition on these types of loops and replace them with an optimized memset kernel. I'll add your request to this report.

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