PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

cuda fortran module data
Goto page Previous  1, 2
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
SarahA



Joined: 29 Aug 2006
Posts: 16

PostPosted: Fri Sep 03, 2010 11:19 am    Post subject: Reply with quote

This was not the point of my comments and I'm aware of the limitation on subprograms and modules. Documenting a limitation does not make it a feature.

See http://www.pgroup.com/lit/articles/insider/v2n3a1.htm for encouraging news on mitigating this problem.


sseyler wrote:
I know I'm bumping an old thread, but in case people don't read the PGI CUDA Fortran user guide closely enough, subprograms with the "global" or "device" attribute are all considered "device" subprograms. Thus, a "global" subroutine must be contained in a module, since it is a device subprogram.
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Sep 09, 2010 2:32 pm    Post subject: Reply with quote

Hi sseyler,

Quote:
I know I'm bumping an old thread, but in case people don't read the PGI CUDA Fortran user guide closely enough, subprograms with the "global" or "device" attribute are all considered "device" subprograms. Thus, a "global" subroutine must be contained in a module, since it is a device subprogram.


This is not exactly correct in that "global" routines do not have to be contained within a module. Only when calling a "device" routine, do the "global" and "device" routine have to reside in the same module.

However, in order to call a "global" routine from host code, the "global" routine is required to have an explicit interface. Hence it is recommended to use modules since modules implicitly define interfaces.

Quote:

See http://www.pgroup.com/lit/articles/insider/v2n3a1.htm for encouraging news on mitigating this problem.
Yes this will be very nice. Allowing access to device data in external modules was our most requested feature.

- 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
Goto page Previous  1, 2
Page 2 of 2

 
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