Skip to main content
Log in

Mojo struct

MemoryElement

struct MemoryElement[dtype: DType, layout: Layout, address_space: AddressSpace, alignment: Int, /, *, bitwidth: Int = Int(bitwidthof[AnyTrivialRegType,__mlir_type.!kgen.target]())]

Fields

  • ptr (UnsafePointer[SIMD[dtype, 1], address_space=address_space, alignment=alignment]):
  • runtime_layout (RuntimeLayout[layout, bitwidth=bitwidth]):

Implemented traits

AnyType, UnknownDestructibility

Methods

__init__

__init__(out self, ptr: UnsafePointer[SIMD[dtype, 1], address_space=address_space, alignment=alignment], runtime_layout: RuntimeLayout[layout, bitwidth=bitwidth])

load

load(self) -> Element[dtype, layout, bitwidth=bitwidth]

store

store(self, src: Element[dtype, layout, bitwidth=bitwidth])

transfer

transfer(self, src: MemoryElement[dtype, layout, address_space, alignment, bitwidth=bitwidth])