BeBOP: pOSKI
v1.0.0
parallel Optimized Sparse Kernel Interface library
|
Handle the tunable sparse matrix object. More...
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <poski/poski_threadcommon.h>
#include <poski/poski_thread.h>
#include <poski/poski_partitioncommon.h>
#include <poski/poski_partition.h>
#include <poski/poski_matrixcommon.h>
#include <poski/poski_matrixgetset.h>
#include <poski/poski_kernelcommon.h>
#include <poski/poski_malloc.h>
#include <poski/poski_print.h>
Functions | |
poski_mat_t | poski_CreateMatCSR (poski_index_t *ptr, poski_index_t *ind, poski_value_t *val, poski_index_t nrows, poski_index_t ncols, poski_index_t nnz, poski_copymode_t mode, poski_threadarg_t *threadargs, poski_partitionarg_t *partitionargs, int k,...) |
Create a tunable matrix object in CSR format. | |
poski_mat_t | poski_CreateMatCSRFile (poski_sparse_matrix_t *SpA, poski_copymode_t mode, poski_threadarg_t *threadargs, poski_partitionarg_t *partitionargs, int k,...) |
Create a tunable matrix object in CSR format. | |
int | poski_DestroyMat (poski_mat_t A_tunable) |
Destroy the tunable matrix object. | |
int | poski_SetMatEntry (poski_mat_t A_tunable, poski_int_t row, poski_int_t col, poski_value_t val) |
Change the value of the specified matrix element. | |
poski_value_t | poski_GetMatEntry (poski_mat_t A_tunable, poski_int_t row, poski_int_t col) |
Returns the value of the specified matrix element in A(row,col). | |
int | poski_SetMatSubset (poski_mat_t A_tunable, const int numRows, const int numCols, const int rowStride, const int colStride, const poski_int_t *rows, const poski_int_t *cols, const poski_value_t *vals, poski_subsettype_t subsettype) |
Set a subset of non-zero values, specified as a clique or indexed list. | |
int | poski_GetMatSubset (poski_mat_t A_tunable, const int numRows, const int numCols, const int rowStride, const int colStride, const poski_int_t *rows, const poski_int_t *cols, poski_value_t *vals, poski_subsettype_t subsettype) |
Get a subset of values, specified as a subset or indexed list. | |
int | poski_report_tunable_matrix (poski_mat_t mat) |
Report information of a tunable matrix object. |
Handle the tunable sparse matrix object.
This module implements the routines to handle the tunable sparse matrix object.
Also, refer poski_Matrix_common.c, poski_Matrix_getset.c
poski_mat_t poski_CreateMatCSR | ( | poski_index_t * | ptr, |
poski_index_t * | ind, | ||
poski_value_t * | val, | ||
poski_index_t | nrows, | ||
poski_index_t | ncols, | ||
poski_index_t | nnz, | ||
poski_copymode_t | mode, | ||
poski_threadarg_t * | threadargs, | ||
poski_partitionarg_t * | partitionargs, | ||
int | k, | ||
... | |||
) |
Create a tunable matrix object in CSR format.
[in] | ptr | CSR row pointers. |
[in] | ind | CSR column indices. |
[in] | val | CSR non-zero values. |
[in] | nrows | Number of rows. |
[in] | ncols | Number of columns. |
[in] | nnz | Number of non-zeros. |
[in] | mode | Copy mode in {SHARE_INPUTMAT, COPY_INPUTMAT} for matrix creation routines. |
[in] | threadargs | Threading model information. |
[in] | partitionargs | Partitioning model information. |
[in] | k | Number of explicitly specified semantic properties of a sparse matrix (ptr, ind, val). |
[in] | ... | Specified semantic properties . See poski_inmatprop_t. |
This routine performs as follows:
(1) error-check for the input parameters.
(2) collect the specified semantic properies.
(3) allocate the space for a new tunable matrix object, and initailize it.
(4) create the partitioned submatrices.
(5) clean-up the temporary stroage and return the tunable matrix object.
poski_mat_t poski_CreateMatCSRFile | ( | poski_sparse_matrix_t * | SpA, |
poski_copymode_t | mode, | ||
poski_threadarg_t * | threadargs, | ||
poski_partitionarg_t * | partitionargs, | ||
int | k, | ||
... | |||
) |
Create a tunable matrix object in CSR format.
[in] | SpA | Sparse matrix in CSR format. |
[in] | mode | Copy mode in {SHARE_INPUTMAT, COPY_INPUTMAT} for matrix creation routines. |
[in] | threadargs | Threading model information. |
[in] | partitionargs | Partitioning model information. |
[in] | k | Number of explicitly specified semantic properties of a sparse matrix (ptr, ind, val). |
[in] | ... | Specified semantic properties . See poski_inmatprop_t. |
This routine performs as follows:
(1) error-check for the input parameters.
(2) collect the specified semantic properies.
(3) allocate the space for a new tunable matrix object, and initailize it.
(4) create the partitioned submatrices.
(5) clean-up the temporary stroage and return the tunable matrix object.
int poski_DestroyMat | ( | poski_mat_t | A_tunable | ) |
Destroy the tunable matrix object.
[in] | A_tunable | A tunable matrix object. |
int poski_SetMatEntry | ( | poski_mat_t | A_tunable, |
poski_int_t | row, | ||
poski_int_t | col, | ||
poski_value_t | val | ||
) |
Change the value of the specified matrix element.
[in,out] | A_tunable | The tunable matrix object. |
[in] | row | The specified row of the element whose value is to be modified. |
[in] | col | The specified column of the element whose value is to be modified. |
[in] | val | The specified value to modify. |
poski_value_t poski_GetMatEntry | ( | poski_mat_t | A_tunable, |
poski_int_t | row, | ||
poski_int_t | col | ||
) |
Returns the value of the specified matrix element in A(row,col).
[in] | A_tunable | The tunable matrix object. |
[in] | row | The specified row of the elemenit whose value is to be returned. |
[in] | col | The specified column of the element whose value is to be returned. |
int poski_SetMatSubset | ( | poski_mat_t | A_tunable, |
const int | numRows, | ||
const int | numCols, | ||
const int | rowStride, | ||
const int | colStride, | ||
const poski_int_t * | rows, | ||
const poski_int_t * | cols, | ||
const poski_value_t * | vals, | ||
poski_subsettype_t | subsettype | ||
) |
Set a subset of non-zero values, specified as a clique or indexed list.
This imitates the USCR_INSERT_CLIQUE Sparse BLAS standard interface. See p. 128 (Chapter 3) of the BLAS standard. A clique is typically how one defines an element for matrix assembly in the finite element method.
If insertion of any entry of the subset does not succeed, the entry is not changed.
A_tunable | [in/out] The tunable matrix object. |
numRows | [in] Number of rows in the subset. |
numCols | [in] Number of columns in the subset. |
rowStride | [in] Stride between rows of vals. |
colStride | [in] Stride between columns of vals. |
rows | [in] Row indices of the subset. |
cols | [in] Column indices of the subset. |
vals | [in] Dense matrix storing the subset entries. |
subsettype | [in] The type of subset in {POSKI_BLOCKENTRIES, POSKI_ARRAYENTRIES} |
int poski_GetMatSubset | ( | poski_mat_t | A_tunable, |
const int | numRows, | ||
const int | numCols, | ||
const int | rowStride, | ||
const int | colStride, | ||
const poski_int_t * | rows, | ||
const poski_int_t * | cols, | ||
poski_value_t * | vals, | ||
poski_subsettype_t | subsettype | ||
) |
Get a subset of values, specified as a subset or indexed list.
A_tunable | [in] The tunable matrix object. |
numRows | [in] Number of rows in the subset. |
numCols | [in] Number of columns in the subset. |
rowStride | [in] Stride between rows of vals. |
colStride | [in] Stride between columns of vals. |
rows | [in] Row indices of the subset. |
cols | [in] Column indices of the subset. |
vals | [in/out] Dense matrix storing the subset entries. |
subsettype | [in] The type of subset in {POSKI_BLOCKENTRIES, POSKI_ARRAYENTRIES} |
int poski_report_tunable_matrix | ( | poski_mat_t | mat | ) |
Report information of a tunable matrix object.
[in] | mat | A tuanble matrix object. |