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

GridBlockAttributeLaunchConfig

struct GridBlockAttributeLaunchConfig

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

It works on every NVIDIA target. A dynamic shared memory request above the target's default limit raises the kernel's limit, so no func_attribute is needed.

Fields​

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

Implemented traits​

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

Methods​

__init__​

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

Creates a launch configuration with launch attributes.

Args:

  • ​grid_dim (Dim): The grid dimensions.
  • ​block_dim (Dim): The block 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_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?