NpuStack enum

A vendor whose NPU this package dispatches to.

A bundle compiled for an NPU names its vendor in the LiteRtStamp its compiler wrote (npuVendorOf(target), internal); which vendor a load runs on is decided by chooseNpuVendor (lib/src/ffi/npu_vendor_host.dart), for the LLM engine and the EmbeddingGemma 2 placement alike. LiteRT never checks the stamp against the dispatch it loads, so this choice is the only guard.

The runtime answers that differ per vendor — the build's stack, the device probe (npuUnreachable, one member per probe on NpuProbes), the dispatch directory, the HW masking setting, the wording — are switches over this enum with no default, so a vendor added here is a compile error at each of them. NOT forced by the compiler, and needed for a new vendor all the same: its native build (native/litert_lm/build_*.sh), its files in verify_tarball_manifest.sh REQUIRED, its system libraries as <uses-native-library> in the core plugin's AndroidManifest.xml (the probe's dlopen fails in the app's namespace without them), the core version floor in this package's pubspec when core's side changes, the docs, the example's catalog enum (EmbeddingNpuVendor), and the load plan's assumption that no stack ships a LiteRT compiler plugin (_textBackendsAllowed in litertlm_load_plan.dart): a vendor that ships one makes a generic bundle's on-device compile real, and its plugin then belongs in npuStackLibs.

Declaration order is the order in which a load whose bundle names no vendor tries the vendors of its ABI; a device is expected to reach at most one. LiteRT's dispatch is process-global: the first NPU load that initializes it fixes the vendor and the dispatch directory for every later NPU load in the process (IsTheApiInitialized, litert/runtime/dispatch/litert_dispatch.cc; a failed init fixes nothing). It is per copy of LiteRT: another plugin's libLiteRt (flutter_litert) keeps its own.

Inheritance
Available extensions

Values

qualcomm → const NpuStack

Qualcomm Hexagon through QNN, in apps that opt in with qualcommNpuUserDefine.

const NpuStack('Qualcomm', stampVendor: 'qualcomm', abis: {'android_arm64', 'linux_arm64'})
googleTensor → const NpuStack

Google Tensor G5/G6 through the Pixel system's LiteRT Edge TPU runtime, in apps that opt in with googleTensorNpuUserDefine. The dispatch bridge ships in the Android native tarball and is bundled only then; the runtime stays on the system image.

const NpuStack('Google Tensor', stampVendor: 'google', abis: {'android_arm64'})
mediatek → const NpuStack

MediaTek APUs (Dimensity) through NeuroPilot, in apps that opt in with mediatekNpuUserDefine. The dispatch is Google's, from its litert-npu-runtime-mediatek AAR, fetched by the build hook; the NeuroPilot runtime stays on the device (MediaTek's licence lets it reach users only inside an app).

const NpuStack('MediaTek', stampVendor: 'mediatek', abis: {'android_arm64'})
intel → const NpuStack

Intel NPUs (Lunar Lake, Panther Lake) through OpenVINO, in every Windows x64 build. Google's …_Intel_PTL bundles are stamped IntelOpenVINO / PTL (read from the published 270m, 440m and 740m, revisions 9be6e8b9, e301f74d, 24d962e9); a bare Intel is not LiteRT's stamp.

const NpuStack('Intel', stampVendor: 'intelopenvino', abis: {'windows_x64'})

Properties

abis → Set<String>
The hosts, in Abi.current() spelling, where this package runs this vendor's NPU bundles: the only answer to where a vendor runs, so a host whose ABI is not here is never asked about this vendor.
final
hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
label → String
The vendor's name in messages.
final
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stampVendor → String
The vendor field of the LiteRtStamp LiteRT's compiler writes for this vendor, in lower case.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

forAbi(String abi) → List<NpuStack>
The vendors whose NPU bundles run on abi, in declaration order.
forStamp(String vendor) → NpuStack?
The vendor of a bundle stamped vendor (any case), or null when this package has no dispatch for it.

Constants

values → const List<NpuStack>
A constant List of the values in this enum, in order of their declaration.