blas.c File Reference


Detailed Description

OSKI wrappers around the dense BLAS routines.

#include <oski/common.h>
#include <oski/config.h>
#include <oski/blas.h>
#include <oski/blas_names.h>

Functions

void BLAS_xSCAL (const oski_index_t *restrict len, oski_value_t *restrict alpha, oski_value_t *restrict x, const oski_index_t *restrict stride)
 This implementation assumes a general (*alpha).
void BLAS_xAXPY (const oski_index_t *restrict len, const oski_value_t *restrict alpha, const oski_value_t *restrict x, const oski_index_t *restrict incx, oski_value_t *restrict y, const oski_index_t *restrict incy)
 This implementation assumes a general (*alpha).
static void ZeroDenseMatRowmaj (oski_value_t *x, oski_index_t m, oski_index_t n, oski_index_t stride)
 Set all elements of a dense matrix, stored using row-major layout, to 0.
static void ZeroDenseMatColmaj (oski_value_t *x, oski_index_t m, oski_index_t n, oski_index_t stride)
 Set all elements of a dense matrix, stored using column-major layout, to 0.
int oski_ZeroVecView (oski_vecview_t x)
 Set all elements of a vector view $x$ to zero.
int oski_ScaleVecView (oski_vecview_t x, oski_value_t alpha)
 Computes $x \leftarrow \alpha\cdot x$.
int oski_RectScaledIdentityMult (oski_value_t alpha, const oski_vecview_t x, oski_vecview_t y)
 Computes $y \leftarrow y + \alpha I_{m\times n}\cdot x$, where $I_{m\times n}$ is an $m\times n$ matrix such that $I(k,k) = 1$ for all $1 \leq k \leq \min(m,n)$.
int oski_AXPYVecView (const oski_vecview_t x, oski_value_t alpha, oski_vecview_t y)
 Computes $y \leftarrow y + \alpha\cdot x$.
int oski_ConjVecView (oski_vecview_t x)
 Computes the complex conjugate of a vector view, i.e., $x \leftarrow \bar{x}$.


Function Documentation

void BLAS_xAXPY const oski_index_t *restrict  len,
const oski_value_t *restrict  alpha,
const oski_value_t *restrict  x,
const oski_index_t *restrict  incx,
oski_value_t *restrict  y,
const oski_index_t *restrict  incy
 

This implementation assumes a general (*alpha).

The caller should implement special tests when alpha is a special value (e.g., 0, 1, -1).

Todo:
Correctly implement the negative stride case (not used in BeBOP).

Considers the following special cases:

  • Both x and y are unit-stride accessible.
  • Only x or y are unit-stride accessible.
  • Both x and y require strided access.

void BLAS_xSCAL const oski_index_t *restrict  len,
oski_value_t *restrict  alpha,
oski_value_t *restrict  x,
const oski_index_t *restrict  stride
 

This implementation assumes a general (*alpha).

The caller should implement special tests when alpha is a special value (e.g., 0, 1, -1).

Todo:
Correctly implement the negative stride case (not used in BeBOP).
Considers the unit-stride special case.

int oski_RectScaledIdentityMult oski_value_t  alpha,
const oski_vecview_t  x,
oski_vecview_t  y
 

Computes $y \leftarrow y + \alpha I_{m\times n}\cdot x$, where $I_{m\times n}$ is an $m\times n$ matrix such that $I(k,k) = 1$ for all $1 \leq k \leq \min(m,n)$.

Precondition:
x and y must be valid views.

int oski_ScaleVecView oski_vecview_t  x,
oski_value_t  alpha
 

Computes $x \leftarrow \alpha\cdot x$.

Parameters:
[in,out] x A valid vector view.
[in] alpha Scalar multiplier.

int oski_ZeroVecView oski_vecview_t  x  ) 
 

Set all elements of a vector view $x$ to zero.

Parameters:
[in] x Valid vector view.
Returns:
0 on success, or an error code on err.

static void ZeroDenseMatColmaj oski_value_t *  x,
oski_index_t  m,
oski_index_t  n,
oski_index_t  stride
[static]
 

Set all elements of a dense matrix, stored using column-major layout, to 0.

Parameters:
[in,out] x Array storing the matrix.
[in] m Logical number of logical rows.
[in] n Logical number of logical columns.
[in] stride Leading-dimension.
Postcondition:
All elements of the logical matrix are set to 0.

static void ZeroDenseMatRowmaj oski_value_t *  x,
oski_index_t  m,
oski_index_t  n,
oski_index_t  stride
[static]
 

Set all elements of a dense matrix, stored using row-major layout, to 0.

Parameters:
[in,out] x Array storing the matrix.
[in] m Logical number of logical rows.
[in] n Logical number of logical columns.
[in] stride Leading-dimension.
Postcondition:
All elements of the logical matrix are set to 0.


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