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

GridBlockLaunchConfig

struct GridBlockLaunchConfig

A portable launch configuration: grid, block, and dynamic shared memory.

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.

Implemented traits​

AnyType, BlockExecutionConfig, Copyable, Deinitable, ExecutionConfig, GridBlockExecutionConfig, ImplicitlyCopyable, Movable, NearComputeGeneralPurposeScratchpadExecutionConfig, RegisterPassable, TrivialRegisterPassable

Methods​

__init__​

def __init__(*, grid_dim: Dim, block_dim: Dim, shared_mem_bytes: Int = Int(0)) -> Self

Creates a portable launch configuration.

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.

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.

Was this page helpful?