IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

DeviceGraphNode

struct DeviceGraphNode[arena_origin: ImmutOrigin]

A handle to a node in an under-construction device graph.

Returned by node-adding methods on DeviceGraphBuilder such as add_function, add_copy, and add_memset. The handle can be used to refer to the node from later API calls (for example, when expressing explicit dependency edges).

Parameters

  • arena_origin (ImmutOrigin): Origin of the DeviceGraph.create scope that produced this handle. Branding ties the handle's usability to that scope, so a node cannot be used outside the builder callback or mixed into a different graph.

Fields

  • id (Int32): Opaque integer identifier of the node within its graph builder.

Implemented traits

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDeletable, Movable, RegisterPassable, TrivialRegisterPassable, Writable

Methods

write_to

def write_to(self, mut writer: T)

Writes a human-readable representation of this node handle.

Args:

  • writer (T): The writer to output to.