Cache Hints for Memory Operations#
These functions provide explicit control over caching behavior for memory operations. They generate PTX instructions with cache policy hints that can optimize specific memory access patterns. All functions support arrays or pointers with all bitwidths of signed/unsigned integer and floating-point types.
See also
Cache Operators in the PTX ISA documentation.
- numba.cuda.ldca(array, i)#
Load element
ifromarraywith cache-all policy (ld.global.ca). This is the default caching behavior.
- numba.cuda.ldcg(array, i)#
Load element
ifromarraywith cache-global policy (ld.global.cg). Useful for data shared across thread blocks.
- numba.cuda.ldcs(array, i)#
Load element
ifromarraywith cache-streaming policy (ld.global.cs). Optimized for streaming data accessed once.
- numba.cuda.ldlu(array, i)#
Load element
ifromarraywith last-use policy (ld.global.lu). Indicates data is unlikely to be reused.
- numba.cuda.ldcv(array, i)#
Load element
ifromarraywith cache-volatile policy (ld.global.cv). Used for volatile data that may change externally.
- numba.cuda.stcg(array, i, value)#
Store
valuetoarray[i]with cache-global policy (st.global.cg). Useful for data shared across thread blocks.
- numba.cuda.stcs(array, i, value)#
Store
valuetoarray[i]with cache-streaming policy (st.global.cs). Optimized for streaming writes.
- numba.cuda.stwb(array, i, value)#
Store
valuetoarray[i]with write-back policy (st.global.wb). This is the default caching behavior.
- numba.cuda.stwt(array, i, value)#
Store
valuetoarray[i]with write-through policy (st.global.wt). Writes through cache hierarchy to memory.