Skip to main content
Log in

Mojo function

load_volatile

load_volatile[type: DType, //, memory: Bool = True](ptr: UnsafePointer[SIMD[type, 1], address_space=address_space, alignment=alignment, mut=mut, origin=origin]) -> SIMD[type, 1]

Performs a volatile load operation that cannot be optimized away.

Note: - Only supported on NVIDIA GPUs - Maps directly to PTX ld.volatile instruction - Prevents compiler optimization of the load operation - Useful for memory-mapped I/O or synchronization primitives.

Args:

  • ptr (UnsafePointer[SIMD[type, 1], address_space=address_space, alignment=alignment, mut=mut, origin=origin]): Pointer to the memory location to load from.

Returns:

The loaded value.