BeBOP: pOSKI  v1.0.0
parallel Optimized Sparse Kernel Interface library
 All Files Functions Variables
Functions
poski_KernelHandler.c File Reference

Handle the Sparse matrix kernels. More...

#include <stdio.h>
#include <stdlib.h>
#include <poski/poski_kernelcommon.h>
#include <poski/poski_partitioncommon.h>
#include <poski/poski_matrixcommon.h>
#include <poski/poski_vectorcommon.h>
#include <poski/poski_vector.h>
#include <poski/poski_print.h>

Functions

int poski_Set_MatMult (poski_mat_t A, poski_operation_t op, poski_value_t alpha, poski_vec_t x, poski_value_t beta, poski_vec_t y)
 Set parameters for sparse matrix-vector multiply.
int poski_MatMult (poski_mat_t A, poski_operation_t op, poski_value_t alpha, poski_vec_t x, poski_value_t beta, poski_vec_t y)
 Sparse matrix-vector multiply implementation.
int poski_report_MatMultCSR (poski_sparse_matrix_t *A, poski_value_t alpha, poski_value_t *x, poski_value_t beta, poski_value_t *y)
 Report the information related with sparse matrix-vector multiply computation.

Detailed Description

Handle the Sparse matrix kernels.

This module implements the library's support kernels which perform error-checking first and then calls the appropriate kernel implementation.

Attention:
Currently, only support Ax and A^Tx kernels.

Also, refer poski_Kernel_common.c, poski_Kernel_matmult.c


Function Documentation

int poski_Set_MatMult ( poski_mat_t  A,
poski_operation_t  op,
poski_value_t  alpha,
poski_vec_t  x,
poski_value_t  beta,
poski_vec_t  y 
)

Set parameters for sparse matrix-vector multiply.

Parameters:
[in]ASparse matrix object.
[in]opSpecifies the transpose operations, $op(A)$ in {OP_NORMAL, OP_TRANS}.
[in]alphaScalar multiplier.
[in]xVector view object.
[in]betaScalar multiplier.
[in]yVector view object.
Returns:
0 if success, or an error message otherwise.
int poski_MatMult ( poski_mat_t  A,
poski_operation_t  op,
poski_value_t  alpha,
poski_vec_t  x,
poski_value_t  beta,
poski_vec_t  y 
)

Sparse matrix-vector multiply implementation.

Parameters:
[in]ASparse matrix object.
[in]opSpecifies the transpose operations, $op(A)$ in {OP_NORMAL, OP_TRANS}.
[in]alphaScalar multiplier.
[in]xVector view object.
[in]betaScalar multiplier.
[in]yVector view object.
Returns:
0 if success, or an error message otherwise.

This routine performs as follows:

(1) error-check for the input parameters.

(2) run an appropriate kernel operation, currently only support ${A, A^T}$ transpose operations.

(3) run an appropriate permute operation if required.

(4) run an appropriate reduction operation if required.

int poski_report_MatMultCSR ( poski_sparse_matrix_t *  A,
poski_value_t  alpha,
poski_value_t *  x,
poski_value_t  beta,
poski_value_t *  y 
)

Report the information related with sparse matrix-vector multiply computation.

Parameters:
[in]ASparse matrix object in CSR format.
[in]alphaScalar multiplier.
[in]xVector data pointer.
[in]betaScalar multiplier.
[in]yVector data pointer.
Returns:
0 if success, or an error message otherwise.