PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

CUDA Fortran kernel invoke a CUDA C kernel

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



Joined: 11 Jun 2009
Posts: 233

PostPosted: Wed Oct 13, 2010 9:44 am    Post subject: CUDA Fortran kernel invoke a CUDA C kernel Reply with quote

Is it possible to invoke a CUDA C kernel (compiled in a shared library) from a CUDA Fortran kernel, e.g. CUDA C is inline function.

If possible, could someone post here an example to do so.

Thanks,

Tuan
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Oct 14, 2010 3:33 pm    Post subject: Reply with quote

Hi Tuan,

Unfortunately no. CUDA Fortran "global" and "device" routines are only able to call other "device" routines located in the same Module. The reason for this is that all calls made from a kernel must be inlined at compile time.

We are investigating ways in which we can remove this restriction. Though given the difficultly, it may not be solved for some time.

Thanks,
Mat
Back to top
View user's profile
Tuan



Joined: 11 Jun 2009
Posts: 233

PostPosted: Sun Oct 17, 2010 9:19 pm    Post subject: Reply with quote

Thanks Mat. CUDA C doesn't have such restriction, i.e. inline kernel can only be invoked from a global kernel form the same file, right?

Tuan
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Oct 18, 2010 6:42 am    Post subject: Reply with quote

Hi Tuan,

CUDA C has a similar restriction. All calls to device subroutines must be within the same file scope as the caller. Though programmers can use the "#include" pragma to include routines from other files. Like CUDA Fortran, all device routines are inlined at compile time.

- 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