PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

How to reset arrays fast with OpenACC

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



Joined: 21 Nov 2012
Posts: 19

PostPosted: Fri Mar 01, 2013 3:17 pm    Post subject: How to reset arrays fast with OpenACC Reply with quote

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
View user's profile
mkcolg



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

PostPosted: Mon Mar 04, 2013 10:20 am    Post subject: Reply with quote

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
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 © 2001, 2002 phpBB Group