Skip to main content
Log in

Mojo struct

LaunchAttribute

@register_passable(trivial) struct LaunchAttribute

Represents a complete launch attribute with ID and value.

This struct combines a LaunchAttributeID and LaunchAttributeValue to form a complete attribute that can be passed to GPU kernel launches. It provides a way to specify various execution parameters that control kernel behavior.

Fields

  • id (LaunchAttributeID): The identifier specifying the type of this launch attribute.
  • __pad (StaticTuple[SIMD[uint8, 1], ((sizeof[::AnyType,__mlir_type.!kgen.target]() * -1) + 8)]): Padding to ensure proper alignment of the structure.
  • value (LaunchAttributeValue): The value associated with this launch attribute.

Implemented traits

AnyType, CollectionElement, Copyable, ExplicitlyCopyable, Movable, UnknownDestructibility

Methods

__init__

__init__() -> Self

Initializes a new LaunchAttribute with IGNORE ID and zeroed value.

@implicit __init__(policy: AccessPolicyWindow) -> Self

Initializes a LaunchAttribute from an AccessPolicyWindow.

Creates a launch attribute with ACCESS_POLICY_WINDOW ID and the provided policy.

Args:

  • policy (AccessPolicyWindow): The AccessPolicyWindow to use for this attribute.

from_cluster_dim

static from_cluster_dim(dim: Dim) -> Self

Creates a LaunchAttribute for cluster dimensions.

Creates a launch attribute with CLUSTER_DIMENSION ID and the provided dimensions.

Args:

  • dim (Dim): The dimensions to use for this attribute.

Returns:

A new LaunchAttribute configured with the specified cluster dimensions.