matmult.h File Reference


Detailed Description

Sparse matrix-vector multiply implementation.

#include <oski/mangle.h>
#include <oski/matrix.h>
#include <oski/vecview.h>

Go to the source code of this file.

Data Structures

struct  oski_traceargs_MatMult_t
 Trace argument signature for oski_MatMult(). More...

Name mangling.

#define oski_MatMult_funcpt   MANGLE_(oski_MatMult_funcpt)
#define oski_MatReprMult_funcpt   MANGLE_(oski_MatReprMult_funcpt)
#define oski_MatMult   MANGLE_(oski_MatMult)
#define oski_CheckArgsMatMult   MANGLE_(oski_CheckArgsMatMult)
#define oski_traceargs_MatMult_t   MANGLE_(oski_traceargs_MatMult_t)
#define oski_MakeArglistMatMult   MANGLE_(oski_MakeArglistMatMult)

Tracing.

#define GET_XFLOP_MatMult(args)   (2.0*((const oski_traceargs_MatMult_t *)(args))->num_vecs)
 Compute the "flop factor.".
void oski_MakeArglistMatMult (oski_matop_t opA, oski_value_t alpha, const oski_vecview_t x_view, oski_value_t beta, const oski_vecview_t y_view, oski_traceargs_MatMult_t *args)
 Initialize a static argument signature.

Defines

#define INC_OSKI_MATMULT_H
 oski/matmul.h included.
#define OSKI_MATMULT_COMPAT_DIMS(m_A, k_A, k_B, n_B, m_C, n_C)
 Returns 1 <==> multiply dimensions are compatible.
#define OSKI_MATTRANSMULT_COMPAT_DIMS(m_A, k_A, k_B, n_B, m_C, n_C)
 Returns 1 <==> transpose-multiply dimensions are compatible.
#define OSKI_MATMULT_COMPAT_OBJ_DIMS(A, B, C)
 Returns 1 <==> multiply dimensions are compatible.
#define OSKI_MATTRANSMULT_COMPAT_OBJ_DIMS(A, B, C)
 Returns 1 <==> transpose-multiply dimensions are compatible.

Typedefs

typedef int(* oski_MatMult_funcpt )(const oski_matrix_t A_tunable, oski_matop_t opA, oski_value_t alpha, const oski_vecview_t x_view, oski_value_t beta, oski_vecview_t y_view)
 Function pointer type for oski_MatMult().
typedef int(* oski_MatReprMult_funcpt )(const void *A, const oski_matcommon_t *props, oski_matop_t opA, oski_value_t alpha, const oski_vecview_t x_view, oski_value_t beta, oski_vecview_t y_view)
 Function pointer type for a matrix type-specific implementation of oski_MatMult().

Functions

int oski_MatMult (const oski_matrix_t A_tunable, oski_matop_t opA, oski_value_t alpha, const oski_vecview_t x_view, oski_value_t beta, oski_vecview_t y_view)
 Computes $y \leftarrow \alpha\cdot\mathrm{op}(A)x + \beta\cdot y$, where $\mathrm{op}(A) \in \{A, A^T, A^H\}$.
int oski_CheckArgsMatMult (const oski_matrix_t A_tunable, oski_matop_t opA, oski_value_t alpha, const oski_vecview_t x_view, oski_value_t beta, const oski_vecview_t y_view, const char *caller)
 Checks validity of arguments to a routine with a matrix vector multiply signature.


Define Documentation

#define OSKI_MATMULT_COMPAT_DIMS m_A,
k_A,
k_B,
n_B,
m_C,
n_C   ) 
 

Value:

( OSKI_CHECK_MAT_DIMS(m_A, k_A) && OSKI_CHECK_MAT_DIMS(k_B, n_B) \
          && OSKI_CHECK_MAT_DIMS(m_C, n_C) \
              && ((m_A) == (m_C)) && ((k_A) == (k_B)) && ((n_B) == (n_C)) )
Returns 1 <==> multiply dimensions are compatible.

Given a desired matrix multiply operation, $C \leftarrow A \times B$, returns 1 <==> the dimensions of all three matrices are legal and compatible.

By 'legal,' we mean according to OSKI_CHECK_MAT_DIMS, which this routine also calls.

Parameters:
[in] m_A Number of rows in A.
[in] k_A Number of columns in A.
[in] k_B Number of rows in B.
[in] n_B Number of columns in B.
[in] m_C Number of rows in C.
[in] n_C Number of columns in C.
See also:
OSKI_CHECK_MAT_DIMS, OSKI_MATTRANSMULT_COMPAT_DIMS

#define OSKI_MATMULT_COMPAT_OBJ_DIMS A,
B,
 ) 
 

Value:

OSKI_MATMULT_COMPAT_DIMS( (A)->num_rows, (A)->num_cols, \
        ((B) == INVALID_VEC) \
        || ((B) == SYMBOLIC_VEC) || ((B) == SYMBOLIC_MULTIVEC) \
            ? (A)->num_cols : (B)->num_rows, \
        ((B) == INVALID_VEC) \
        || ((B) == SYMBOLIC_VEC) || ((B) == SYMBOLIC_MULTIVEC) \
            ? (C)->num_cols : (B)->num_cols, \
        ((C) == INVALID_VEC) \
        || ((C) == SYMBOLIC_VEC) || ((C) == SYMBOLIC_MULTIVEC) \
            ? (A)->num_rows : (C)->num_rows, \
        ((C) == INVALID_VEC) \
        || ((C) == SYMBOLIC_VEC) || ((C) == SYMBOLIC_MULTIVEC) \
            ? (B)->num_cols : (C)->num_cols \
    )
Returns 1 <==> multiply dimensions are compatible.

This routine is a high-level object wrapper around an equivalent call to OSKI_CHECK_MAT_DIMS(). Specifically, this routine assumes the operands A, B, and C are pointers to structs containing 'num_rows' and 'num_cols' fields.

A must be a valid object. However, either B or C may be NULL, in which case the missing argument is assumed to have the correct dimensions. B and C must not both be NULL, however.

#define OSKI_MATTRANSMULT_COMPAT_DIMS m_A,
k_A,
k_B,
n_B,
m_C,
n_C   ) 
 

Value:

( OSKI_CHECK_MAT_DIMS(m_A, k_A) && OSKI_CHECK_MAT_DIMS(k_B, n_B) \
          && OSKI_CHECK_MAT_DIMS(m_C, n_C) \
              && ((k_A) == (m_C)) && ((m_A) == (k_B)) && ((n_B) == (n_C)) )
Returns 1 <==> transpose-multiply dimensions are compatible.

Given a desired matrix multiply operation, $C \leftarrow op(A) \times B$, where $op(A) \in \{A^T, A^H\}$, returns 1 <==> the dimensions of all three matrices are legal and compatible.

By 'legal,' we mean according to OSKI_CHECK_MAT_DIMS, which this routine also calls.

Parameters:
[in] m_A Number of rows in A.
[in] k_A Number of columns in A.
[in] k_B Number of rows in B.
[in] n_B Number of columns in B.
[in] m_C Number of rows in C.
[in] n_C Number of columns in C.
See also:
OSKI_CHECK_MAT_DIMS, OSKI_MATMULT_COMPAT_DIMS

#define OSKI_MATTRANSMULT_COMPAT_OBJ_DIMS A,
B,
 ) 
 

Value:

OSKI_MATTRANSMULT_COMPAT_DIMS( (A)->num_rows, (A)->num_cols, \
        ((B) == INVALID_VEC) \
        || ((B) == SYMBOLIC_VEC) || ((B) == SYMBOLIC_MULTIVEC) \
            ? (A)->num_rows : (B)->num_rows, \
        ((B) == INVALID_VEC) \
        || ((B) == SYMBOLIC_VEC) || ((B) == SYMBOLIC_MULTIVEC) \
            ? (C)->num_cols : (B)->num_cols, \
        ((C) == INVALID_VEC) \
        || ((C) == SYMBOLIC_VEC) || ((C) == SYMBOLIC_MULTIVEC) \
            ? (A)->num_cols : (C)->num_rows, \
        ((C) == INVALID_VEC) \
        || ((C) == SYMBOLIC_VEC) || ((C) == SYMBOLIC_MULTIVEC) \
            ? (B)->num_cols : (C)->num_cols \
    )
Returns 1 <==> transpose-multiply dimensions are compatible.

This routine is a high-level object wrapper around an equivalent call to OSKI_CHECK_MAT_DIMS(). Specifically, this routine assumes the operands A, B, and C are pointers to structs containing 'num_rows' and 'num_cols' fields.

A must be a valid object. However, either B or C may be NULL or symbolic, in which case the missing argument is assumed to have the correct dimensions. B and C must not both be NULL (though they may both be symbolic), however.


Function Documentation

int oski_CheckArgsMatMult const oski_matrix_t  A_tunable,
oski_matop_t  opA,
oski_value_t  alpha,
const oski_vecview_t  x_view,
oski_value_t  beta,
const oski_vecview_t  y_view,
const char *  caller
 

Checks validity of arguments to a routine with a matrix vector multiply signature.

Returns:
0 if all arguments are OK, or an error code (plus a call to the error handler) otherwise.


Generated on Wed Sep 19 16:41:22 2007 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.4.6