koblas

F64CblasKernels

The level-1 CBLAS routines from the OpenBLAS instance shared with F64Cblas.

Constructors

F64CblasKernels

constructor(config: HostBlasConfig = HostBlasConfig())(source)

Properties

config

Policy for this level-1 backend instance.

isAvailable

open override val isAvailable: Boolean(source)

Whether this backend can do work on this host. koblas's own implementations always can, so the default is true; a binding reports whether the library it calls resolved.

Each half answers for itself, since a host can provide CBLAS without LAPACKE, or OpenBLAS without UMFPACK. Registration does not consult this: koblas registers its UMFPACK binding on a bare library lookup and lets the binding fall back per call, so a registered backend may still report false here. Read it to report what a host offers, or before installing one explicitly.

minDispatchLength

open override val minDispatchLength: Int(source)

The run length from which this backend replaces the compiled-in kernels, or null for the platform default.

name

open override val name: String(source)

A short backend identifier for diagnostics (e.g. "reference").

priority

open override val priority: Int(source)

Relative preference among the backends offered for one half (F64Blas, F64Decompositions, F64Kernels or a sparse counterpart). registerBackend picks the highest; the portable reference is 0.

Link copied to clipboard

Whether this is koblas's own implementation rather than a binding to a host library. The compiled-in SIMD kernels are portable however fast they are; only something calling out counts as accelerated.

Functions

asum

open override fun asum(v: DoubleArray, vOff: Int, len: Int): Double(source)

Sum of the absolute values of the len entries from vOff (BLAS dasum); 0 for an empty run.

axpy

open override fun axpy(y: DoubleArray, yOff: Int, alpha: Double, x: DoubleArray, xOff: Int, len: Int)(source)

Adds alpha * x(xOff + i) into y(yOff + i) over the first len entries.

dot

open override fun dot(a: DoubleArray, aOff: Int, b: DoubleArray, bOff: Int, len: Int): Double(source)

Sum of a(aOff + i) * b(bOff + i) over the first len entries; 0 for an empty run.

nrm2

open override fun nrm2(v: DoubleArray, vOff: Int, len: Int): Double(source)

Euclidean norm of the len entries from vOff (BLAS dnrm2), 0 for an empty run. Must rescale to stay in range, so a plain sqrt(sum of squares) is not a valid implementation.

scale

open override fun scale(v: DoubleArray, vOff: Int, alpha: Double, len: Int)(source)

Scales the len entries from vOff by alpha.

swap

open override fun swap(a: DoubleArray, aOff: Int, b: DoubleArray, bOff: Int, len: Int)(source)

Exchange the two runs (BLAS dswap). Two loads and two stores an element, so an implementation is bound by memory rather than by issue rate; the default is the plain loop for that reason.

Link copied to clipboard
open fun dot4(a: DoubleArray, aOff: Int, stride: Int, b: DoubleArray, bOff: Int, len: Int, out: DoubleArray, outOff: Int)

Four dots against a shared right operand. For r in 0..3, out(outOff + r) is the dot of the run at aOff + r * stride with the run at bOff. Defaults to four dot calls, so an implementation that can read the shared operand once for all four should override it.

Link copied to clipboard
open fun symvColumn(a: DoubleArray, aOff: Int, x: DoubleArray, xOff: Int, y: DoubleArray, yOff: Int, mult: Double, len: Int): Double

Adds mult * a(k) into y and returns the dot of the same run with x, in one pass. A symmetric product needs both halves of every column, and one pass reads the column once rather than twice.

Link copied to clipboard
open fun symvColumn4(a: DoubleArray, aOff: Int, stride: Int, x: DoubleArray, xOff: Int, y: DoubleArray, yOff: Int, mult: DoubleArray, out: DoubleArray, len: Int)

Four symvColumn runs at aOff + r * stride, their dots landing in out(r). Defaults to four calls, so an implementation that can read x and y once for all four should override it.