Our implementation requires users also to call oski_Init() before calling any of the routines in the public interface. Users may optionally call oski_Close() when the library is no longer needed by an application to free internal data structures.
Modules | |
Error codes and error handling. | |
Set explicit workload hints. | |
Kernels (matrix type-independent implementations). | |
Single- and multivector view creation. | |
Vector views are wrappers around user-declared dense array matrix representations. | |
Data Structures | |
struct | oski_permstruct_t |
Generic row/column permutation structure. More... | |
Defines | |
#define | INVALID_MAT ((oski_matrix_t)NULL) |
Invalid (NULL) matrix handle. | |
#define | INVALID_VEC ((oski_vecview_t)NULL) |
Invalid (NULL) vector view handle. | |
#define | OSKI_CHECK_COPYMODE(x) IS_VAL_IN_RANGE(x, COPY_INPUTMAT, SHARE_INPUTMAT) |
Returns 1 <==> the specified copy mode x is legal. | |
Typedefs | |
typedef oski_permstruct_t * | oski_perm_t |
Permutation handle. | |
Enumerations | |
enum | oski_copymode_t { COPY_INPUTMAT, SHARE_INPUTMAT } |
Input matrix copy modes. More... | |
enum | oski_storage_t { LAYOUT_COLMAJ, LAYOUT_ROWMAJ } |
Dense multiple-vector storage layout. More... | |
enum | oski_matop_t { OP_NORMAL, OP_CONJ, OP_TRANS, OP_CONJ_TRANS } |
Matrix transpose options. More... | |
enum | oski_ataop_t { OP_AT_A, OP_AH_A, OP_A_AT, OP_A_AH } |
Transpose options for matrix-transpose-times-matrix () kernel. More... | |
enum | oski_inmatprop_t { INMATPROP_NULL = -1, MAT_GENERAL = 0, MAT_TRI_UPPER, MAT_TRI_LOWER, MAT_SYMM_UPPER, MAT_SYMM_LOWER, MAT_SYMM_FULL, MAT_HERM_UPPER, MAT_HERM_LOWER, MAT_HERM_FULL, MAT_DIAG_EXPLICIT, MAT_UNIT_DIAG_IMPLICIT, INDEX_ONE_BASED, INDEX_ZERO_BASED, INDEX_UNSORTED, INDEX_SORTED, INDEX_REPEATED, INDEX_UNIQUE, INMATPROP_MAX } |
Input matrix properties. More... | |
Functions | |
oski_value_t | oski_GetMatEntry (const oski_matrix_t A_tunable, oski_index_t row, oski_index_t col) |
Returns the value of a matrix element. | |
int | oski_SetMatEntry (oski_matrix_t A_tunable, oski_index_t row, oski_index_t col, oski_value_t new_val) |
Changes the value of the specified matrix element. | |
int | oski_GetMatClique (const oski_matrix_t A_tunable, const oski_index_t *rows, oski_index_t num_rows, const oski_index_t *cols, oski_index_t num_cols, oski_vecview_t vals) |
Returns a block of values, defined by a clique, from a matrix. | |
int | oski_SetMatClique (oski_matrix_t A_tunable, const oski_index_t *rows, oski_index_t num_rows, const oski_index_t *cols, oski_index_t num_cols, const oski_vecview_t vals) |
Changes a block of values, defined by a clique, in a matrix. | |
int | oski_GetMatDiagValues (const oski_matrix_t A_tunable, oski_index_t diag_num, oski_vecview_t vals) |
Extract the diagonal from , that is, all entries such that . | |
int | oski_SetMatDiagValues (oski_matrix_t A_tunable, oski_index_t diag_num, const oski_vecview_t vals) |
Sets the values along diagonal from , that is, all entries such that . | |
oski_matrix_t | oski_CreateMatCSR (oski_index_t *Aptr, oski_index_t *Aind, oski_value_t *Aval, oski_index_t num_rows, oski_index_t num_cols, oski_copymode_t mode, int k,...) |
Creates and returns a valid tunable matrix object from a compressed sparse row (CSR) representation. | |
oski_matrix_t | oski_CreateMatCSC (oski_index_t *Aptr, oski_index_t *Aind, oski_value_t *Aval, oski_index_t num_rows, oski_index_t num_cols, oski_copymode_t mode, int k,...) |
Creates and returns a valid tunable matrix object from a compressed sparse column (CSC) representation. | |
oski_matrix_t | oski_CopyMat (const oski_matrix_t A_tunable) |
Creates a copy of a matrix object. | |
int | oski_DestroyMat (oski_matrix_t A_tunable) |
Frees object memory associated with a given matrix object. | |
int | oski_IsMatPermuted (const oski_matrix_t A_tunable) |
Checks whether a matrix has been tuned by reordering. | |
const_oski_matrix_t | oski_ViewPermutedMat (const oski_matrix_t A_tunable) |
Given a matrix , possibly reordered during tuning to the form , returns a read-only object corresponding to . | |
const_oski_perm_t | oski_ViewPermutedMatRowPerm (const oski_matrix_t A_tunable) |
Given a matrix , possible reordered during tuning to the form , returns a read-only object corresponding to . | |
const_oski_perm_t | oski_ViewPermutedMatColPerm (const oski_matrix_t A_tunable) |
Given a matrix , possible reordered during tuning to the form , returns a read-only object corresponding to (and NOT ). | |
int | oski_PermuteVecView (const oski_perm_t P, oski_matop_t opP, oski_vecview_t x_view) |
Permute a vector view object, i.e., computes , where . | |
int | oski_TuneMat (oski_matrix_t A_tunable) |
Tune the matrix object using all hints and implicit profiling data. | |
char * | oski_GetMatTransforms (const oski_matrix_t A_tunable) |
Returns a string representation of the data structure transformations that were applied to the given matrix during tuning. | |
int | oski_ApplyMatTransforms (const oski_matrix_t A_tunable, const char *xforms) |
Replace the current data structure for a given matrix object with a new data structure specified by a given string. | |
oski_vecview_t | oski_CreateVecView (oski_value_t *x, oski_index_t length, oski_index_t inc) |
Creates a valid view on a single dense column vector . | |
int | oski_DestroyVecView (oski_vecview_t x) |
Destroy an existing vector view. | |
oski_vecview_t | oski_CopyVecView (const oski_vecview_t x) |
Creates a copy of the given (multi)vector view. |
|
Transpose options for matrix-transpose-times-matrix () kernel.
|
|
Input matrix copy modes. On matrix handle creation, the library copies the user's input matrix arrays in one of two modes:
|
|
Input matrix properties. Properties are divided into subcategories:
Properties within a given subcategory are mutually exclusive, with default values as marked.
|
|
Matrix transpose options. The user may apply the transpose or conjugate transpose of a matrix .
|
|
Dense multiple-vector storage layout. On creation of a dense multiple-vector (i.e., dense matrix), the layout parameter specifies how the data is stored. Let be a logical matrix stored in a dense physical array X with stride . Then,
Following the dense BLAS convention, we sometimes also refer to the stride parameter as the leading dimension. |
|
Replace the current data structure for a given matrix object with a new data structure specified by a given string.
|
|
Creates a copy of a matrix object. Thus, A_copy exists independently of A_tunable and any data upon which A_tunable might depend.
According to these steps, A_copy does not have any of A_tunable's workload hints or implicit workload gathered from implicit profiling.
|
|
Creates a copy of the given (multi)vector view.
|
|
Creates and returns a valid tunable matrix object from a compressed sparse column (CSC) representation.
|
|
Creates and returns a valid tunable matrix object from a compressed sparse row (CSR) representation.
|
|
Creates a valid view on a single dense column vector .
|
|
Frees object memory associated with a given matrix object.
|
|
Destroy an existing vector view.
|
|
Returns a block of values, defined by a clique, from a matrix.
|
|
Extract the diagonal from , that is, all entries such that .
|
|
Returns the value of a matrix element.
|
|
Returns a string representation of the data structure transformations that were applied to the given matrix during tuning.
|
|
Checks whether a matrix has been tuned by reordering.
|
|
Permute a vector view object, i.e., computes , where .
|
|
Changes a block of values, defined by a clique, in a matrix.
|
|
Sets the values along diagonal from , that is, all entries such that .
|
|
Changes the value of the specified matrix element.
|
|
Tune the matrix object using all hints and implicit profiling data.
WHILE !IsTuned(A) AND tuning_time_left > 0 AND i_heur <= NUM_HEURISTICS DO LET heur = GetHeuristic( i_heur ); LET results = NULL IF GetTotalCostEstimate(heur, A) <= tuning_time_left THEN LET t0 = GetTimer(); results = EvaluateHeuristic( heur, A ); // results == NULL if heuristic does not apply to A LET elapsed_time = GetTimer() - t0; tuning_time_left -= elapsed_time; ENDIF IF results THEN LET t0 = GetTimer(); A_tuned = ApplyHeuristic( heur, results, A ); // convert A to new data structure LET elapsed_time = GetTimer() - t0; tuning_time_left -= elapsed_time; A = ChooseFastest( A, A_tuned, A->trace ); ENDIF i_heur = i_heur + 1; DONE
|
|
Given a matrix , possibly reordered during tuning to the form , returns a read-only object corresponding to .
|
|
Given a matrix , possible reordered during tuning to the form , returns a read-only object corresponding to (and NOT ).
|
|
Given a matrix , possible reordered during tuning to the form , returns a read-only object corresponding to .
|