Skip to main content
Log in

Mojo🔥 modules

These are all the modules in the Mojo standard library.

anytype

Defines the core traits for object lifetime management in Mojo.

arc

Reference-counted smart pointers.

arg

Implements functions and variables for interacting with execution and system environment.

atomic

Implements the Atomic class.

base64

Provides functions for base64 encoding strings.

bencher

benchmark

Implements the benchmark module for runtime benchmarking.

bit

Provides functions for bit manipulation.

bool

Implements the Bool class.

breakpoint

This module includes the builtin breakpoint function.

buffer

Implements the NDBuffer struct.

builtin_slice

Implements slice.

cluster

This module provides low-level NVIDIA GPU cluster synchronization primitives for SM90+ architectures.

comm

The gpu.comm package provides communication primitives for GPUs.

comparable

compile

Implements functions that return compile-time information.

compile

Provides utilities for compiling and inspecting Mojo code.

compiler

complex

Implements the Complex type.

constants

Defines math utilities.

constrained

Implements compile time constraints.

coroutine

Implements classes and methods for coroutines.

counter

Defines the Counter type.

debug

This module includes the debug hook functions.

debug_assert

Implements a debug assert.

deque

Defines the Deque type.

dict

Defines Dict, a collection that stores key-value pairs.

dimlist

Provides utilities for working with static and variadic lists.

dtype

Implements the DType class.

element

Provides element-based access to memory using layout-driven vectorization.

env

Implements basic routines for working with the OS.

equality_comparable

error

Implements the Error class.

ffi

Implements a foreign functions interface (FFI).

file

Implements the file based methods.

file_descriptor

Higher level abstraction for file stream.

float_literal

Implements the FloatLiteral class.

floatable

Implements the Floatable and

format_int

Provides the hex and

fstat

Implements the file system stat operations.

functional

Implements higher-order functions.

globals

This module provides GPU-specific global constants and configuration values.

grid_controls

Grid Dependent Control primitives for NVIDIA Hopper (SM90+) GPUs.

hash

Implements the Hashable trait and

host

Implements the gpu host package.

id

This module provides GPU thread and block indexing functionality.

identifiable

index

Implements IndexList which is commonly used to represent N-D indices.

info

Implements methods for querying the host target info.

inline_array

Provides a fixed-size array implementation with compile-time size checking.

int

Implements the Int class.

int_literal

Implements the IntLiteral class.

int_tuple

Hierarchical integer tuple data structures for high-performance tensor operations.

interval

A self-balancing interval tree is a specialized binary search tree designed to efficiently store and query intervals.

intrinsics

Defines intrinsics.

intrinsics

Provides low-level GPU intrinsic operations and memory access primitives.

io

Provides utilities for working with input/output.

layout

Provides a high-performance tensor layout system for memory mapping and indexing.

layout_tensor

len

Provides the len() function and its associated traits.

linked_list

list

Defines the List type.

list_literal

Implements the ListLiteral class.

lock

loop

math

Defines math utilities.

math

math

Defines basic math functions for use in the open source parts of the standard library since the math package is currently closed source and cannot be depended on in the open source parts of the standard library.

maybe_uninitialized

memory

Defines functions for memory manipulations.

memory

This module provides GPU memory operations and utilities.

memory

memory

Implements parallel_memcpy.

mma

This module includes utilities for working with the warp-matrix-matrix-multiplication (wmma) instructions.

mma_util

Matrix multiply accumulate (MMA) utilities for GPU tensor cores.

none

Defines the builtin NoneType.

numerics

Defines utilities to work with numeric types.

object

Defines the object type, which is used to represent untyped values.

optional

Defines Optional, a type modeling a value which may or may not be present.

os

Implements os methods.

owned_pointer

Implements OwnedPointer, a safe, single-ownership smart pointer.

param_env

Implements functions for retrieving compile-time defines.

path

Implements Path and related functions.

path

pathlike

Implements PathLike trait.

pointer

Implements the Pointer type.

polynomial

Provides two implementations for evaluating polynomials.

profiler

This module provides GPU profiling functionality.

pwd

python

Implements Python interoperability.

python_object

Implements PythonObject.

quick_bench

random

Provides functions for random numbers.

random

Random number generation for GPU kernels.

range

Implements a 'range' call.

rebind

Implements type rebind.

reduction

Implements SIMD reductions.

reflection

repr

Provide the repr function.

reversed

Provides the reversed function for reverse iteration over collections.

runtime_layout

Provides the RuntimeLayout type and functions for working with it. You can use

runtime_tuple

Provides the RuntimeTuple data structure and related utility functions for handling tuple-like data with both compile-time and runtime elements.

semaphore

This module provides a device-wide semaphore implementation for NVIDIA GPUs.

set

Implements the Set datatype.

simd

Implements SIMD primitives and abstractions.

sort

Implements the built-in sort function.

span

Implements the Span type.

stat

Implements the stat module.

static_tuple

Implements StaticTuple, a statically-sized uniform container.

str

Provides the str function.

string

Implements the string package.

string_literal

Implements the StringLiteral class.

swap

Implements the built-in swap function.

swizzle

Defines swizzle layouts for optimizing memory access patterns.

sync

This module provides GPU synchronization primitives and barriers.

tempfile

Implements tempfile methods.

tensor_builder

Tensor Builder Module

tensor_core

Tensor Core Module for High-Performance Matrix Operations

tensor_core_async

Tensor Core Async Module

tensor_ops

This module provides tensor core operations and utilities for GPU computation.

terminate

This module includes the exit functions.

testing

Implements various testing utils.

time

Implements basic utils for working with time.

tma_async

Tensor Memory Accelerator (TMA) Asynchronous Operations Module

tuple

Implements the Tuple type.

type_aliases

Defines some type aliases.

uint

Implements the UInt class.

unsafe

Provides utility functions for unsafe manipulation of SIMD values.

unsafe_pointer

Implement a generic unsafe pointer type.

value

Defines core value traits.

variant

Defines a Variant type.

warp

GPU warp-level operations and utilities.

write

Establishes the contract between Writer and

Was this page helpful?