Multik 0.3.0 Help

Engines of Multik

Overview

Multik exposes a single API, but the actual math, linear algebra, and statistics work is performed by an engine. Engines are interchangeable implementations, so the same ndarray code can run on different platforms and backends.

By default, Multik picks a suitable engine at runtime. You can also select an engine explicitly when you need predictable performance or platform behavior.

Built-in engines

Engine

Artifact

Best for

Notes

DEFAULT

multik-default

Most projects

Chooses the best available engine.

KOTLIN

multik-kotlin

Maximum portability

Pure Kotlin, works everywhere.

NATIVE

multik-openblas

CPU-heavy math

Uses OpenBLAS where supported.

Selecting an engine

Multik exposes a map of available engines and lets you set the default one:

println(mk.engines.keys) // e.g., [DEFAULT, KOTLIN, NATIVE] mk.setEngine(KEEngineType) // switch to the Kotlin engine

You can also check the current engine:

println(mk.engine)

If you try to select an engine that is not available, mk.setEngine(...) throws an EngineMultikException.

Choosing the right engine

  • DEFAULT - best for most users; a good balance of convenience and performance.

  • KOTLIN - safest choice for multiplatform code or environments without native dependencies.

  • NATIVE - best for CPU-heavy linear algebra when OpenBLAS is available.

For platform-specific details and support, see Multik on different platforms.

19 February 2026