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 function

opaque_nonneg_i32

def opaque_nonneg_i32(x: Int32) -> Int32

Returns a non-negative x re-derived as max(x, 0) in opaque PTX.

A value computed before a warp-role split and used by several roles is one live range across every role, so ptxas can give it a stack slot that a role's loop reloads. A plain mov does not help: ptxas coalesces the copy with its source. max is an identity only for x >= 0, which ptxas cannot prove, so the result starts a new live range in the calling role's registers.

Returns:

Int32

Was this page helpful?