| View previous topic :: View next topic |
| Author |
Message |
appleluo
Joined: 21 Nov 2012 Posts: 19
|
Posted: Fri Mar 01, 2013 3:17 pm Post subject: How to reset arrays fast with OpenACC |
|
|
In my code I need to reset some arrays to 0:
do j = 1, 128
do i = 1, 128
p = 0.0d0
enddo
enddo
What's the best way to run this type of codelets on GPU using OpenACC?
Thanks,
Ping |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Mon Mar 04, 2013 10:20 am Post subject: |
|
|
It depends on the size of your arrays and if you need to copy them to the device. If the arrays are small, it might better to initialize them on the host and then copy them over. Larger ones, may better to initialize in an openACC compute region. You'll need to experiment at what point it costs more it launch and execute the kernel than it cost to copy the initialize data.
- Mat |
|
| Back to top |
|
 |
|