Storage of variable reading by every thread

If I can not use constant memory, what is the best way to store a variable which will be read by every thread?

THX a lot~!

you can use shared memory, copy this variable to shared memory such that
all threads in the same block can read it.
cost of such reading is very low, since broadcasting mechanism.
However you need to a copy for every block.

Thanks for the reply.

Share memory has bank conflict issue, right?

yes, but if all threads per half-warp read the same address, then it only needs one transaction

bacause such value would be broadcast to all threads.

Sounds good! Thank you very much~! :teehee: