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 module
device_context
This module provides functionality for interacting with accelerators. In particular the DeviceContext struct, which represents a single stream of execution on a given accelerator. You can use this struct to allocate accelerator memory, copy data to and from the accelerator, and compile and execute functions on the accelerator.
comptime valuesβ
DeviceContextListβ
comptime DeviceContextList = DeviceContextArray[_]
Deprecated: A fixed-size collection of DeviceContext values.
This struct has been renamed to DeviceContextArray. This alias will be
removed in a future version of Mojo.
Deprecated: 'DeviceContextList' is deprecated, use 'DeviceContextArray' instead
Structsβ
- β
CompletionFlag: Non-owning handle to an MLRTCompletionFlag. - β
DefaultDeviceTypeEncoder: Provides a default implementation of theDeviceTypeEncodertrait. - β
DeviceBuffer: Represents a block of device-resident storage. For GPU devices, a device buffer is allocated in the device's global memory. - β
DeviceContext: Represents a single stream of execution on a particular accelerator (GPU). - β
DeviceContextArray: A fixed-size collection ofDeviceContextvalues. - β
DeviceEvent: Represents a GPU event for synchronization between streams. - β
DeviceExternalFunction: Represents an external device function loaded from PTX/SASS assembly. - β
DeviceFunction: Represents a compiled device function for GPU execution. - β
DeviceMulticastBuffer: Represents a multicast memory object enables special memory operations to be broadcast across a group of devices. - β
DevicePointer: A host-side representation of a pointer to device memory that resides within aDeviceBuffer. - β
DeviceStream: Represents a CUDA/HIP stream for asynchronous GPU operations. - β
EventFlags: Provides flags for creating events. - β
HostBuffer: Represents a block of host-resident storage. For GPU devices, a host buffer is allocated in the host's global memory. - β
StreamPriorityRange: Represents the range of valid stream priorities for a GPU device.