IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo struct

RawBarrierStorage

struct RawBarrierStorage[count: Int]

Escape hatch: Raw barrier storage for custom patterns.

Use this when the standard pipeline storage doesn't fit your needs. You're responsible for initialization and synchronization semantics.

Example:

# Custom barrier layout for specialized synchronization
struct MyCustomSmem:
    var custom_barriers: RawBarrierStorage[8]

    def init_custom(ref[SHARED] self):
        ptr = self.custom_barriers.ptr()
        # Custom initialization...

Parameters​

  • ​count (Int): Total number of barriers to allocate.

Fields​

  • ​storage (RawBarrierStorage[count].Array.Storage):

Implemented traits​

AnyType, ImplicitlyDestructible

comptime members​

Array​

comptime Array = SMemArray[SharedMemBarrier, count]

Methods​

barriers​

barriers(ref[AddressSpace._value] self) -> RawBarrierStorage[count].Array

Returns:

RawBarrierStorage[count].Array

ptr​

ptr(ref[AddressSpace._value] self) -> MbarPtr

Get raw pointer for custom usage.

Returns:

MbarPtr