PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

swapping device pointers in accelerator(or data) region

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



Joined: 08 Feb 2011
Posts: 12

PostPosted: Thu Feb 24, 2011 6:15 pm    Post subject: swapping device pointers in accelerator(or data) region Reply with quote

Hi,
Is there any way to swap device pointers when using the accelerator framework? I would like to do something like this:


Code:
int* grid;
int* grid2;

#pragma acc data region copy(grid[n]) local(grid2[n])
{
    #pragma acc region
    {
         ...loops and stuff...

         int* tmp = grid;
         grid = grid2;
         grid2 = tmp; 
    }
}


Thanks!
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Feb 25, 2011 11:13 am    Post subject: Reply with quote

Hi Adam,

Unfortunately we don't support pointer assignment within accelerator regions. The reason is that 'grid' isn't a pointer in this context. Rather it's a structured memory block and includes information such as the type and bounds of the arrays. I've put in a feature request (TPR#17700) to see if there is any way we can remove this restriction.

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