koblas

koblas API reference

Portable double-precision dense and sparse BLAS Levels 1–3 for Kotlin Multiplatform.

The immutable koblas engine uses owned Vector API kernels on desktop JDK 25 or later with the incubator module, and portable Kotlin on Android, iOS devices and simulators, and other supported JVMs. With native access enabled, the JVM can also compose oneMKL for eligible Level 3 calls on Intel x64 Linux and Windows. Linux, Windows and macOS Kotlin/Native compose optional installed host calls with portable fallback. Windows reuses the Linux routing thresholds and vendor preference order, with separately installed oneMKL, AOCL, ArmPL or OpenBLAS DLLs. Windows Arm64 is available through the JVM; Kotlin/Native supports Windows x64. Explicit vendor bindings preserve their own arithmetic and overlap contracts; openBlas returns null on Android, JDKs below 25, or a host with no supported library. The JVM publication is one multi-release JAR with no bundled native code.

Container conveniences in com.eignex.koblas call the BLAS contracts through the default engine. The dense and sparse packages expose operations and useful raw array arithmetic; scheduling and panel/product/triangular implementation interfaces are internal. The vendor package contains explicit host bindings, which platform engines may compose into eligible dense calls. Schedules and kernels receive their dependencies from the engine; they do not read the global default.

Workspace reuses temporary storage with bounded retention. It belongs to one invocation at a time; concurrent calls need separate outputs and scratch. Allocating operations still own their fresh results. Factorization and solver workflows are outside this artifact.

KoblasEngine.portable creates an immutable application engine using portable Kotlin for every operation, without an opt-in, host library or JVM flags. Call that instance directly; container conveniences continue to use the platform default. Each routine permits normal BLAS rounding, FMA and reduction-order latitude. Norms retain finite-range scaling; unspecified exceptional results and tied-index choices belong to the selected implementation. Concurrent calls need separate mutable destinations and workspaces.

BuiltinEngines names exact engines for tests and benchmarks, without annotation opt-ins. Blas.routeOf describes an explicit host call. The host binding exposes its resolved binary, version and thread evidence.

Packages

Link copied to clipboard
common
native
Link copied to clipboard
common

DenseVectorKernels supplies Level 1 arithmetic over array windows and strides. DenseBlas supplies the Level 2 and 3 contracts, with shared portable traversal, validation, no-read behavior and alias staging.

Link copied to clipboard
common

SparseBlas provides portable CSC matrix-vector and matrix-matrix products, symmetric/rank-k operations, triangular multiply/solve, scaled addition and transpose, over the engine's Level 1 kernels.

Link copied to clipboard
common
native