Mojo struct
SMemArrayType
@register_passable(trivial)
struct SMemArrayType[type: AnyType, size: Int]
Shared memory array of fixed size.
Parameters
Fields
- ptr (
UnsafePointer[type, address_space=AddressSpace(3)]
):
Implemented traits
AnyType
,
Copyable
,
ImplicitlyCopyable
,
Movable
,
UnknownDestructibility
Aliases
__copyinit__is_trivial
alias __copyinit__is_trivial = True
__del__is_trivial
alias __del__is_trivial = True
__moveinit__is_trivial
alias __moveinit__is_trivial = True
ptr_type
alias ptr_type = UnsafePointer[type, address_space=AddressSpace(3)]
storage_size
alias storage_size = (size * size_of[type]())
Methods
__init__
__init__(unsafe_ptr: UnsafePointer[type, address_space=AddressSpace(3)]) -> Self
Initialize with shared memory pointer.
Args:
- unsafe_ptr (
UnsafePointer
): Shared memory pointer.
__getitem__
__getitem__[T: Intable](self, index: T) -> UnsafePointer[type, address_space=AddressSpace(3)]
Get element at index.
Args:
- index (
T
): Element index.
Returns:
UnsafePointer
: Pointer to element.
len
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!