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

Mojo struct

DoubleBuffer

struct DoubleBuffer[dtype: DType]

Holds two GPU buffers and alternates between them for double-buffered radix sort passes.

The struct tracks which buffer is currently active and provides methods to access the current and alternate buffers, plus a swap operation to toggle between them.

Implemented traits

AnyType, Copyable, Deinitable, ImplicitlyCopyable, Movable

Methods

__init__

def __init__(out self)

def __init__(out self, current: Pointer[Scalar[dtype], MutUntrackedOrigin], alternate: Pointer[Scalar[dtype], MutUntrackedOrigin], size: Int)

def __init__(out self, *, copy: Self)

current

def current(self, ctx: DeviceContext) -> DeviceBuffer[dtype]

Returns:

DeviceBuffer[dtype]

alternate

def alternate(self, ctx: DeviceContext) -> DeviceBuffer[dtype]

Returns:

DeviceBuffer[dtype]

swap

def swap(mut self)