PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

How to Change Loop Scheduling

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



Joined: 30 Nov 2010
Posts: 29
Location: Saudi Aramco

PostPosted: Wed Jan 19, 2011 4:58 am    Post subject: How to Change Loop Scheduling Reply with quote

Dear Mat,

I have a section of code I am accelerating which looks like this:
Code:

!$acc region

!$acc do  vector
         do i = i_start,i_end
           
!$acc do parallel
         do j = j_start,j_end
.......


The default scheduling the compiler gives me is:
Code:

Accelerator kernel generated
        278, !$acc do vector(32)
        283, !$acc do parallel
             Cached references to size [32] block of 'jeven'
             Cached references to size [32] block of 'jodd'
             CC 1.3 : 117 registers; 1044 shared, 964 constant, 112 local memory bytes; 6 occupancy


My "i" index can reach 270 in value. To my understanding each block on my GPU can launch a maximum of 512 threads.

I want to change the loop scheduling suggested by the compiler so it can launch 270 threads instead of 32.

I tried using the below:
Code:

!$acc region

!$acc do  vector(270)
         do i = i_start,i_end
           
!$acc do parallel
         do j = j_start,j_end
.......


But this causes the compiler to execute the "i" loop in sequence for some reason:
Code:

 Accelerator kernel generated
        278, !$acc do seq
             Non-stride-1 accesses for array 'jeven'
             Non-stride-1 accesses for array 'jodd'
        283, !$acc do parallel
             CC 1.3 : 116 registers; 20 shared, 960 constant, 48 local memory bytes; 6 occupancy


Any idea how to get this working?

Thank you for your help.
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jan 19, 2011 12:14 pm    Post subject: Reply with quote

Hi sindimo,

Can you please post or send to PGI Customer Service (trs@pgroup.com) a reproducing example?

While adding a size to vector is the correct way to specify the vector size, something in your code prevents using this large of a size.

Note, it's best to use vector sizes that are multiple of the GPU's warp size (32) so you may want to try setting the vector size to 128, 256, or 512.

Thanks,
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