Mojo function
load_acquire
load_acquire[type: DType, //, *, scope: Scope = Scope(6), memory: Bool = True](ptr: UnsafePointer[SIMD[type, 1], address_space=address_space, alignment=alignment, mut=mut, origin=origin]) -> SIMD[type, 1]
Performs an atomic load operation with acquire memory ordering semantics.
This function provides a memory barrier that ensures no subsequent memory operations from the calling thread are executed until after this load completes.
Note: - Only supported on NVIDIA GPUs. - Maps directly to PTX ld.acquire instruction. - Ensures subsequent memory operations don't execute until after load. - Critical for implementing synchronization primitives.
Parameters:
- type (
DType
): The data type to load. - scope (
Scope
): Memory scope for the operation (default: Scope.SYSTEM). - memory (
Bool
): Whether to include memory side effects in constraints (default: True).
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.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!