ComputeBackend

The compute backend an engine executes on.

Engines receive the requested backend through BackendConfig.backend and resolve it against the backends actually available on the current device/build with resolve before initializing native state.

Entries

Link copied to clipboard

Let the engine pick the best available backend (see AUTO_PREFERENCE_ORDER).

Link copied to clipboard

CPU execution only (Apple Accelerate / ARM NEON / x86 SIMD). Never touches a GPU.

Link copied to clipboard

Apple Metal GPU (iOS, macOS).

Link copied to clipboard

Vulkan GPU (Android, Linux, Windows).

Link copied to clipboard

Apple Neural Engine via Core ML (iOS Whisper encoder). Falls back to Metal, then CPU.

Link copied to clipboard

OpenCL GPU (Android, from the optional kggml-runtime-opencl add-on; ggml's OpenCL backend is tuned for Qualcomm Adreno). Falls back to the CPU.

Types

Link copied to clipboard
object Companion

Constants and factory functions of ComputeBackend.

Companion properties

Link copied to clipboard

Returns an immutable kotlin.enums.EnumEntries list containing the constants of this enum type, in the order they're declared.

Companion functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.

Properties

Link copied to clipboard

The backend to try next when this one is unavailable, or null for CPU_ONLY (which is always available) and AUTO (which is resolved by preference order instead).

Link copied to clipboard

true if this backend offloads work to a GPU or NPU (i.e. it is neither CPU_ONLY nor AUTO).

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int