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
WaitHostValue
struct WaitHostValue
Stalls the stream until a host-visible flag reaches a given value.
Lowers to CUDA's cuStreamWaitValue64 via
DeviceStream.wait_for_host_value. Accepts a 1-D int64 buffer of
shape [2], mirroring mo.launch_host_func's payload shape:
payload[0]: raw address of aM::Driver::CompletionFlag(as u64). Typically obtained frommax.driver.CompletionFlag._unsafe_ptrand packed into the buffer by the Python caller; the C++ object must outlive any graph execution that references it.payload[1]: the 64-bit value to wait for (the int64 element is reinterpreted as a u64).
Records into a captured device graph as a wait-value / batch-mem-op
node, so this op can sit inside a captured forward graph just before
the sampling kernel to gate the sampler on the bitmask compute
finishing while the rest of the forward body runs concurrently. On
HIP that node is recorded explicitly by the driver layer, because
ROCm's stream capture does not record hipStreamWaitValue64 itself.
Supported on CUDA and HIP streams; other backends raise at runtime.
Implemented traitsโ
Methodsโ
executeโ
static def execute[target: StringSpan[ImmStaticOrigin]](payload: ManagedTensorSlice[IOSpec[_, _].MutableInput, static_spec=payload.static_spec], ctx: DeviceContext)