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 module

launch_config

Capability-typed kernel launch configurations.

A launch configuration's type says which launch capabilities it uses. The portable tier (grid, block, and dynamic shared memory) works on every GPU target. A performance-tier capability, such as thread-block clusters, is a separate trait, so launching with it on a target that lacks it fails to compile rather than raising at run time.

A DeviceContext publishes ExecutionConfigType, the configuration type with every capability its target supports, so generic code can check for a capability with conforms_to before using it. The HAL DeviceContext accepts the same configuration types.

from max.gpu.host import ClusterLaunchConfig, DeviceContext, Dim

def kernel():
    pass

with DeviceContext() as ctx:
    ctx.enqueue_function[kernel](
        ClusterLaunchConfig(grid_dim=4, block_dim=128, cluster_dim=Dim(2, 1, 1))
    )

Structs​

Traits​

Was this page helpful?