Module rustml::blas [] [src]

Bindings for BLAS/ATLAS for high performance vector and matrix operations.

from here:

The BLAS (Basic Linear Algebra Subprograms) are routines that provide standard building blocks for performing basic vector and matrix operations. The Level 1 BLAS perform scalar, vector and vector-vector operations, the Level 2 BLAS perform matrix-vector operations, and the Level 3 BLAS perform matrix-matrix operations. Because the BLAS are efficient, portable, and widely available, they are commonly used in the development of high quality linear algebra software.

There are several implementations of BLAS:

The Netlib BLAS implementation (reference implementation) is usually required when compiling rustml but you can switch to any of these implementations without recompiling rustml simply by setting the LD_PRELOAD environment variable to the location of the library you want to use before running your application.

Example: Let's assume you have installed ATLAS into /opt/atlas and want to start you application with cargo. Then, you can use the ATLAS implementation simply by starting your application as follows (depending on your installation):

LD_PRELOAD=/opt/atlas/lib/libtatlas.so cargo run myapp

Using BLAS for vector and matrix operations

This module provides low level functions to access the BLAS functions. It is highly recommended to use the wrappers in the module ops_inplace which provide a more convenient and safer high level interface.

Enums

Order

Enum to specify how a matrix is arranged. Required for the cblas_* functions.

Transpose

Enum to specify how to transform a matrix before doing an operation on it. Required for the cblas_* functions.

Functions

cblas_daxpy

Computes alpha * x + y and stores the result in y.

cblas_dgemm

Computes alpha * op(A) * op(B) + beta * C and stores the result in C.

cblas_dgemv

Computes alpha * A * x + beta * y or alpha * A^T * x + beta * y and stores the result in y.

cblas_dnrm2

Computes the L2 norm (euclidean norm) of a vector of elements of type f64 (doubles).

cblas_saxpy

Computes alpha * x + y and stores the result in y.

cblas_sgemm

Computes alpha * op(A) * op(B) + beta * C and stores the result in C.

cblas_sgemv

Computes alpha * A * x + beta * y or alpha * A^T * x + beta * y and stores the result in y.

cblas_snrm2

Computes the L2 norm (euclidean norm) of a vector of elements of type f32 (floats