MAGMA  1.6.1
Matrix Algebra for GPU and Multicore Architectures
 All Classes Files Functions Friends Groups Pages

Functions

magma_int_t magma_dbajac_csr (magma_int_t localiters, magma_d_sparse_matrix D, magma_d_sparse_matrix R, magma_d_vector b, magma_d_vector *x, magma_queue_t queue)
 This routine is a block-asynchronous Jacobi iteration performing s local Jacobi-updates within the block. More...
 
void magma_dcompact (magma_int_t m, magma_int_t n, magmaDouble_ptr dA, magma_int_t ldda, magmaDouble_ptr dnorms, double tol, magmaInt_ptr active, magmaInt_ptr cBlock, magma_queue_t queue)
 ZCOMPACT takes a set of n vectors of size m (in dA) and their norms and compacts them into the cBlock size<=n vectors that have norms > tol. More...
 
magma_int_t magma_djacobisetup_vector_gpu (int num_rows, magma_d_vector b, magma_d_vector d, magma_d_vector c, magma_d_vector *x, 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_dlobpcg_maxpy (magma_int_t num_rows, magma_int_t num_vecs, magmaDouble_ptr X, magmaDouble_ptr Y, magma_queue_t queue)
 This routine computes a axpy for a mxn matrix: More...
 
int magma_dbicgmerge1 (int n, magmaDouble_ptr skp, magmaDouble_ptr v, magmaDouble_ptr r, magmaDouble_ptr p)
 Mergels multiple operations into one kernel: More...
 
int magma_dbicgmerge2 (int n, magmaDouble_ptr skp, magmaDouble_ptr r, magmaDouble_ptr v, magmaDouble_ptr s)
 Mergels multiple operations into one kernel: More...
 
int magma_dbicgmerge3 (int n, magmaDouble_ptr skp, magmaDouble_ptr p, magmaDouble_ptr s, magmaDouble_ptr t, magmaDouble_ptr x, magmaDouble_ptr r)
 Mergels multiple operations into one kernel: More...
 
int magma_dbicgmerge4 (int type, magmaDouble_ptr skp)
 Performs some parameter operations for the BiCGSTAB with scalars on GPU. More...
 
magma_int_t magma_dbicgmerge_spmv1 (magma_d_sparse_matrix A, magmaDouble_ptr d1, magmaDouble_ptr d2, magmaDouble_ptr dp, magmaDouble_ptr dr, magmaDouble_ptr dv, magmaDouble_ptr skp, magma_queue_t queue)
 Merges the first SpmV using CSR with the dot product and the computation of alpha. More...
 
magma_int_t magma_dbicgmerge_spmv2 (magma_d_sparse_matrix A, magmaDouble_ptr d1, magmaDouble_ptr d2, magmaDouble_ptr ds, magmaDouble_ptr dt, magmaDouble_ptr skp, magma_queue_t queue)
 Merges the second SpmV using CSR with the dot product and the computation of omega. More...
 
magma_int_t magma_dbicgmerge_xrbeta (int n, magmaDouble_ptr d1, magmaDouble_ptr d2, magmaDouble_ptr rr, magmaDouble_ptr r, magmaDouble_ptr p, magmaDouble_ptr s, magmaDouble_ptr t, magmaDouble_ptr x, magmaDouble_ptr skp, magma_queue_t queue)
 Merges the second SpmV using CSR with the dot product and the computation of omega. More...
 
magma_int_t magma_dcgmerge_spmv1 (magma_d_sparse_matrix A, magmaDouble_ptr d1, magmaDouble_ptr d2, magmaDouble_ptr dd, magmaDouble_ptr dz, magmaDouble_ptr skp, magma_queue_t queue)
 Merges the first SpmV using different formats with the dot product and the computation of rho. More...
 

Detailed Description

Function Documentation

magma_int_t magma_dbajac_csr ( magma_int_t  localiters,
magma_d_sparse_matrix  D,
magma_d_sparse_matrix  R,
magma_d_vector  b,
magma_d_vector *  x,
magma_queue_t  queue 
)

This routine is a block-asynchronous Jacobi iteration performing s local Jacobi-updates within the block.

Input format is two CSR matrices, one containing the diagonal blocks, one containing the rest.

Parameters
[in]localitersmagma_int_t number of local Jacobi-like updates
[in]Dmagma_d_sparse_matrix input matrix with diagonal blocks
[in]Rmagma_d_sparse_matrix input matrix with non-diagonal parts
[in]bmagma_d_vector RHS
[in]xmagma_d_vector* iterate/solution
[in]queuemagma_queue_t Queue to execute in.
int magma_dbicgmerge1 ( int  n,
magmaDouble_ptr  skp,
magmaDouble_ptr  v,
magmaDouble_ptr  r,
magmaDouble_ptr  p 
)

Mergels multiple operations into one kernel:

p = beta*p p = p-omega*beta*v p = p+r

-> p = r + beta * ( p - omega * v )

Parameters
[in]nint dimension n
[in]skpmagmaDouble_ptr set of scalar parameters
[in]vmagmaDouble_ptr input v
[in]rmagmaDouble_ptr input r
in/out]p magmaDouble_ptr input/output p
[in]queuemagma_queue_t Queue to execute in.
int magma_dbicgmerge2 ( int  n,
magmaDouble_ptr  skp,
magmaDouble_ptr  r,
magmaDouble_ptr  v,
magmaDouble_ptr  s 
)

Mergels multiple operations into one kernel:

s=r s=s-alpha*v

-> s = r - alpha * v

Parameters
[in]nint dimension n
[in]skpmagmaDouble_ptr set of scalar parameters
[in]rmagmaDouble_ptr input r
[in]vmagmaDouble_ptr input v
s]s magmaDouble_ptr output s
[in]queuemagma_queue_t Queue to execute in.
int magma_dbicgmerge3 ( int  n,
magmaDouble_ptr  skp,
magmaDouble_ptr  p,
magmaDouble_ptr  s,
magmaDouble_ptr  t,
magmaDouble_ptr  x,
magmaDouble_ptr  r 
)

Mergels multiple operations into one kernel:

x=x+alpha*p x=x+omega*s r=s r=r-omega*t

-> x = x + alpha * p + omega * s -> r = s - omega * t

Parameters
[in]nint dimension n
[in]skpmagmaDouble_ptr set of scalar parameters
[in]pmagmaDouble_ptr input p
[in]smagmaDouble_ptr input s
[in]tmagmaDouble_ptr input t
in/out]x magmaDouble_ptr input/output x
in/out]r magmaDouble_ptr input/output r
[in]queuemagma_queue_t Queue to execute in.
int magma_dbicgmerge4 ( int  type,
magmaDouble_ptr  skp 
)

Performs some parameter operations for the BiCGSTAB with scalars on GPU.

Parameters
[in]typeint kernel type
in/out]skp magmaDouble_ptr vector with parameters
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_dbicgmerge_spmv1 ( magma_d_sparse_matrix  A,
magmaDouble_ptr  d1,
magmaDouble_ptr  d2,
magmaDouble_ptr  dp,
magmaDouble_ptr  dr,
magmaDouble_ptr  dv,
magmaDouble_ptr  skp,
magma_queue_t  queue 
)

Merges the first SpmV using CSR with the dot product and the computation of alpha.

Parameters
[in]Amagma_d_sparse_matrix system matrix
[in]d1magmaDouble_ptr temporary vector
[in]d2magmaDouble_ptr temporary vector
[in]dpmagmaDouble_ptr input vector p
[in]drmagmaDouble_ptr input vector r
[in]dvmagmaDouble_ptr output vector v
in/out]skp magmaDouble_ptr array for parameters ( skp[0]=alpha )
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_dbicgmerge_spmv2 ( magma_d_sparse_matrix  A,
magmaDouble_ptr  d1,
magmaDouble_ptr  d2,
magmaDouble_ptr  ds,
magmaDouble_ptr  dt,
magmaDouble_ptr  skp,
magma_queue_t  queue 
)

Merges the second SpmV using CSR with the dot product and the computation of omega.

Parameters
[in]Amagma_d_sparse_matrix input matrix
[in]d1magmaDouble_ptr temporary vector
[in]d2magmaDouble_ptr temporary vector
[in]dsmagmaDouble_ptr input vector s
[in]dtmagmaDouble_ptr output vector t
in/out]skp magmaDouble_ptr array for parameters
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_dbicgmerge_xrbeta ( int  n,
magmaDouble_ptr  d1,
magmaDouble_ptr  d2,
magmaDouble_ptr  rr,
magmaDouble_ptr  r,
magmaDouble_ptr  p,
magmaDouble_ptr  s,
magmaDouble_ptr  t,
magmaDouble_ptr  x,
magmaDouble_ptr  skp,
magma_queue_t  queue 
)

Merges the second SpmV using CSR with the dot product and the computation of omega.

Parameters
[in]nint dimension n
[in]d1magmaDouble_ptr temporary vector
[in]d2magmaDouble_ptr temporary vector
[in]rrmagmaDouble_ptr input vector rr
[in]rmagmaDouble_ptr input/output vector r
[in]pmagmaDouble_ptr input vector p
[in]smagmaDouble_ptr input vector s
[in]tmagmaDouble_ptr input vector t
[out]xmagmaDouble_ptr output vector x
[in]skpmagmaDouble_ptr array for parameters
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_dcgmerge_spmv1 ( magma_d_sparse_matrix  A,
magmaDouble_ptr  d1,
magmaDouble_ptr  d2,
magmaDouble_ptr  dd,
magmaDouble_ptr  dz,
magmaDouble_ptr  skp,
magma_queue_t  queue 
)

Merges the first SpmV using different formats with the dot product and the computation of rho.

Parameters
[in]Amagma_d_sparse_matrix input matrix
[in]d1magmaDouble_ptr temporary vector
[in]d2magmaDouble_ptr temporary vector
[in]ddmagmaDouble_ptr input vector d
[out]dzmagmaDouble_ptr input vector z
[out]skpmagmaDouble_ptr array for parameters ( skp[3]=rho )
[in]queuemagma_queue_t Queue to execute in.
void magma_dcompact ( magma_int_t  m,
magma_int_t  n,
magmaDouble_ptr  dA,
magma_int_t  ldda,
magmaDouble_ptr  dnorms,
double  tol,
magmaInt_ptr  active,
magmaInt_ptr  cBlock,
magma_queue_t  queue 
)

ZCOMPACT takes a set of n vectors of size m (in dA) and their norms and compacts them into the cBlock size<=n vectors that have norms > tol.

The active mask array has 1 or 0, showing if a vector remained or not in the compacted resulting set of vectors.

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]in,out]dA COMPLEX 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]dnormsDOUBLE PRECISION array, dimension N The norms of the N vectors in dA
[in]tolDOUBLE PRECISON The tolerance value used in the criteria to compact or not.
[in]out]active INTEGER array, dimension N A mask of 1s and 0s showing if a vector remains or has been removed
[in]out]cBlock magmaInt_ptr The number of vectors that remain in dA (i.e., with norms > tol).
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_djacobisetup_vector_gpu ( int  num_rows,
magma_d_vector  b,
magma_d_vector  d,
magma_d_vector  c,
magma_d_vector *  x,
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_vector RHS b
[in]dmagma_d_vector vector with diagonal entries
[out]cmagma_d_vector* c = D^(-1) * b
[out]xmagma_d_vector* iteration vector
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_dlobpcg_maxpy ( magma_int_t  num_rows,
magma_int_t  num_vecs,
magmaDouble_ptr  X,
magmaDouble_ptr  Y,
magma_queue_t  queue 
)

This routine computes a axpy for a mxn matrix:

Y = X + Y

It replaces: magma_daxpy(m*n, c_one, Y, 1, X, 1);

/ x1[0] x2[0] x3[0] \
| x1[1] x2[1] x3[1] |

X = | x1[2] x2[2] x3[2] | = x1[0] x1[1] x1[2] x1[3] x1[4] x2[0] x2[1] . | x1[3] x2[3] x3[3] | \ x1[4] x2[4] x3[4] /

Parameters
[in]num_rowsmagma_int_t number of rows
[in]num_vecsmagma_int_t number of vectors
[in]XmagmaDouble_ptr input vector X
in/out]Y magmaDouble_ptr input/output vector Y
[in]queuemagma_queue_t Queue to execute in.