There any way I can garantee that a certain array (when I copy from host to device) goes to cache and stays there? I know there are constant memory (read only memory). How I declare that memory and transfer a array from host to that memory?
There are some way to read and write to a array in the cache without have to actualize in the main “graphics memory” or the data in cache not to be replicated in the main “graphics memory”?
There are some arrays that I want to be transitory and I do not need to transfer to the host.
Do you ask if there is a possibility to read/write from a kernel directly to some kind of global cache?
The answer to that question is no.
On a per block level you can use shared memory as a user-defined cache. If you want to share data with ALL threads you need to go through global memory. You cannot use caches because they are per SM.