PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Getting the rank of thread in current block

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



Joined: 07 Apr 2012
Posts: 29

PostPosted: Tue Jun 19, 2012 3:17 pm    Post subject: Getting the rank of thread in current block Reply with quote

Hello,

I have a situation where I have to find the current thread within the current block...like this:
Code:

!$acc region
!$acc do parallel(64) !this is blockIdx.y
do k=0,100
!$acc do parallel(8)   !this is blockIdx.x
   do j=0,100
!$acc do vector(512) !this is threadIdx.x
      do i=0,100
           threadX = rank of thread in blockIdx.x
           threadY = rank of thread in blockIdx.y
      .....
      enddo
    enddo
enddo
!$acc end region


I think the above structure would create a 2-D array of blocks of dim 64X8 with each block having a 1-D array of threads (dim==512)??
How do I calculate threadX and threadY?

EDIT:

Let me reformat the question - is it possible to get the threadIdx.x and threadIdx.y in acc_region? Thanks.

Thank you,
Sayan
Back to top
View user's profile
Michael Wolfe



Joined: 19 Jan 2010
Posts: 42

PostPosted: Mon Jul 02, 2012 2:29 pm    Post subject: Reply with quote

Short answer: no.
The directives are a higher level, implicit programming model. It isn't a source-to-source macro translation into CUDA. We have no way to get the thread index or block index variables used to execute each loop iteration, and no plans to do so.
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