![]() |
MAGMA
1.6.1
Matrix Algebra for GPU and Multicore Architectures
|
Functions | |
magma_int_t | magma_sbajac_csr (magma_int_t localiters, magma_s_sparse_matrix D, magma_s_sparse_matrix R, magma_s_vector b, magma_s_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_scompact (magma_int_t m, magma_int_t n, magmaFloat_ptr dA, magma_int_t ldda, magmaFloat_ptr dnorms, float 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_sjacobisetup_vector_gpu (int num_rows, magma_s_vector b, magma_s_vector d, magma_s_vector c, magma_s_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_slobpcg_maxpy (magma_int_t num_rows, magma_int_t num_vecs, magmaFloat_ptr X, magmaFloat_ptr Y, magma_queue_t queue) |
This routine computes a axpy for a mxn matrix: More... | |
int | magma_sbicgmerge1 (int n, magmaFloat_ptr skp, magmaFloat_ptr v, magmaFloat_ptr r, magmaFloat_ptr p) |
Mergels multiple operations into one kernel: More... | |
int | magma_sbicgmerge2 (int n, magmaFloat_ptr skp, magmaFloat_ptr r, magmaFloat_ptr v, magmaFloat_ptr s) |
Mergels multiple operations into one kernel: More... | |
int | magma_sbicgmerge3 (int n, magmaFloat_ptr skp, magmaFloat_ptr p, magmaFloat_ptr s, magmaFloat_ptr t, magmaFloat_ptr x, magmaFloat_ptr r) |
Mergels multiple operations into one kernel: More... | |
int | magma_sbicgmerge4 (int type, magmaFloat_ptr skp) |
Performs some parameter operations for the BiCGSTAB with scalars on GPU. More... | |
magma_int_t | magma_sbicgmerge_spmv1 (magma_s_sparse_matrix A, magmaFloat_ptr d1, magmaFloat_ptr d2, magmaFloat_ptr dp, magmaFloat_ptr dr, magmaFloat_ptr dv, magmaFloat_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_sbicgmerge_spmv2 (magma_s_sparse_matrix A, magmaFloat_ptr d1, magmaFloat_ptr d2, magmaFloat_ptr ds, magmaFloat_ptr dt, magmaFloat_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_sbicgmerge_xrbeta (int n, magmaFloat_ptr d1, magmaFloat_ptr d2, magmaFloat_ptr rr, magmaFloat_ptr r, magmaFloat_ptr p, magmaFloat_ptr s, magmaFloat_ptr t, magmaFloat_ptr x, magmaFloat_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_scgmerge_spmv1 (magma_s_sparse_matrix A, magmaFloat_ptr d1, magmaFloat_ptr d2, magmaFloat_ptr dd, magmaFloat_ptr dz, magmaFloat_ptr skp, magma_queue_t queue) |
Merges the first SpmV using different formats with the dot product and the computation of rho. More... | |
magma_int_t magma_sbajac_csr | ( | magma_int_t | localiters, |
magma_s_sparse_matrix | D, | ||
magma_s_sparse_matrix | R, | ||
magma_s_vector | b, | ||
magma_s_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.
[in] | localiters | magma_int_t number of local Jacobi-like updates |
[in] | D | magma_s_sparse_matrix input matrix with diagonal blocks |
[in] | R | magma_s_sparse_matrix input matrix with non-diagonal parts |
[in] | b | magma_s_vector RHS |
[in] | x | magma_s_vector* iterate/solution |
[in] | queue | magma_queue_t Queue to execute in. |
int magma_sbicgmerge1 | ( | int | n, |
magmaFloat_ptr | skp, | ||
magmaFloat_ptr | v, | ||
magmaFloat_ptr | r, | ||
magmaFloat_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 )
[in] | n | int dimension n |
[in] | skp | magmaFloat_ptr set of scalar parameters |
[in] | v | magmaFloat_ptr input v |
[in] | r | magmaFloat_ptr input r |
in/out] | p magmaFloat_ptr input/output p | |
[in] | queue | magma_queue_t Queue to execute in. |
int magma_sbicgmerge2 | ( | int | n, |
magmaFloat_ptr | skp, | ||
magmaFloat_ptr | r, | ||
magmaFloat_ptr | v, | ||
magmaFloat_ptr | s | ||
) |
Mergels multiple operations into one kernel:
s=r s=s-alpha*v
-> s = r - alpha * v
[in] | n | int dimension n |
[in] | skp | magmaFloat_ptr set of scalar parameters |
[in] | r | magmaFloat_ptr input r |
[in] | v | magmaFloat_ptr input v |
s] | s magmaFloat_ptr output s | |
[in] | queue | magma_queue_t Queue to execute in. |
int magma_sbicgmerge3 | ( | int | n, |
magmaFloat_ptr | skp, | ||
magmaFloat_ptr | p, | ||
magmaFloat_ptr | s, | ||
magmaFloat_ptr | t, | ||
magmaFloat_ptr | x, | ||
magmaFloat_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
[in] | n | int dimension n |
[in] | skp | magmaFloat_ptr set of scalar parameters |
[in] | p | magmaFloat_ptr input p |
[in] | s | magmaFloat_ptr input s |
[in] | t | magmaFloat_ptr input t |
in/out] | x magmaFloat_ptr input/output x | |
in/out] | r magmaFloat_ptr input/output r | |
[in] | queue | magma_queue_t Queue to execute in. |
int magma_sbicgmerge4 | ( | int | type, |
magmaFloat_ptr | skp | ||
) |
Performs some parameter operations for the BiCGSTAB with scalars on GPU.
[in] | type | int kernel type |
in/out] | skp magmaFloat_ptr vector with parameters | |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_sbicgmerge_spmv1 | ( | magma_s_sparse_matrix | A, |
magmaFloat_ptr | d1, | ||
magmaFloat_ptr | d2, | ||
magmaFloat_ptr | dp, | ||
magmaFloat_ptr | dr, | ||
magmaFloat_ptr | dv, | ||
magmaFloat_ptr | skp, | ||
magma_queue_t | queue | ||
) |
Merges the first SpmV using CSR with the dot product and the computation of alpha.
[in] | A | magma_s_sparse_matrix system matrix |
[in] | d1 | magmaFloat_ptr temporary vector |
[in] | d2 | magmaFloat_ptr temporary vector |
[in] | dp | magmaFloat_ptr input vector p |
[in] | dr | magmaFloat_ptr input vector r |
[in] | dv | magmaFloat_ptr output vector v |
in/out] | skp magmaFloat_ptr array for parameters ( skp[0]=alpha ) | |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_sbicgmerge_spmv2 | ( | magma_s_sparse_matrix | A, |
magmaFloat_ptr | d1, | ||
magmaFloat_ptr | d2, | ||
magmaFloat_ptr | ds, | ||
magmaFloat_ptr | dt, | ||
magmaFloat_ptr | skp, | ||
magma_queue_t | queue | ||
) |
Merges the second SpmV using CSR with the dot product and the computation of omega.
[in] | A | magma_s_sparse_matrix input matrix |
[in] | d1 | magmaFloat_ptr temporary vector |
[in] | d2 | magmaFloat_ptr temporary vector |
[in] | ds | magmaFloat_ptr input vector s |
[in] | dt | magmaFloat_ptr output vector t |
in/out] | skp magmaFloat_ptr array for parameters | |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_sbicgmerge_xrbeta | ( | int | n, |
magmaFloat_ptr | d1, | ||
magmaFloat_ptr | d2, | ||
magmaFloat_ptr | rr, | ||
magmaFloat_ptr | r, | ||
magmaFloat_ptr | p, | ||
magmaFloat_ptr | s, | ||
magmaFloat_ptr | t, | ||
magmaFloat_ptr | x, | ||
magmaFloat_ptr | skp, | ||
magma_queue_t | queue | ||
) |
Merges the second SpmV using CSR with the dot product and the computation of omega.
[in] | n | int dimension n |
[in] | d1 | magmaFloat_ptr temporary vector |
[in] | d2 | magmaFloat_ptr temporary vector |
[in] | rr | magmaFloat_ptr input vector rr |
[in] | r | magmaFloat_ptr input/output vector r |
[in] | p | magmaFloat_ptr input vector p |
[in] | s | magmaFloat_ptr input vector s |
[in] | t | magmaFloat_ptr input vector t |
[out] | x | magmaFloat_ptr output vector x |
[in] | skp | magmaFloat_ptr array for parameters |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_scgmerge_spmv1 | ( | magma_s_sparse_matrix | A, |
magmaFloat_ptr | d1, | ||
magmaFloat_ptr | d2, | ||
magmaFloat_ptr | dd, | ||
magmaFloat_ptr | dz, | ||
magmaFloat_ptr | skp, | ||
magma_queue_t | queue | ||
) |
Merges the first SpmV using different formats with the dot product and the computation of rho.
[in] | A | magma_s_sparse_matrix input matrix |
[in] | d1 | magmaFloat_ptr temporary vector |
[in] | d2 | magmaFloat_ptr temporary vector |
[in] | dd | magmaFloat_ptr input vector d |
[out] | dz | magmaFloat_ptr input vector z |
[out] | skp | magmaFloat_ptr array for parameters ( skp[3]=rho ) |
[in] | queue | magma_queue_t Queue to execute in. |
void magma_scompact | ( | magma_int_t | m, |
magma_int_t | n, | ||
magmaFloat_ptr | dA, | ||
magma_int_t | ldda, | ||
magmaFloat_ptr | dnorms, | ||
float | 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.
[in] | m | INTEGER The number of rows of the matrix dA. M >= 0. |
[in] | n | INTEGER The number of columns of the matrix dA. N >= 0. |
[in] | in,out] | dA COMPLEX REAL array, dimension (LDDA,N) The m by n matrix dA. |
[in] | ldda | INTEGER The leading dimension of the array dA. LDDA >= max(1,M). |
[in] | dnorms | REAL array, dimension N The norms of the N vectors in dA |
[in] | tol | DOUBLE 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] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_sjacobisetup_vector_gpu | ( | int | num_rows, |
magma_s_vector | b, | ||
magma_s_vector | d, | ||
magma_s_vector | c, | ||
magma_s_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
[in] | num_rows | magma_int_t number of rows |
[in] | b | magma_s_vector RHS b |
[in] | d | magma_s_vector vector with diagonal entries |
[out] | c | magma_s_vector* c = D^(-1) * b |
[out] | x | magma_s_vector* iteration vector |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_slobpcg_maxpy | ( | magma_int_t | num_rows, |
magma_int_t | num_vecs, | ||
magmaFloat_ptr | X, | ||
magmaFloat_ptr | Y, | ||
magma_queue_t | queue | ||
) |
This routine computes a axpy for a mxn matrix:
Y = X + Y
It replaces: magma_saxpy(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] /
[in] | num_rows | magma_int_t number of rows |
[in] | num_vecs | magma_int_t number of vectors |
[in] | X | magmaFloat_ptr input vector X |
in/out] | Y magmaFloat_ptr input/output vector Y | |
[in] | queue | magma_queue_t Queue to execute in. |