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 struct

ClusterAttributeLaunchConfig

struct ClusterAttributeLaunchConfig

A launch configuration with thread block clusters, dynamic shared memory, and CUDA launch attributes.

Launching with this configuration fails to compile on a target without cluster launch, such as NVIDIA GPUs before sm_90.

Fields​

  • ​grid_dim (Dim): The grid dimensions.
  • ​block_dim (Dim): The block dimensions.
  • ​cluster_dim (Dim): The cluster dimensions.
  • ​shared_mem_bytes (Int): The dynamic shared memory per thread block, in bytes.
  • ​attributes (List[LaunchAttribute]): The launch attributes.

Implemented traits​

AnyType, BlockExecutionConfig, ClusterExecutionConfig, Copyable, Deinitable, ExecutionConfig, GridBlockExecutionConfig, LaunchAttributeHolderExecutionConfig, Movable, NearComputeGeneralPurposeScratchpadExecutionConfig

Methods​

__init__​

def __init__(out self, *, grid_dim: Dim, block_dim: Dim, cluster_dim: Dim, shared_mem_bytes: Int = Int(0), var attributes: List[LaunchAttribute] = List(__list_literal__=NoneType(None)))

Creates a cluster launch configuration with launch attributes.

Args:

  • ​grid_dim (Dim): The grid dimensions.
  • ​block_dim (Dim): The block dimensions.
  • ​cluster_dim (Dim): The cluster dimensions.
  • ​shared_mem_bytes (Int): The dynamic shared memory per thread block, in bytes.
  • ​attributes (List[LaunchAttribute]): The launch attributes, for example the result of pdl_launch_attributes(). A cluster dimension isn't allowed here; a launch with one raises.

get_grid_dim​

def get_grid_dim(self) -> Dim

Returns the grid dimensions.

Returns:

Dim: The grid dimensions.

get_block_dim​

def get_block_dim(self) -> Dim

Returns the block dimensions.

Returns:

Dim: The block dimensions.

get_cluster_dim​

def get_cluster_dim(self) -> Dim

Returns the cluster dimensions.

Returns:

Dim: The cluster dimensions.

get_near_compute_scratchpad_usage​

def get_near_compute_scratchpad_usage(self) -> Int

Returns the dynamic shared memory per thread block.

Returns:

Int: The dynamic shared memory per thread block, in bytes.

get_launch_attributes​

def get_launch_attributes[o: ImmOrigin](ref[o] self) -> Span[LaunchAttribute, o]

Returns the launch attributes.

Parameters:

Returns:

Span[LaunchAttribute, o]: The launch attributes.

Was this page helpful?