PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

global synchronization needed

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



Joined: 20 Feb 2012
Posts: 25

PostPosted: Mon Mar 26, 2012 7:03 am    Post subject: global synchronization needed Reply with quote

hi, everyone.
I am writing a program in cuda fortran,and i think i need some global synchronization among all threads in the GPU. Because in my program, firstly each thread will compute some intermediate data, for example, thread i produces A[i] on the global device memory, then thread i will need its neighbour's results(say A[i-1] and A[i+1]) to compute B[i]. Since this data dependence exists in all the threads and not a single thread block, i think i must make thread i "waits" thread i-1 and thread i+1 which can be in different thread blocks. The subroutine synchthread() can only take effect in one thread block, then i need something like global synchronization. Dose anyone know threadfence() or other alternative methods can help me???
thanks a lot
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Mar 26, 2012 11:56 am    Post subject: Reply with quote

Quote:
global synchronization among all threads in the GPU
CUDA provides no guaranteed method for global synchronisation except between kernel launches. You will need to rewrite your code to remove the dependency or break your code into multiple kernel launches.

- 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