|
| View previous topic :: View next topic |
| Author |
Message |
Minh
Joined: 01 Mar 2013 Posts: 9
|
Posted: Sun May 19, 2013 5:13 am Post subject: Initialize global variables with OpenACC pragma? |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Mon May 20, 2013 10:17 am Post subject: |
|
|
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 |
|
 |
|
|
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 © 2001, 2002 phpBB Group
|