CixP1.Context (CixP1 v0.1.1)

Copy Markdown View Source

A NOE UMD context — the handle onto the NPU device (/dev/aipu).

One context can hold many graphs. It is reference-counted by the BEAM: the underlying noe_context_t is released (noe_deinit_context) when this struct and every CixP1.Graph/CixP1.Job derived from it become garbage.

Summary

Functions

Opens a new context on the AIPU device.

Types

t()

@type t() :: %CixP1.Context{resource: reference()}

Functions

new()

@spec new() :: {:ok, t()} | {:error, String.t()}

Opens a new context on the AIPU device.

Returns {:error, reason} if the NPU device cannot be opened (e.g. aipu.ko not loaded or /dev/aipu not present).