PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Making Function Calls within Accelerator Code Blocks

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



Joined: 24 Sep 2010
Posts: 13

PostPosted: Tue Sep 28, 2010 7:06 am    Post subject: Making Function Calls within Accelerator Code Blocks Reply with quote

I have read that function calls cannot be made within the pragmas of code blocks to be accelerated. Is there a way around this besides in-lining all of the function calls? Or is this something that will be available with future releases? I know that OpenMP allows function calls within the code blocks to be accelerated and would like to do the same with PGI Accelerator.
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Sep 28, 2010 8:56 am    Post subject: Reply with quote

Code:
Is there a way around this besides in-lining all of the function calls?
No, though the compiler is able to perform automatic inlining (see -Minline/-Mextract, -Mautoinline, and -Mipa=inline). It doesn't work in all cases, but worth a try before hand inlining the rountines.

I should note that this not a PGI limitation, rather a general limitation with NVIDIA. CUDA C and CUDA Fortran appear to allow calls, but in reality all calls get inlined.

Quote:
Or is this something that will be available with future releases?
Possible, but there are number of technical challenges that need to be first overcome. The first being a lack of a linker for device code. Without a linker there isn't a way to associate symbols. Second, is the lack of context switches and software stack during runtime. Though NVIDIA has added better support for this. Third, we need to way to ensure that the function being called has a device version. There are most likely more, but these are the ones that come to mind.

We definitely have the desire to be able to allow function calls within acc compute regions. It is one the major limitations of the model and one of the most requested features.

Thanks for your interest,
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