CUDA disable L1 cache only for one variable

前端 未结 3 1356
别那么骄傲
别那么骄傲 2020-12-08 03:47

Is there any way on CUDA 2.0 devices to disable L1 cache only for one specific variable? I know that one can disable L1 cache at compile time adding the flag -Xptxas

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-08 03:48

    If you declare the variable to be volatile, then it will only be cached in the L2 cache on Fermi GPUs. Note that some compiler optimizations, such as removing repeated loads, are not performed on volatile variables because the compiler assumes they may be written by another thread.

提交回复
热议问题