Texture cache/read-only cache enabling in OpenACC


Is there a possibility to enable texture cache by using OpenACC directives? If yes could you please give me some clues? I didn’t find anything in documentation. Or is it possible just to use the read-only cache (something similar to const restrict for CC 3.5) in OpenACC?

Thank you,

Hi Jasmine,

There’s nothing in OpenACC which can be used to specify textures since this would be a device specific option. However as of the 14.1 release, if tell the compiler to use CUDA 5.5 and are specifically targeting a CC 3.5 device (i.e. add the flag -ta=tesla:cuda5.5,cc35) then read-only data will be decorated with “const restrict” and in some cases the “__ldg()” intrinsic used to enable the use of texture caching.

Note, you can keep the generated GPU and PTX code by adding the keep suboption (-ta=tesla:cuda5.5,cc35,keep) to confirm is LDG is used.

  • Mat