Skip to main content
Log in

Mojo struct

AMDScheduleBarrierMask

@register_passable(trivial) struct AMDScheduleBarrierMask

Represents different instruction scheduling masks for AMDGPU scheduling instructions.

These masks control which types of instructions can be reordered across a barrier for performance optimization. When used with schedule_barrier(), the mask determines which instructions the compiler is allowed to move across the barrier point.

Aliases

  • NONE = AMDScheduleBarrierMask(0): Allows reordering of all arithmetic and logic instructions that don't involve memory operations.
  • ALL_ALU = AMDScheduleBarrierMask(1): Permits reordering of vector arithmetic/logic unit instructions only.
  • VALU = AMDScheduleBarrierMask(2): Permits reordering of scalar arithmetic/logic unit instructions only.
  • SALU = AMDScheduleBarrierMask(4): Allows reordering of matrix multiplication and WMMA instructions.
  • MFMA = AMDScheduleBarrierMask(8): Enables reordering of all vector memory operations (reads and writes).
  • ALL_VMEM = AMDScheduleBarrierMask(16): Allows reordering of vector memory read operations only.
  • VMEM_READ = AMDScheduleBarrierMask(32): Allows reordering of vector memory write operations only.
  • VMEM_WRITE = AMDScheduleBarrierMask(64): Permits reordering of all Local Data Share (LDS) operations.
  • ALL_DS = AMDScheduleBarrierMask(128): Enables reordering of LDS read operations only.
  • DS_READ = AMDScheduleBarrierMask(256): Enables reordering of LDS write operations only.
  • DS_WRITE = AMDScheduleBarrierMask(512): Allows reordering of transcendental instructions (sin, cos, exp, etc).
  • TRANS = AMDScheduleBarrierMask(1024):

Implemented traits

AnyType, CollectionElement, Copyable, ExplicitlyCopyable, Intable, Movable, UnknownDestructibility

Methods

__init__

@implicit __init__(value: Int) -> Self

Initializes an AMDScheduleBarrierMask from an integer value.

This implicit constructor allows creating a barrier mask directly from an integer, which is useful for combining multiple mask flags using bitwise operations.

Args:

  • value (Int): The integer value to use for the barrier mask.

__eq__

__eq__(self, other: Self) -> Bool

Compares two AMDScheduleBarrierMask instances for equality.

Args:

  • other (Self): The other AMDScheduleBarrierMask to compare with.

Returns:

True if the masks have the same value, False otherwise.

__ne__

__ne__(self, other: Self) -> Bool

Compares two AMDScheduleBarrierMask instances for inequality.

Args:

  • other (Self): The other AMDScheduleBarrierMask to compare with.

Returns:

True if the masks have different values, False otherwise.

__str__

__str__(self) -> String

Returns a string representation of the AMDScheduleBarrierMask.

Converts the mask to a human-readable string based on its value.

Returns:

A string representation of the mask, or aborts if the value is invalid.

__int__

__int__(self) -> Int

Converts the AMDScheduleBarrierMask to an integer.

Returns:

The integer value of the mask, which can be used with low-level APIs.