Skip to main content
Log in

Mojo function

create_mbarrier_array

create_mbarrier_array[num: Int](addr: UnsafePointer[SIMD[int64, 1], address_space=AddressSpace(3), alignment=8]) -> StaticTuple[TMABarrier, num]

Create an array of TMABarrier objects from a shared memory region.

This function initializes multiple TMABarrier objects using consecutive memory locations starting from the provided address. Each barrier is placed at an 8-byte offset from the previous one.

Parameters:

  • num (Int): The number of TMABarrier objects to create.

Args:

  • addr (UnsafePointer[SIMD[int64, 1], address_space=AddressSpace(3), alignment=8]): Pointer to the start of the shared memory region to use. Must be 8-byte aligned.

Returns:

A StaticTuple containing 'num' TMABarrier objects.