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 function
expect_bytes_pred
def expect_bytes_pred(mbar_ptr: Pointer[address_space=AddressSpace.SHARED, _safe=False], bytes: Int32, pred: Int32)
Issue mbarrier.arrive.expect_tx.shared::cta.b64 predicated on pred != 0.
Equivalent to:
if pred != 0:
mbar_ptr[].expect_bytes(bytes)but folds the runtime branch into a single PTX @%p predicate
on the mbarrier.arrive.expect_tx instruction: no Mojo-level
if, no SASS branch, no warp divergence.
Args:
- โmbar_ptr (
Pointer[address_space=AddressSpace.SHARED, _safe=False]): Pointer to the shared-memory mbarrier (8-byte slot). - โbytes (
Int32): Expected transaction byte count for this barrier. - โpred (
Int32): Runtime predicate (typically the result ofelect()or anelect()-derivedelect_mask); the PTX instruction is skipped when this is 0.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!