Mojo function
store_relaxed
store_relaxed[dtype: DType, //, *, scope: Scope = Scope.SYSTEM, memory: Bool = True, alignment: Int = align_of[Scalar[dtype]]()](ptr: LegacyUnsafePointer[Scalar[dtype], address_space=address_space, mut=mut, origin=origin], value: Scalar[dtype])
Performs an atomic store with relaxed memory ordering semantics.
On NVIDIA, maps to PTX st.relaxed; on AMD, maps to POP atomic store with MONOTONIC ordering.
Parameters:
- dtype (
DType): Data type of the value to store. - scope (
Scope): Memory scope for the atomic operation. - memory (
Bool): Whether to add memory clobber constraint. - alignment (
Int): Alignment requirement for the pointer.
Args:
- ptr (
LegacyUnsafePointer): Pointer to the memory location. - value (
Scalar): Value to store.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!