PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

host, device function: fortran counterpart of _CUDA_ARCH_
Goto page Previous  1, 2
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
TheMatt



Joined: 06 Jul 2009
Posts: 306
Location: Greenbelt, MD

PostPosted: Tue May 15, 2012 11:35 am    Post subject: Reply with quote

canemacchina wrote:
Quote:

What you need to do is add a runtime call to the device properties to determine what type of device you are using and then use an if statement to call the appropriate routine.


Ok, but with this solution I can determine compute capability of the device, but what I need is determine if the caller is the host or the gpu...

As far as this goes, I am not sure you can have an "attributes(host,device)" anymore. Back in the old days I think it was allowed, but at the moment I think you need to have two separate routines, one for the host, one for the device.

Matt
Back to top
View user's profile
mkcolg



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

PostPosted: Thu May 17, 2012 11:23 am    Post subject: Reply with quote

Quote:
Is referred to fortran, right?
Yes, PGI, like most Fortran compilers, support C style pre-processing.

Quote:
Ok, but with this solution I can determine compute capability of the device, but what I need is determine if the caller is the host or the gpu...
At least until CUDA 5 comes out, there isn't support for true calling from a device, so the routine will always be called from the host. You need to add the logic as to which path to take either via an IF-THEN-ELSE control structure or via Generic Interfaces.

Quote:
I am not sure you can have an "attributes(host,device)" anymore.
That's what I was mentioning before with the "Unified Binary". This would be the idea solution for canemacchina, but unfortunately it proved too difficult to implement. Hopefully we can add it back in a future release.

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling 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