koblas

F64CblasKernels

class F64CblasKernels : F64Kernels(source)

The host OpenBLAS behind koblas's level-1 primitives. koblas applies the level-1 dispatch threshold, so these methods normally see only runs worth dispatching, but the F64Kernels contract makes a length of zero legal everywhere and an override of the threshold routes those here. Each routine answers one itself: an empty run sits at the end of its array, where there is no element to take an address of.

Constructors

F64CblasKernels

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

Properties

config

val config: HostBlasConfig(source)

Policy for this level-1 backend instance.

isAvailable

open override val isAvailable: Boolean(source)

The level-1 kernels come from CBLAS.

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.