I’d like to store some (hard to compute and frequently accessed) lookup tables in shared memory. All the threads of the grid will need to access the same lockup table data, although for every access each thread might need to access a different element. (If a particular access in all threads always wanted to access the same lockup table element, I guess constant memory would be my best option)
As far as I understand, lifetime of shared memory is limited to the life time of the block… And each block will be allocated it’s private part of the available SM shared memory. So, if I want to keep two active, runnable blocks on each SM, they will each have to use less than half of the total shared memory available, although each half will store exactly the same information, right?
Is there any way to avoid this? I.e, any way to state that all threads will want the same data stored in shared memory, so that blocks allocated to the same SM can happily share the space?