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

NonNullPointer

struct NonNullPointer[dtype_: DType, address_space_: AddressSpace = AddressSpace.GENERIC]

A pointer with a compile-time guarantee of being non-null.

Parameters

  • dtype_ (DType): Element type of the pointed-to values.
  • address_space_ (AddressSpace): GPU address space of the pointer (defaults to AddressSpace.GENERIC).

Fields

  • ptr (NonNullPointer[dtype_, address_space_].PtrType):

Implemented traits

AnyType, Copyable, Deinitable, ImplicitlyCopyable, Movable, OptionalPointer, RegisterPassable, TrivialRegisterPassable

comptime members

address_space

comptime address_space = address_space_

dtype

comptime dtype = dtype_

is_null

comptime is_null = False

PtrType

comptime PtrType = Pointer[Scalar[NonNullPointer[dtype_, address_space_].dtype], ImmutAnyOrigin, address_space=NonNullPointer[dtype_, address_space_].address_space]

Methods

__init__

def __init__(ptr: Pointer[Scalar[Self.dtype], ImmutAnyOrigin, address_space=Self.address_space]) -> Self

def __init__(ptr: DeviceBuffer[Self.dtype]) -> Self

value

def value(self) -> Self.PtrType

Returns:

Self.PtrType