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
-
ClusterLaunchConfig: A launch configuration that groups thread blocks into clusters. -
GridBlockLaunchConfig: A portable launch configuration: grid, block, and dynamic shared memory.
Traits
-
BlockExecutionConfig: AnExecutionConfigthat launches SIMT thread blocks. -
ClusterExecutionConfig: AnExecutionConfigthat groups thread blocks into clusters. -
ExecutionConfig: Describes how to launch a kernel. -
GridBlockExecutionConfig: AnExecutionConfigthat launches a grid of thread blocks. -
NearComputeGeneralPurposeScratchpadExecutionConfig: AnExecutionConfigthat requests dynamic near-compute scratchpad memory, which is shared memory on GPUs.