Matrix types are identified by three pieces of information:
The library maintains a list of the available matrix types (g_avail_mattypes). This list is managed via the matrix type manager module (oski/mattypes.h).
We use this matrix type system for two reasons:
Regarding incomplete kernel implementations, an implementor of a new matrix type does not, for example, have to define sparse kernel since a default implementation based on just matrix-vector multiply is possible. However, if she can provide a special tuned implementation, she may do so.
Matrix types implement the interface defined in Matrix Type Interface, where we distinguish betwen the methods a matrix type must provide versus those it may provide.
If you are implementing a new matrix type, start with the code in the matrix type template (Matrix Type Template) and refer to any of the existing types for detailed examples.
|Matrix type management routines. |
|Defines a matrix type record. |
|Define the scalar types available to the library. |
|\ Block compressed sparse row data structure. |
|Matrix Type Interface|
|This interface defines the list of possible routines the library expects a matrix type may implement. |
|Block Compressed Sparse Row (BCSR) Format|
|Single Block Diagonal (BDIAG1) Format|
|BDIAG1 format stores only 1 block diagonal of a matrix, where the blocks are stored as dense blocks of size . |
|Cache Blocked (CB) Format|
|Cache blocking implementation in which each submatrix is stored as a complete matrix handle to an arbitrary matrix type. |
|Compressed Sparse Column (CSC) Format|
|The CSC implementation reuses most of the CSR (Compressed Sparse Row (CSR) Format) infrastructure, since the arrays representing a matrix in CSC format are the same as the arrays that would be used to store in CSR format. |
|Compressed Sparse Row (CSR) Format|
|BeBOP-OSKI supports a general form of compressed sparse row, with the following "features":|
|Dense (DENSE) Format|
|Dense matrix in unpacked column major format. |
|Generalized Compressed Sparse Row (GCSR) Format|
|Generalized compressed sparse row (GCSR) format augments the traditional CSR with an optional list of row indices, allowing entire rows to be sparse. |
|Matrix Type Template|
|Developers implementing their own matrix types can start with this template, replacing all instances of MATTYPE_TEMPLATE within these files to the custom matrix type name (e.g., CSR, BCSR). |
|Modified Block Compressed Sparse Row (MBCSR) Format|
|Modified block compressed sparse row format stores the block diagonal elements separately from the off-diagonal elements. |
|Variable Block Row (VBR) Format|
|Variable block row (VBR) format logically partitions the rows and columns, and stores all non-zero blocks block-row-wise. |