MAGMA
2.7.1
Matrix Algebra for GPU and Multicore Architectures
|
Functions | |
magma_int_t | magma_zftjacobi (magma_z_matrix A, magma_z_matrix b, magma_z_matrix *x, magma_z_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_zjacobisetup_matrix (magma_z_matrix A, magma_z_matrix *M, magma_z_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_zjacobisetup_diagscal (magma_z_matrix A, magma_z_matrix *d, magma_queue_t queue) |
It returns a vector d containing the inverse diagonal elements. More... | |
magma_int_t | magma_zjacobisetup_vector (magma_z_matrix b, magma_z_matrix d, magma_z_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_zjacobisetup (magma_z_matrix A, magma_z_matrix b, magma_z_matrix *M, magma_z_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_zjacobiiter (magma_z_matrix M, magma_z_matrix c, magma_z_matrix *x, magma_z_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_zjacobiiter_precond (magma_z_matrix M, magma_z_matrix *x, magma_z_solver_par *solver_par, magma_z_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_zjacobiiter_sys (magma_z_matrix A, magma_z_matrix b, magma_z_matrix d, magma_z_matrix t, magma_z_matrix *x, magma_z_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_sparse_matrix_zlag2c (magma_z_matrix A, magma_c_sparse_matrix *B, magma_queue_t queue) |
convertes magma_z_matrix from Z to C More... | |
magma_int_t | magma_zcompactActive (magma_int_t m, magma_int_t n, magmaDoubleComplex_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_zgeelltmv (magma_trans_t transA, magma_int_t m, magma_int_t n, magma_int_t nnz_per_row, magmaDoubleComplex alpha, magmaDoubleComplex_ptr dval, magmaIndex_ptr dcolind, magmaDoubleComplex_ptr dx, magmaDoubleComplex beta, magmaDoubleComplex_ptr dy, magma_queue_t queue) |
This routine computes y = alpha * A^t * x + beta * y on the GPU. More... | |
magma_int_t | magma_zgemvmdot (magma_int_t n, magma_int_t k, magmaDoubleComplex_ptr v, magmaDoubleComplex_ptr r, magmaDoubleComplex_ptr d1, magmaDoubleComplex_ptr d2, magmaDoubleComplex_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_zjacobi_diagscal (magma_int_t num_rows, magma_z_matrix d, magma_z_matrix b, magma_z_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_zjacobiupdate (magma_z_matrix t, magma_z_matrix b, magma_z_matrix d, magma_z_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_zjacobispmvupdate (magma_int_t maxiter, magma_z_matrix A, magma_z_matrix t, magma_z_matrix b, magma_z_matrix d, magma_z_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_zjacobispmvupdate_bw (magma_int_t maxiter, magma_z_matrix A, magma_z_matrix t, magma_z_matrix b, magma_z_matrix d, magma_z_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_zjacobispmvupdateselect (magma_int_t maxiter, magma_int_t num_updates, magma_index_t *indices, magma_z_matrix A, magma_z_matrix t, magma_z_matrix b, magma_z_matrix d, magma_z_matrix tmp, magma_z_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_zftjacobicontractions (magma_z_matrix xkm2, magma_z_matrix xkm1, magma_z_matrix xk, magma_z_matrix *z, magma_z_matrix *c, magma_queue_t queue) |
Computes the contraction coefficients c_i: More... | |
magma_int_t | magma_zftjacobiupdatecheck (double delta, magma_z_matrix *xold, magma_z_matrix *xnew, magma_z_matrix *zprev, magma_z_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_zgemvmdot_shfl (magma_int_t n, magma_int_t k, magmaDoubleComplex_ptr v, magmaDoubleComplex_ptr r, magmaDoubleComplex_ptr d1, magmaDoubleComplex_ptr d2, magmaDoubleComplex_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_zftjacobi | ( | magma_z_matrix | A, |
magma_z_matrix | b, | ||
magma_z_matrix * | x, | ||
magma_z_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.
[in] | A | magma_z_matrix input matrix M = D^(-1) * (L+U) |
[in] | b | magma_z_matrix input RHS b |
[in,out] | x | magma_z_matrix* iteration vector x |
[in,out] | solver_par | magma_z_solver_par* solver parameters |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zjacobisetup_matrix | ( | magma_z_matrix | A, |
magma_z_matrix * | M, | ||
magma_z_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.
[in] | A | magma_z_matrix input matrix A |
[in] | M | magma_z_matrix* M = D^(-1) * (L+U) |
[in,out] | d | magma_z_matrix* vector with diagonal elements of A |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zjacobisetup_diagscal | ( | magma_z_matrix | A, |
magma_z_matrix * | d, | ||
magma_queue_t | queue | ||
) |
It returns a vector d containing the inverse diagonal elements.
[in] | A | magma_z_matrix input matrix A |
[in,out] | d | magma_z_matrix* vector with diagonal elements |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zjacobisetup_vector | ( | magma_z_matrix | b, |
magma_z_matrix | d, | ||
magma_z_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
[in] | b | magma_z_matrix RHS b |
[in] | d | magma_z_matrix vector with diagonal entries |
[in] | c | magma_z_matrix* c = D^(-1) * b |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zjacobisetup | ( | magma_z_matrix | A, |
magma_z_matrix | b, | ||
magma_z_matrix * | M, | ||
magma_z_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.
[in] | A | magma_z_matrix input matrix A |
[in] | b | magma_z_matrix RHS b |
[in] | M | magma_z_matrix* M = D^(-1) * (L+U) |
[in] | c | magma_z_matrix* c = D^(-1) * b |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zjacobiiter | ( | magma_z_matrix | M, |
magma_z_matrix | c, | ||
magma_z_matrix * | x, | ||
magma_z_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.
[in] | M | magma_z_matrix input matrix M = D^(-1) * (L+U) |
[in] | c | magma_z_matrix c = D^(-1) * b |
[in,out] | x | magma_z_matrix* iteration vector x |
[in,out] | solver_par | magma_z_solver_par* solver parameters |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zjacobiiter_precond | ( | magma_z_matrix | M, |
magma_z_matrix * | x, | ||
magma_z_solver_par * | solver_par, | ||
magma_z_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.
[in] | M | magma_z_matrix input matrix M = D^(-1) * (L+U) |
[in,out] | x | magma_z_matrix* iteration vector x |
[in,out] | solver_par | magma_z_solver_par* solver parameters |
[in] | precond | magma_z_precond_par* precond parameters |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zjacobiiter_sys | ( | magma_z_matrix | A, |
magma_z_matrix | b, | ||
magma_z_matrix | d, | ||
magma_z_matrix | t, | ||
magma_z_matrix * | x, | ||
magma_z_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.
[in] | A | magma_z_matrix input matrix M = D^(-1) * (L+U) |
[in] | b | magma_z_matrix input RHS b |
[in] | d | magma_z_matrix input matrix diagonal elements diag(A) |
[in] | t | magma_z_matrix temporary vector |
[in,out] | x | magma_z_matrix* iteration vector x |
[in,out] | solver_par | magma_z_solver_par* solver parameters |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_sparse_matrix_zlag2c | ( | magma_z_matrix | A, |
magma_c_sparse_matrix * | B, | ||
magma_queue_t | queue | ||
) |
convertes magma_z_matrix from Z to C
A | magma_z_matrix input matrix descriptor | |
B | magma_c_sparse_matrix* output matrix descriptor | |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zcompactActive | ( | magma_int_t | m, |
magma_int_t | n, | ||
magmaDoubleComplex_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).
[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,out] | dA | COMPLEX DOUBLE PRECISION 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] | active | INTEGER array, dimension N A mask of 1s and 0s showing if a vector remains or has been removed |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zgeelltmv | ( | magma_trans_t | transA, |
magma_int_t | m, | ||
magma_int_t | n, | ||
magma_int_t | nnz_per_row, | ||
magmaDoubleComplex | alpha, | ||
magmaDoubleComplex_ptr | dval, | ||
magmaIndex_ptr | dcolind, | ||
magmaDoubleComplex_ptr | dx, | ||
magmaDoubleComplex | beta, | ||
magmaDoubleComplex_ptr | dy, | ||
magma_queue_t | queue | ||
) |
This routine computes y = alpha * A^t * x + beta * y on the GPU.
Input format is ELL.
[in] | transA | magma_trans_t transposition parameter for A |
[in] | m | magma_int_t number of rows in A |
[in] | n | magma_int_t number of columns in A |
[in] | nnz_per_row | magma_int_t number of elements in the longest row |
[in] | alpha | magmaDoubleComplex scalar multiplier |
[in] | dval | magmaDoubleComplex_ptr array containing values of A in ELL |
[in] | dcolind | magmaIndex_ptr columnindices of A in ELL |
[in] | dx | magmaDoubleComplex_ptr input vector x |
[in] | beta | magmaDoubleComplex scalar multiplier |
[out] | dy | magmaDoubleComplex_ptr input/output vector y |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zgemvmdot | ( | magma_int_t | n, |
magma_int_t | k, | ||
magmaDoubleComplex_ptr | v, | ||
magmaDoubleComplex_ptr | r, | ||
magmaDoubleComplex_ptr | d1, | ||
magmaDoubleComplex_ptr | d2, | ||
magmaDoubleComplex_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.
[in] | n | int length of v_i and r |
[in] | k | int vectors v_i |
[in] | v | magmaDoubleComplex_ptr v = (v_0 .. v_i.. v_k) |
[in] | r | magmaDoubleComplex_ptr r |
[in] | d1 | magmaDoubleComplex_ptr workspace |
[in] | d2 | magmaDoubleComplex_ptr workspace |
[out] | skp | magmaDoubleComplex_ptr vector[k] of scalar products (<v_i,r>...) |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zjacobi_diagscal | ( | magma_int_t | num_rows, |
magma_z_matrix | d, | ||
magma_z_matrix | b, | ||
magma_z_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
[in] | num_rows | magma_int_t number of rows |
[in] | b | magma_z_matrix RHS b |
[in] | d | magma_z_matrix vector with diagonal entries |
[out] | c | magma_z_matrix* c = D^(-1) * b |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zjacobiupdate | ( | magma_z_matrix | t, |
magma_z_matrix | b, | ||
magma_z_matrix | d, | ||
magma_z_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.
[in] | t | magma_z_matrix t = A*x |
[in] | b | magma_z_matrix RHS b |
[in] | d | magma_z_matrix vector with diagonal entries |
[out] | x | magma_z_matrix* iteration vector |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zjacobispmvupdate | ( | magma_int_t | maxiter, |
magma_z_matrix | A, | ||
magma_z_matrix | t, | ||
magma_z_matrix | b, | ||
magma_z_matrix | d, | ||
magma_z_matrix * | x, | ||
magma_queue_t | queue | ||
) |
Updates the iteration vector x for the Jacobi iteration according to x=x+d.
*(b-Ax)
[in] | maxiter | magma_int_t number of Jacobi iterations |
[in] | A | magma_z_matrix system matrix |
[in] | t | magma_z_matrix workspace |
[in] | b | magma_z_matrix RHS b |
[in] | d | magma_z_matrix vector with diagonal entries |
[out] | x | magma_z_matrix* iteration vector |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zjacobispmvupdate_bw | ( | magma_int_t | maxiter, |
magma_z_matrix | A, | ||
magma_z_matrix | t, | ||
magma_z_matrix | b, | ||
magma_z_matrix | d, | ||
magma_z_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.
[in] | maxiter | magma_int_t number of Jacobi iterations |
[in] | A | magma_z_matrix system matrix |
[in] | t | magma_z_matrix workspace |
[in] | b | magma_z_matrix RHS b |
[in] | d | magma_z_matrix vector with diagonal entries |
[out] | x | magma_z_matrix* iteration vector |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zjacobispmvupdateselect | ( | magma_int_t | maxiter, |
magma_int_t | num_updates, | ||
magma_index_t * | indices, | ||
magma_z_matrix | A, | ||
magma_z_matrix | t, | ||
magma_z_matrix | b, | ||
magma_z_matrix | d, | ||
magma_z_matrix | tmp, | ||
magma_z_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.
[in] | maxiter | magma_int_t number of Jacobi iterations |
[in] | num_updates | magma_int_t number of updates - length of the indices array |
[in] | indices | magma_index_t* indices, which entries of x to update |
[in] | A | magma_z_matrix system matrix |
[in] | t | magma_z_matrix workspace |
[in] | b | magma_z_matrix RHS b |
[in] | d | magma_z_matrix vector with diagonal entries |
[in] | tmp | magma_z_matrix workspace |
[out] | x | magma_z_matrix* iteration vector |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zftjacobicontractions | ( | magma_z_matrix | xkm2, |
magma_z_matrix | xkm1, | ||
magma_z_matrix | xk, | ||
magma_z_matrix * | z, | ||
magma_z_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} |
[in] | xkm2 | magma_z_matrix vector x^{k-2} |
[in] | xkm1 | magma_z_matrix vector x^{k-2} |
[in] | xk | magma_z_matrix vector x^{k-2} |
[out] | z | magma_z_matrix* ratio |
[out] | c | magma_z_matrix* contraction coefficients |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zftjacobiupdatecheck | ( | double | delta, |
magma_z_matrix * | xold, | ||
magma_z_matrix * | xnew, | ||
magma_z_matrix * | zprev, | ||
magma_z_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.
[in] | delta | double threshold |
[in,out] | xold | magma_z_matrix* vector xold |
[in,out] | xnew | magma_z_matrix* vector xnew |
[in,out] | zprev | magma_z_matrix* vector z = | x_k-1 - x_k | |
[in] | c | magma_z_matrix contraction coefficients |
[in,out] | flag_t | magma_int_t threshold condition |
[in,out] | flag_fp | magma_int_t false positive condition |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zgemvmdot_shfl | ( | magma_int_t | n, |
magma_int_t | k, | ||
magmaDoubleComplex_ptr | v, | ||
magmaDoubleComplex_ptr | r, | ||
magmaDoubleComplex_ptr | d1, | ||
magmaDoubleComplex_ptr | d2, | ||
magmaDoubleComplex_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.
[in] | n | int length of v_i and r |
[in] | k | int vectors v_i |
[in] | v | magmaDoubleComplex_ptr v = (v_0 .. v_i.. v_k) |
[in] | r | magmaDoubleComplex_ptr r |
[in] | d1 | magmaDoubleComplex_ptr workspace |
[in] | d2 | magmaDoubleComplex_ptr workspace |
[out] | skp | magmaDoubleComplex_ptr vector[k] of scalar products (<v_i,r>...) |
[in] | queue | magma_queue_t Queue to execute in. |