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]
fn 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
__del__is_trivial
comptime __del__is_trivial = True
Array
comptime Array = SMemArray[SharedMemBarrier, count]
Methods
barriers
barriers(ref[AddressSpace._value._mlir_value] self) -> RawBarrierStorage[count].Array
Returns:
RawBarrierStorage
ptr
ptr(ref[AddressSpace._value._mlir_value] self) -> MbarPtr
Get raw pointer for custom usage.
Returns:
MbarPtr
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!