IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Mojo struct

AMDScheduleBarrierMask

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.

Implemented traits​

AnyType, Copyable, Deinitable, Equatable, ImplicitlyCopyable, Intable, Movable, RegisterPassable, TrivialRegisterPassable, Writable

comptime members​

ALL_ALU​

comptime ALL_ALU = AMDScheduleBarrierMask(Int(1))

Allows reordering of all arithmetic and logic instructions that don't involve memory operations.

ALL_DS​

comptime ALL_DS = AMDScheduleBarrierMask(Int(128))

Permits reordering of all Local Data Share (LDS) operations.

ALL_VMEM​

comptime ALL_VMEM = AMDScheduleBarrierMask(Int(16))

Enables reordering of all vector memory operations (reads and writes).

DS_READ​

comptime DS_READ = AMDScheduleBarrierMask(Int(256))

Enables reordering of LDS read operations only.

DS_WRITE​

comptime DS_WRITE = AMDScheduleBarrierMask(Int(512))

Enables reordering of LDS write operations only.

MFMA​

comptime MFMA = AMDScheduleBarrierMask(Int(8))

Allows reordering of matrix multiplication and WMMA instructions.

NONE​

comptime NONE = AMDScheduleBarrierMask(Int(0))

No instructions can cross the barrier. Most restrictive option.

SALU​

comptime SALU = AMDScheduleBarrierMask(Int(4))

Permits reordering of scalar arithmetic/logic unit instructions only.

TRANS​

comptime TRANS = AMDScheduleBarrierMask(Int(1024))

Allows reordering of transcendental instructions (sin, cos, exp, etc).

VALU​

comptime VALU = AMDScheduleBarrierMask(Int(2))

Permits reordering of vector arithmetic/logic unit instructions only.

VMEM_READ​

comptime VMEM_READ = AMDScheduleBarrierMask(Int(32))

Allows reordering of vector memory read operations only.

VMEM_WRITE​

comptime VMEM_WRITE = AMDScheduleBarrierMask(Int(64))

Allows reordering of vector memory write operations only.

Methods​

__init__​

def __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__​

def __eq__(self, other: Self) -> Bool

Compares two AMDScheduleBarrierMask instances for equality.

Args:

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

Returns:

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

write_to​

def write_to(self, mut writer: T)

Writes a string representation of the AMDScheduleBarrierMask.

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

Args:

  • ​writer (T): The object to write to.

__int__​

def __int__(self) -> Int

Converts the AMDScheduleBarrierMask to an integer.

Returns:

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

Was this page helpful?