PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Course

CUDA: How do I use L2 cache in Fermi?

 
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: Wed Jun 22, 2011 2:43 am    Post subject: CUDA: How do I use L2 cache in Fermi? Reply with quote

I need to be able to transfer data between different blocks but without using global memory because it's way too slow. In the NVIDIA Fermi card, there's a new L2 cache that goes across the whole GPU. Is it possible to use this cache, and if it is, how?
Thanks
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jun 22, 2011 7:54 am    Post subject: Reply with quote

Hi Tom,

The L2 cache is hardware managed so you don't have direct control on how the data is stored. I've been poking around the web to see if I can find details on how the L2 caching policy works, but haven't found anything concrete. As best as I can tell, data in the L2 cache is visible to all executing blocks and I assume if the hardware will cache frequently used variables especially if used across blocks.

- Mat
Back to top
View user's profile
tom.rb.edwards



Joined: 02 Dec 2010
Posts: 35

PostPosted: Wed Jun 22, 2011 9:19 am    Post subject: Reply with quote

I posted a similar question in the NVIDIA forums: http://forums.nvidia.com/index.php?showtopic=203627. Apparently the only control you have to the L2 cache is through modifiers in PTX instructions. This can be done on the CUDA C compiler using inline PTX.

What I'm hoping is that by not going over the 768KB limit, every read/write I make to global memory will be done through the L2 cache. I'll be frequently transferring data between blocks by writing to a global memory and then reading from that array with the other blocks. Is is wrong to assume that the L2 cache will always be used if I don't go over 768KB?
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jun 22, 2011 10:25 am    Post subject: Reply with quote

Quote:
Is is wrong to assume that the L2 cache will always be used if I don't go over 768KB?
Unfortunately, I don't know. Hopefully the NVIDIA forums can be more helpful with this one.

- 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
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