Skip to main content
Log in

Mojo struct

LaunchAttributeValue

@register_passable(trivial) struct LaunchAttributeValue

Represents a value for a CUDA launch attribute.

This struct emulates a C union to store different types of launch attribute values. It provides a fixed-size storage that can be initialized with different attribute types such as AccessPolicyWindow or dimension specifications.

Note: This implementation uses a fixed-size byte array to emulate the union behavior defined in the CUDA Driver API's CUlaunchAttributeValue.

Implemented traits

AnyType, Copyable, ExplicitlyCopyable, Movable, UnknownDestructibility

Methods

__init__

__init__() -> Self

Initializes a new LaunchAttributeValue with zeroed storage.

@implicit __init__(policy: AccessPolicyWindow) -> Self

Initializes a LaunchAttributeValue from an AccessPolicyWindow.

Args:

  • policy (AccessPolicyWindow): The AccessPolicyWindow to store in this attribute value.

@implicit __init__(dim: Dim) -> Self

Initializes a LaunchAttributeValue from a Dim (dimension) object.

Args:

  • dim (Dim): The dimension specification to store in this attribute value.