IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/get-started.md).

Mojo struct

Handle

struct Handle[backend: Backend = _resolve_backend[Backend.AUTOMATIC]()]

Owns a vendor BLAS library handle for a resolved Backend.

Parameterized by a Backend (defaulting to the automatically resolved backend) and stores the underlying cuBLAS, rocBLAS, or hipBLASLt handle in a Variant. Construction creates the vendor handle and __exit__ destroys it, so instances should be used as context managers.

Implemented traits​

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDeletable, Movable

comptime members​

resolved_backend​

comptime resolved_backend = _resolve_backend[backend]()

type​

comptime type = Variant[Optional[Pointer[NoneType, MutUnsafeAnyOrigin, _safe=False]], Handle, Optional[Pointer[NoneType, MutAnyOrigin, _safe=True]]]

Methods​

__init__​

def __init__(out self)

__is__​

def __is__(self, other: Backend) -> Bool

Returns:

Bool

__isnot__​

def __isnot__(self, other: Backend) -> Bool

Returns:

Bool

__enter__​

def __enter__(self) -> Self

__exit__​

def __exit__(mut self)

Was this page helpful?