PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

What type of cuda memory is a parameter?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
tom.rb.edwards



Joined: 02 Dec 2010
Posts: 35

PostPosted: Mon Sep 12, 2011 5:53 am    Post subject: What type of cuda memory is a parameter? Reply with quote

I declare a parameter variable like so:

Code:
integer, parameter :: para1


which then gets used in a cuda kernel. Does it reside in constant memory, or somewhere else?
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Sep 12, 2011 11:30 am    Post subject: Reply with quote

Hi Tom,

Parameter variables are typically replaced by the literal constant value and the variable removed. No storage would be crated, either in constant memory or elsewhere.

Hope this helps,
Mat
Back to top
View user's profile
tom.rb.edwards



Joined: 02 Dec 2010
Posts: 35

PostPosted: Tue Sep 13, 2011 2:27 am    Post subject: Reply with quote

Thanks, yeah that helps
-Tom
Back to top
View user's profile
TheMatt



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

PostPosted: Wed Sep 14, 2011 9:55 am    Post subject: Reply with quote

Mat,

So, if we had constants that were in "constant" memory, but could be included in the code as parameters, that might be best? We'd save on host-to-CPU traffic because the variables were hard-coded by the compiler?

Matt
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Sep 14, 2011 10:56 am    Post subject: Reply with quote

Hi Matt,

I haven't look at this specifically, but my guess is that it would help (or at least not hurt). How much? probably not a lot. Worth an experiment.

The only caveat would be in the cases where storage needed to be created, such if your passing the parameter or if compiling with -g. Unlikely in this scenario, however.

- 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 1, 2  Next
Page 1 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