MAGMA  2.3.0
Matrix Algebra for GPU and Multicore Architectures
 All Classes Files Functions Friends Groups Pages
double precision

Functions

magma_int_t magma_dftjacobi (magma_d_matrix A, magma_d_matrix b, magma_d_matrix *x, magma_d_solver_par *solver_par, magma_queue_t queue)
 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_djacobisetup_matrix (magma_d_matrix A, magma_d_matrix *M, magma_d_matrix *d, magma_queue_t queue)
 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_matrix A, magma_d_matrix *d, magma_queue_t queue)
 It returns a vector d containing the inverse diagonal elements. More...
 
magma_int_t magma_djacobisetup_vector (magma_d_matrix b, magma_d_matrix d, magma_d_matrix *c, magma_queue_t queue)
 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_matrix A, magma_d_matrix b, magma_d_matrix *M, magma_d_matrix *c, magma_queue_t queue)
 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_matrix M, magma_d_matrix c, magma_d_matrix *x, magma_d_solver_par *solver_par, magma_queue_t queue)
 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_djacobiiter_precond (magma_d_matrix M, magma_d_matrix *x, magma_d_solver_par *solver_par, magma_d_preconditioner *precond, magma_queue_t queue)
 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_djacobiiter_sys (magma_d_matrix A, magma_d_matrix b, magma_d_matrix d, magma_d_matrix t, magma_d_matrix *x, magma_d_solver_par *solver_par, magma_queue_t queue)
 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_dcompactActive (magma_int_t m, magma_int_t n, magmaDouble_ptr dA, magma_int_t ldda, magmaInt_ptr active, magma_queue_t queue)
 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, magmaDouble_ptr dval, magmaIndex_ptr dcolind, magmaDouble_ptr dx, double beta, magmaDouble_ptr dy, magma_queue_t queue)
 This routine computes y = alpha * A^t * x + beta * y on the GPU. More...
 
magma_int_t magma_dgemvmdot (magma_int_t n, magma_int_t k, magmaDouble_ptr v, magmaDouble_ptr r, magmaDouble_ptr d1, magmaDouble_ptr d2, magmaDouble_ptr skp, magma_queue_t queue)
 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_djacobi_diagscal (magma_int_t num_rows, magma_d_matrix d, magma_d_matrix b, magma_d_matrix *c, magma_queue_t queue)
 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_djacobiupdate (magma_d_matrix t, magma_d_matrix b, magma_d_matrix d, magma_d_matrix *x, magma_queue_t queue)
 Updates the iteration vector x for the Jacobi iteration according to x=x+d. More...
 
magma_int_t magma_djacobispmvupdate (magma_int_t maxiter, magma_d_matrix A, magma_d_matrix t, magma_d_matrix b, magma_d_matrix d, magma_d_matrix *x, magma_queue_t queue)
 Updates the iteration vector x for the Jacobi iteration according to x=x+d. More...
 
magma_int_t magma_djacobispmvupdate_bw (magma_int_t maxiter, magma_d_matrix A, magma_d_matrix t, magma_d_matrix b, magma_d_matrix d, magma_d_matrix *x, magma_queue_t queue)
 Updates the iteration vector x for the Jacobi iteration according to x=x+d. More...
 
magma_int_t magma_djacobispmvupdateselect (magma_int_t maxiter, magma_int_t num_updates, magma_index_t *indices, magma_d_matrix A, magma_d_matrix t, magma_d_matrix b, magma_d_matrix d, magma_d_matrix tmp, magma_d_matrix *x, magma_queue_t queue)
 Updates the iteration vector x for the Jacobi iteration according to x=x+d. More...
 
magma_int_t magma_dftjacobicontractions (magma_d_matrix xkm2, magma_d_matrix xkm1, magma_d_matrix xk, magma_d_matrix *z, magma_d_matrix *c, magma_queue_t queue)
 Computes the contraction coefficients c_i: More...
 
magma_int_t magma_dftjacobiupdatecheck (double delta, magma_d_matrix *xold, magma_d_matrix *xnew, magma_d_matrix *zprev, magma_d_matrix c, magma_int_t *flag_t, magma_int_t *flag_fp, magma_queue_t queue)
 Checks the Jacobi updates accorting to the condition in the ScaLA'15 paper. More...
 
magma_int_t magma_dgemvmdot_shfl (magma_int_t n, magma_int_t k, magmaDouble_ptr v, magmaDouble_ptr r, magmaDouble_ptr d1, magmaDouble_ptr d2, magmaDouble_ptr skp, magma_queue_t queue)
 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...
 

Detailed Description

Function Documentation

magma_int_t magma_dftjacobi ( magma_d_matrix  A,
magma_d_matrix  b,
magma_d_matrix *  x,
magma_d_solver_par *  solver_par,
magma_queue_t  queue 
)

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.

This routine takes the system matrix A and the RHS b as input. This is the fault-tolerant version of Jacobi according to ScalLA'15.

Parameters
[in]Amagma_d_matrix input matrix M = D^(-1) * (L+U)
[in]bmagma_d_matrix input RHS b
[in,out]xmagma_d_matrix* iteration vector x
[in,out]solver_parmagma_d_solver_par* solver parameters
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_djacobisetup_matrix ( magma_d_matrix  A,
magma_d_matrix *  M,
magma_d_matrix *  d,
magma_queue_t  queue 
)

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
[in]Amagma_d_matrix input matrix A
[in]Mmagma_d_matrix* M = D^(-1) * (L+U)
[in,out]dmagma_d_matrix* vector with diagonal elements of A
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_djacobisetup_diagscal ( magma_d_matrix  A,
magma_d_matrix *  d,
magma_queue_t  queue 
)

It returns a vector d containing the inverse diagonal elements.

Parameters
[in]Amagma_d_matrix input matrix A
[in,out]dmagma_d_matrix* vector with diagonal elements
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_djacobisetup_vector ( magma_d_matrix  b,
magma_d_matrix  d,
magma_d_matrix *  c,
magma_queue_t  queue 
)

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
[in]bmagma_d_matrix RHS b
[in]dmagma_d_matrix vector with diagonal entries
[in]cmagma_d_matrix* c = D^(-1) * b
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_djacobisetup ( magma_d_matrix  A,
magma_d_matrix  b,
magma_d_matrix *  M,
magma_d_matrix *  c,
magma_queue_t  queue 
)

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
[in]Amagma_d_matrix input matrix A
[in]bmagma_d_matrix RHS b
[in]Mmagma_d_matrix* M = D^(-1) * (L+U)
[in]cmagma_d_matrix* c = D^(-1) * b
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_djacobiiter ( magma_d_matrix  M,
magma_d_matrix  c,
magma_d_matrix *  x,
magma_d_solver_par *  solver_par,
magma_queue_t  queue 
)

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.

This routine takes the iteration matrix M as input.

Parameters
[in]Mmagma_d_matrix input matrix M = D^(-1) * (L+U)
[in]cmagma_d_matrix c = D^(-1) * b
[in,out]xmagma_d_matrix* iteration vector x
[in,out]solver_parmagma_d_solver_par* solver parameters
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_djacobiiter_precond ( magma_d_matrix  M,
magma_d_matrix *  x,
magma_d_solver_par *  solver_par,
magma_d_preconditioner *  precond,
magma_queue_t  queue 
)

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
[in]Mmagma_d_matrix input matrix M = D^(-1) * (L+U)
[in,out]xmagma_d_matrix* iteration vector x
[in,out]solver_parmagma_d_solver_par* solver parameters
[in]precondmagma_d_precond_par* precond parameters
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_djacobiiter_sys ( magma_d_matrix  A,
magma_d_matrix  b,
magma_d_matrix  d,
magma_d_matrix  t,
magma_d_matrix *  x,
magma_d_solver_par *  solver_par,
magma_queue_t  queue 
)

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.

This routine takes the system matrix A and the RHS b as input.

Parameters
[in]Amagma_d_matrix input matrix M = D^(-1) * (L+U)
[in]bmagma_d_matrix input RHS b
[in]dmagma_d_matrix input matrix diagonal elements diag(A)
[in]tmagma_d_matrix temporary vector
[in,out]xmagma_d_matrix* iteration vector x
[in,out]solver_parmagma_d_solver_par* solver parameters
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_dcompactActive ( magma_int_t  m,
magma_int_t  n,
magmaDouble_ptr  dA,
magma_int_t  ldda,
magmaInt_ptr  active,
magma_queue_t  queue 
)

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
[in]queuemagma_queue_t Queue to execute in.
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,
magmaDouble_ptr  dval,
magmaIndex_ptr  dcolind,
magmaDouble_ptr  dx,
double  beta,
magmaDouble_ptr  dy,
magma_queue_t  queue 
)

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

Input format is ELL.

Parameters
[in]transAmagma_trans_t transposition parameter for A
[in]mmagma_int_t number of rows in A
[in]nmagma_int_t number of columns in A
[in]nnz_per_rowmagma_int_t number of elements in the longest row
[in]alphadouble scalar multiplier
[in]dvalmagmaDouble_ptr array containing values of A in ELL
[in]dcolindmagmaIndex_ptr columnindices of A in ELL
[in]dxmagmaDouble_ptr input vector x
[in]betadouble scalar multiplier
[out]dymagmaDouble_ptr input/output vector y
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_dgemvmdot ( magma_int_t  n,
magma_int_t  k,
magmaDouble_ptr  v,
magmaDouble_ptr  r,
magmaDouble_ptr  d1,
magmaDouble_ptr  d2,
magmaDouble_ptr  skp,
magma_queue_t  queue 
)

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
[in]nint length of v_i and r
[in]kint

vectors v_i

Parameters
[in]vmagmaDouble_ptr v = (v_0 .. v_i.. v_k)
[in]rmagmaDouble_ptr r
[in]d1magmaDouble_ptr workspace
[in]d2magmaDouble_ptr workspace
[out]skpmagmaDouble_ptr vector[k] of scalar products (<v_i,r>...)
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_djacobi_diagscal ( magma_int_t  num_rows,
magma_d_matrix  d,
magma_d_matrix  b,
magma_d_matrix *  c,
magma_queue_t  queue 
)

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
[in]num_rowsmagma_int_t number of rows
[in]bmagma_d_matrix RHS b
[in]dmagma_d_matrix vector with diagonal entries
[out]cmagma_d_matrix* c = D^(-1) * b
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_djacobiupdate ( magma_d_matrix  t,
magma_d_matrix  b,
magma_d_matrix  d,
magma_d_matrix *  x,
magma_queue_t  queue 
)

Updates the iteration vector x for the Jacobi iteration according to x=x+d.

*(b-t) where d is the diagonal of the system matrix A and t=Ax.

Parameters
[in]tmagma_d_matrix t = A*x
[in]bmagma_d_matrix RHS b
[in]dmagma_d_matrix vector with diagonal entries
[out]xmagma_d_matrix* iteration vector
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_djacobispmvupdate ( magma_int_t  maxiter,
magma_d_matrix  A,
magma_d_matrix  t,
magma_d_matrix  b,
magma_d_matrix  d,
magma_d_matrix *  x,
magma_queue_t  queue 
)

Updates the iteration vector x for the Jacobi iteration according to x=x+d.

*(b-Ax)

Parameters
[in]maxitermagma_int_t number of Jacobi iterations
[in]Amagma_d_matrix system matrix
[in]tmagma_d_matrix workspace
[in]bmagma_d_matrix RHS b
[in]dmagma_d_matrix vector with diagonal entries
[out]xmagma_d_matrix* iteration vector
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_djacobispmvupdate_bw ( magma_int_t  maxiter,
magma_d_matrix  A,
magma_d_matrix  t,
magma_d_matrix  b,
magma_d_matrix  d,
magma_d_matrix *  x,
magma_queue_t  queue 
)

Updates the iteration vector x for the Jacobi iteration according to x=x+d.

*(b-Ax) This kernel processes the thread blocks in reversed order.

Parameters
[in]maxitermagma_int_t number of Jacobi iterations
[in]Amagma_d_matrix system matrix
[in]tmagma_d_matrix workspace
[in]bmagma_d_matrix RHS b
[in]dmagma_d_matrix vector with diagonal entries
[out]xmagma_d_matrix* iteration vector
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_djacobispmvupdateselect ( magma_int_t  maxiter,
magma_int_t  num_updates,
magma_index_t *  indices,
magma_d_matrix  A,
magma_d_matrix  t,
magma_d_matrix  b,
magma_d_matrix  d,
magma_d_matrix  tmp,
magma_d_matrix *  x,
magma_queue_t  queue 
)

Updates the iteration vector x for the Jacobi iteration according to x=x+d.

*(b-Ax)

This kernel allows for overlapping domains: the indices-array contains the locations that are updated. Locations may be repeated to simulate overlapping domains.

Parameters
[in]maxitermagma_int_t number of Jacobi iterations
[in]num_updatesmagma_int_t number of updates - length of the indices array
[in]indicesmagma_index_t* indices, which entries of x to update
[in]Amagma_d_matrix system matrix
[in]tmagma_d_matrix workspace
[in]bmagma_d_matrix RHS b
[in]dmagma_d_matrix vector with diagonal entries
[in]tmpmagma_d_matrix workspace
[out]xmagma_d_matrix* iteration vector
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_dftjacobicontractions ( magma_d_matrix  xkm2,
magma_d_matrix  xkm1,
magma_d_matrix  xk,
magma_d_matrix *  z,
magma_d_matrix *  c,
magma_queue_t  queue 
)

Computes the contraction coefficients c_i:

c_i = z_i^{k-1} / z_i^{k}

= | x_i^{k-1} - x_i^{k-2} | / |  x_i^{k} - x_i^{k-1} |
Parameters
[in]xkm2magma_d_matrix vector x^{k-2}
[in]xkm1magma_d_matrix vector x^{k-2}
[in]xkmagma_d_matrix vector x^{k-2}
[out]zmagma_d_matrix* ratio
[out]cmagma_d_matrix* contraction coefficients
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_dftjacobiupdatecheck ( double  delta,
magma_d_matrix *  xold,
magma_d_matrix *  xnew,
magma_d_matrix *  zprev,
magma_d_matrix  c,
magma_int_t *  flag_t,
magma_int_t *  flag_fp,
magma_queue_t  queue 
)

Checks the Jacobi updates accorting to the condition in the ScaLA'15 paper.

Parameters
[in]deltadouble threshold
[in,out]xoldmagma_d_matrix* vector xold
[in,out]xnewmagma_d_matrix* vector xnew
[in,out]zprevmagma_d_matrix* vector z = | x_k-1 - x_k |
[in]cmagma_d_matrix contraction coefficients
[in,out]flag_tmagma_int_t threshold condition
[in,out]flag_fpmagma_int_t false positive condition
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_dgemvmdot_shfl ( magma_int_t  n,
magma_int_t  k,
magmaDouble_ptr  v,
magmaDouble_ptr  r,
magmaDouble_ptr  d1,
magmaDouble_ptr  d2,
magmaDouble_ptr  skp,
magma_queue_t  queue 
)

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
[in]nint length of v_i and r
[in]kint

vectors v_i

Parameters
[in]vmagmaDouble_ptr v = (v_0 .. v_i.. v_k)
[in]rmagmaDouble_ptr r
[in]d1magmaDouble_ptr workspace
[in]d2magmaDouble_ptr workspace
[out]skpmagmaDouble_ptr vector[k] of scalar products (<v_i,r>...)
[in]queuemagma_queue_t Queue to execute in.