v2026.11.3
All Bundles
Bundle

ONNX Runtime inference library for running pre-trained models. Supports object detection (YOLO), image classification (ResNet), segmentation (DeepLab), pose estimation (OpenPose), face recognition, and Phi-3 text generation. Compile with -lib onnx.

OnnxRuntime

ONNX runtime utilities for querying execution providers.

The execution provider is chosen per session: pass "ep" in the session's config map -- "cpu", "cuda", "dml", "qnn", "vitisai" or "coreml". Without "ep" a session gets the provider the library was built for (GetDefaultProvider). A provider the loaded ONNX Runtime does not carry is refused, with the list of those it does, and the session does not open; it never silently runs on the CPU instead.

Example

providers := OnnxRuntime->GetProviders();
each(p in providers) {
  p->PrintLine();
};

config := Map->New()<String, String>;
if(OnnxRuntime->HasProvider("cuda")) {
  config->Insert("ep", "cuda");
  config->Insert("device_id", "0");
};
session := YoloSession->New("yolo11n.onnx", config);

Operations

GetDefaultProvider # function

Gets the provider a session uses when its config names no "ep" (the provider the native library was built for)

function : GetDefaultProvider() ~ String

Return

TypeDescription
Stringshort name: "cpu", "cuda", "dml", "qnn", "vitisai" or "coreml"

GetProviders # function

Gets available ONNX execution providers (e.g., "DML", "CUDA", "CPU")

function : GetProviders() ~ String[]

Return

TypeDescription
Stringarray of provider name strings

HasProvider # function

Whether the loaded ONNX Runtime carries an execution provider, so a program can pick "ep" before creating a session. Takes the names "ep" takes (case-insensitive); an unknown name is false. Present in the runtime does not guarantee it can start: CUDA also needs the NVIDIA driver, CUDA and cuDNN.

function : HasProvider(name:String) ~ Bool

Parameters

NameTypeDescription
nameStringshort provider name, e.g. "cuda", "dml", "cpu"

Return

TypeDescription
Booltrue if the runtime was built with the provider