Mojo struct
AddressSpace
@register_passable(trivial)
struct AddressSpace
Address space of the pointer.
Aliases
GENERIC = 0
: Generic address space.
Implemented traits
AnyType
,
CollectionElement
,
Copyable
,
EqualityComparable
,
EqualityComparableCollectionElement
,
Movable
,
Stringable
,
UnknownDestructibility
,
Writable
Methods
__init__
@implicit
__init__(out self, value: Int)
Initializes the address space from the underlying integral value.
Args:
- value (
Int
): The address space value.
@implicit
__init__(out self, value: _GPUAddressSpace)
Initializes the address space from the underlying integral value.
Args:
- value (
_GPUAddressSpace
): The address space value.
__eq__
__eq__(self, other: Self) -> Bool
True if the two address spaces are equal and False otherwise.
Args:
- other (
Self
): The other address space value.
Returns:
True if the two address spaces are equal and False otherwise.
__ne__
__ne__(self, other: Self) -> Bool
True if the two address spaces are inequal and False otherwise.
Args:
- other (
Self
): The other address space value.
Returns:
True if the two address spaces are inequal and False otherwise.
__is__
__is__(self, other: Self) -> Bool
True if the two address spaces are equal and False otherwise.
Args:
- other (
Self
): The other address space value.
Returns:
True if the two address spaces are equal and False otherwise.
__isnot__
__isnot__(self, other: Self) -> Bool
True if the two address spaces are equal and False otherwise.
Args:
- other (
Self
): The other address space value.
Returns:
True if the two address spaces are equal and False otherwise.
value
value(self) -> Int
The integral value of the address space.
Returns:
The integral value of the address space.
__int__
__int__(self) -> Int
The integral value of the address space.
Returns:
The integral value of the address space.
__mlir_index__
__mlir_index__(self) -> index
Convert to index.
Returns:
The corresponding __mlir_type.index value.
__str__
__str__(self) -> String
Gets a string representation of the AddressSpace.
Returns:
The string representation of the AddressSpace.
write_to
write_to[W: Writer](self, mut writer: W)
Formats the address space to the provided Writer.
Parameters:
- W (
Writer
): A type conforming to the Writable trait.
Args:
- writer (
W
): The object to write to.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!