MAGMA  1.5.0
Matrix Algebra for GPU and Multicore Architectures
 All Functions Groups
double precision

Functions

magma_int_t magma_djacobisetup_matrix (magma_d_sparse_matrix A, magma_d_vector b, magma_d_sparse_matrix *M, magma_d_vector *d)
 Prepares the Matrix M for the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k. More...
 
magma_int_t magma_djacobisetup_diagscal (magma_d_sparse_matrix A, magma_d_vector *d)
 It returns a vector d containing the inverse diagonal elements. More...
 
magma_int_t magma_djacobisetup_vector (magma_d_vector b, magma_d_vector d, magma_d_vector *c)
 Prepares the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k. More...
 
magma_int_t magma_djacobisetup (magma_d_sparse_matrix A, magma_d_vector b, magma_d_sparse_matrix *M, magma_d_vector *c)
 Prepares the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k. More...
 
magma_int_t magma_djacobiiter (magma_d_sparse_matrix M, magma_d_vector c, magma_d_vector *x, magma_d_solver_par *solver_par)
 Iterates the solution approximation according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k. More...
 
magma_int_t magma_dfrobenius (magma_d_sparse_matrix A, magma_d_sparse_matrix B, real_Double_t *res)
 Computes the Frobenius norm of the difference between the CSR matrices A and B. More...
 
magma_int_t magma_dinitguess (magma_d_sparse_matrix A, magma_d_sparse_matrix *L, magma_d_sparse_matrix *U)
 Computes an initial guess for the iterative ILU/IC. More...
 
magma_int_t magma_dmhom_fd (magma_d_sparse_matrix A, magma_int_t n, magma_int_t b, magma_index_t *p)
 – MAGMA (version 1.5.0-beta3) – Univ. More...
 
magma_int_t magma_dmreorder (magma_d_sparse_matrix A, magma_int_t n, magma_int_t b, magma_d_sparse_matrix *B)
 – MAGMA (version 1.5.0-beta3) – Univ. More...
 
void magma_dcompactActive (magma_int_t m, magma_int_t n, double *dA, magma_int_t ldda, magma_index_t *active)
 ZCOMPACTACTIVE takes a set of n vectors of size m (in dA) and an array of 1s and 0sindicating which vectors to compact (for 1s) and which to disregard (for 0s). More...
 
magma_int_t magma_dgeelltmv (magma_trans_t transA, magma_int_t m, magma_int_t n, magma_int_t nnz_per_row, double alpha, double *d_val, magma_index_t *d_colind, double *d_x, double beta, double *d_y)
 This routine computes y = alpha * A^t * x + beta * y on the GPU. More...
 
magma_int_t magma_djacobi_diagscal (int num_rows, double *b, double *d, double *c)
 Prepares the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k. More...
 
magma_int_t magma_dgemvmdot (int n, int k, double *v, double *r, double *d1, double *d2, double *skp)
 This is an extension of the merged dot product above by chunking the set of vectors v_i such that the data always fits into cache. More...
 
magma_int_t magma_d_spmv (double alpha, magma_d_sparse_matrix A, magma_d_vector x, double beta, magma_d_vector y)
 For a given input matrix A and vectors x, y and scalars alpha, beta the wrapper determines the suitable SpMV computing y = alpha * A * x + beta * y. More...
 

Detailed Description

Function Documentation

magma_int_t magma_d_spmv ( double  alpha,
magma_d_sparse_matrix  A,
magma_d_vector  x,
double  beta,
magma_d_vector  y 
)

For a given input matrix A and vectors x, y and scalars alpha, beta the wrapper determines the suitable SpMV computing y = alpha * A * x + beta * y.

Parameters
alphadouble scalar alpha
Amagma_d_sparse_matrix sparse matrix A
xmagma_d_vector input vector x
betadouble scalar beta
ymagma_d_vector output vector y
void magma_dcompactActive ( magma_int_t  m,
magma_int_t  n,
double *  dA,
magma_int_t  ldda,
magma_index_t *  active 
)

ZCOMPACTACTIVE takes a set of n vectors of size m (in dA) and an array of 1s and 0sindicating which vectors to compact (for 1s) and which to disregard (for 0s).

Parameters
[in]mINTEGER The number of rows of the matrix dA. M >= 0.
[in]nINTEGER The number of columns of the matrix dA. N >= 0.
[in,out]dACOMPLEX DOUBLE PRECISION array, dimension (LDDA,N) The m by n matrix dA.
[in]lddaINTEGER The leading dimension of the array dA. LDDA >= max(1,M).
[in]activeINTEGER array, dimension N A mask of 1s and 0s showing if a vector remains or has been removed
magma_int_t magma_dfrobenius ( magma_d_sparse_matrix  A,
magma_d_sparse_matrix  B,
real_Double_t *  res 
)

Computes the Frobenius norm of the difference between the CSR matrices A and B.

They need to share the same sparsity pattern!

Parameters
Amagma_d_sparse_matrix sparse matrix in CSR
Bmagma_d_sparse_matrix sparse matrix in CSR
resreal_Double_t* residual
magma_int_t magma_dgeelltmv ( magma_trans_t  transA,
magma_int_t  m,
magma_int_t  n,
magma_int_t  nnz_per_row,
double  alpha,
double *  d_val,
magma_index_t *  d_colind,
double *  d_x,
double  beta,
double *  d_y 
)

This routine computes y = alpha * A^t * x + beta * y on the GPU.

Input format is ELL.

Parameters
transAmagma_trans_t transposition parameter for A
mmagma_int_t number of rows in A
nmagma_int_t number of columns in A
nnz_per_rowmagma_int_t number of elements in the longest row
alphadouble scalar multiplier
d_valdouble* array containing values of A in ELL
d_colindmagma_int_t* columnindices of A in ELL
d_xdouble* input vector x
betadouble scalar multiplier
d_ydouble* input/output vector y
magma_int_t magma_dgemvmdot ( int  n,
int  k,
double *  v,
double *  r,
double *  d1,
double *  d2,
double *  skp 
)

This is an extension of the merged dot product above by chunking the set of vectors v_i such that the data always fits into cache.

It is equivalent to a matrix vecor product Vr where V contains few rows and many columns. The computation is the same:

skp = ( <v_0,r>, <v_1,r>, .. )

Returns the vector skp.

Parameters
nint length of v_i and r
kint

vectors v_i

Parameters
vdouble* v = (v_0 .. v_i.. v_k)
rdouble* r
d1double* workspace
d2double* workspace
skpdouble* vector[k] of scalar products (<v_i,r>...)
magma_int_t magma_dinitguess ( magma_d_sparse_matrix  A,
magma_d_sparse_matrix *  L,
magma_d_sparse_matrix *  U 
)

Computes an initial guess for the iterative ILU/IC.

Parameters
Amagma_d_sparse_matrix sparse matrix in CSR
Bmagma_d_sparse_matrix* sparse matrix in CSR
magma_int_t magma_djacobi_diagscal ( int  num_rows,
double *  b,
double *  d,
double *  c 
)

Prepares the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k.

Returns the vector c. It calls a GPU kernel

Parameters
num_rowsmagma_int_t number of rows
bmagma_d_vector RHS b
dmagma_d_vector vector with diagonal entries
cmagma_d_vector* c = D^(-1) * b
magma_int_t magma_djacobiiter ( magma_d_sparse_matrix  M,
magma_d_vector  c,
magma_d_vector *  x,
magma_d_solver_par *  solver_par 
)

Iterates the solution approximation according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k.

Parameters
mmagma_d_sparse_matrix input matrix M = D^(-1) * (L+U)
cmagma_d_vector c = D^(-1) * b
xmagma_d_vector* iteration vector x
solver_parmagma_d_solver_par* solver parameters
magma_int_t magma_djacobisetup ( magma_d_sparse_matrix  A,
magma_d_vector  b,
magma_d_sparse_matrix *  M,
magma_d_vector *  c 
)

Prepares the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k.

Parameters
Amagma_d_sparse_matrix input matrix A
bmagma_d_vector RHS b
mmagma_d_sparse_matrix* M = D^(-1) * (L+U)
cmagma_d_vector* c = D^(-1) * b
magma_int_t magma_djacobisetup_diagscal ( magma_d_sparse_matrix  A,
magma_d_vector *  d 
)

It returns a vector d containing the inverse diagonal elements.

Parameters
Amagma_d_sparse_matrix input matrix A
dmagma_d_vector* vector with diagonal elements
magma_int_t magma_djacobisetup_matrix ( magma_d_sparse_matrix  A,
magma_d_vector  b,
magma_d_sparse_matrix *  M,
magma_d_vector *  d 
)

Prepares the Matrix M for the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k.

It returns the preconditioner Matrix M and a vector d containing the diagonal elements.

Parameters
Amagma_d_sparse_matrix input matrix A
bmagma_d_vector RHS b
mmagma_d_sparse_matrix* M = D^(-1) * (L+U)
dmagma_d_vector* vector with diagonal elements
magma_int_t magma_djacobisetup_vector ( magma_d_vector  b,
magma_d_vector  d,
magma_d_vector *  c 
)

Prepares the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k.

Returns the vector c

Parameters
bmagma_d_vector RHS b
dmagma_d_vector vector with diagonal entries
cmagma_d_vector* c = D^(-1) * b
magma_int_t magma_dmhom_fd ( magma_d_sparse_matrix  A,
magma_int_t  n,
magma_int_t  b,
magma_index_t *  p 
)

– MAGMA (version 1.5.0-beta3) – Univ.

of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver November 2011

Takes a matrix and a blocksize b to generate a homomorphism that orders the matrix entries according to the subdomains of size b x b. Returns p on the device

example:

/ a 0 0 b 0 \
| 0 c 0 d 0 |

A= | 0 e f g 0 | b = 2 | h 0 0 0 0 | \ i j 0 0 0 /

will generate the projection:

0 2 1 3 4 7 8 9 10 11

according to

a c b d e h f g i j

Parameters
Amagma_d_sparse_matrix input/output matrix
bmagma_int_t blocksize
pmagma_index_t* homomorphism vector containing the indices
magma_int_t magma_dmreorder ( magma_d_sparse_matrix  A,
magma_int_t  n,
magma_int_t  b,
magma_d_sparse_matrix *  B 
)

– MAGMA (version 1.5.0-beta3) – Univ.

of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver November 2011

Takes a matrix and a reordering scheme such that the output mat

example:

/ a 0 0 b 0 \
| 0 c 0 d 0 |

A= | 0 e f g 0 | b = 2 | h 0 0 0 0 | \ i j 0 0 0 /

will generate the projection:

0 2 1 3 4 7 8 9 10 11

according to

a c b d e h f g i j

Parameters
Amagma_d_sparse_matrix input/output matrix
nmagma_int_t nodes in one dimension
bmagma_int_t blocksize
Bmagma_d_sparse_matrix* new matrix filled with new indices