Skip to main content

Mojo struct

DoubleBuffer

struct DoubleBuffer[dtype: DType]

Implemented traits​

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable

Methods​

__init__​

__init__(out self)

__init__(out self, current: UnsafePointer[Scalar[dtype], MutExternalOrigin], alternate: UnsafePointer[Scalar[dtype], MutExternalOrigin], size: Int)

__init__(out self, *, copy: Self)

current​

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

Returns:

DeviceBuffer[dtype]

alternate​

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

Returns:

DeviceBuffer[dtype]

swap​

swap(mut self)