![]() |
MAGMA
1.6.1
Matrix Algebra for GPU and Multicore Architectures
|
Functions | |
magma_int_t | magma_sjacobisetup_matrix (magma_s_sparse_matrix A, magma_s_sparse_matrix *M, magma_s_vector *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_sjacobisetup_diagscal (magma_s_sparse_matrix A, magma_s_vector *d, magma_queue_t queue) |
It returns a vector d containing the inverse diagonal elements. More... | |
magma_int_t | magma_sjacobisetup_vector (magma_s_vector b, magma_s_vector d, magma_s_vector *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_sjacobisetup (magma_s_sparse_matrix A, magma_s_vector b, magma_s_sparse_matrix *M, magma_s_vector *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_sjacobiiter (magma_s_sparse_matrix M, magma_s_vector c, magma_s_vector *x, magma_s_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_sjacobiiter_precond (magma_s_sparse_matrix M, magma_s_vector *x, magma_s_solver_par *solver_par, magma_s_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_s_spmv (float alpha, magma_s_sparse_matrix A, magma_s_vector x, float beta, magma_s_vector y, magma_queue_t queue) |
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... | |
void | magma_scompactActive (magma_int_t m, magma_int_t n, magmaFloat_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_sgeelltmv (magma_trans_t transA, magma_int_t m, magma_int_t n, magma_int_t nnz_per_row, float alpha, magmaFloat_ptr dval, magmaIndex_ptr dcolind, magmaFloat_ptr dx, float beta, magmaFloat_ptr dy, magma_queue_t queue) |
This routine computes y = alpha * A^t * x + beta * y on the GPU. More... | |
magma_int_t | magma_sjacobi_diagscal (int num_rows, magma_s_vector d, magma_s_vector b, magma_s_vector *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_sgemvmdot (int n, int k, magmaFloat_ptr v, magmaFloat_ptr r, magmaFloat_ptr d1, magmaFloat_ptr d2, magmaFloat_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_s_spmv | ( | float | alpha, |
magma_s_sparse_matrix | A, | ||
magma_s_vector | x, | ||
float | beta, | ||
magma_s_vector | y, | ||
magma_queue_t | queue | ||
) |
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.
[in] | alpha | float scalar alpha |
[in] | A | magma_s_sparse_matrix sparse matrix A |
[in] | x | magma_s_vector input vector x |
[in] | beta | float scalar beta |
[out] | y | magma_s_vector output vector y |
[in] | queue | magma_queue_t Queue to execute in. |
void magma_scompactActive | ( | magma_int_t | m, |
magma_int_t | n, | ||
magmaFloat_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] | 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] | 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_sgeelltmv | ( | magma_trans_t | transA, |
magma_int_t | m, | ||
magma_int_t | n, | ||
magma_int_t | nnz_per_row, | ||
float | alpha, | ||
magmaFloat_ptr | dval, | ||
magmaIndex_ptr | dcolind, | ||
magmaFloat_ptr | dx, | ||
float | beta, | ||
magmaFloat_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 | float scalar multiplier |
[in] | dval | magmaFloat_ptr array containing values of A in ELL |
[in] | dcolind | magmaIndex_ptr columnindices of A in ELL |
[in] | dx | magmaFloat_ptr input vector x |
[in] | beta | float scalar multiplier |
[out] | dy | magmaFloat_ptr input/output vector y |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_sgemvmdot | ( | int | n, |
int | k, | ||
magmaFloat_ptr | v, | ||
magmaFloat_ptr | r, | ||
magmaFloat_ptr | d1, | ||
magmaFloat_ptr | d2, | ||
magmaFloat_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 | magmaFloat_ptr v = (v_0 .. v_i.. v_k) |
[in] | r | magmaFloat_ptr r |
[in] | d1 | magmaFloat_ptr workspace |
[in] | d2 | magmaFloat_ptr workspace |
[out] | skp | magmaFloat_ptr vector[k] of scalar products (<v_i,r>...) |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_sjacobi_diagscal | ( | int | num_rows, |
magma_s_vector | d, | ||
magma_s_vector | b, | ||
magma_s_vector * | 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_s_vector RHS b |
[in] | d | magma_s_vector vector with diagonal entries |
[out] | c | magma_s_vector* c = D^(-1) * b |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_sjacobiiter | ( | magma_s_sparse_matrix | M, |
magma_s_vector | c, | ||
magma_s_vector * | x, | ||
magma_s_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.
[in] | M | magma_s_sparse_matrix input matrix M = D^(-1) * (L+U) |
[in] | c | magma_s_vector c = D^(-1) * b |
[in,out] | x | magma_s_vector* iteration vector x |
[in,out] | solver_par | magma_s_solver_par* solver parameters |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_sjacobiiter_precond | ( | magma_s_sparse_matrix | M, |
magma_s_vector * | x, | ||
magma_s_solver_par * | solver_par, | ||
magma_s_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_s_sparse_matrix input matrix M = D^(-1) * (L+U) |
[in] | c | magma_s_vector c = D^(-1) * b |
[in,out] | x | magma_s_vector* iteration vector x |
[in,out] | solver_par | magma_s_solver_par* solver parameters |
[in] | solver_par | magma_s_precond_par* precond parameters |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_sjacobisetup | ( | magma_s_sparse_matrix | A, |
magma_s_vector | b, | ||
magma_s_sparse_matrix * | M, | ||
magma_s_vector * | 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_s_sparse_matrix input matrix A |
[in] | b | magma_s_vector RHS b |
[in] | M | magma_s_sparse_matrix* M = D^(-1) * (L+U) |
[in] | c | magma_s_vector* c = D^(-1) * b |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_sjacobisetup_diagscal | ( | magma_s_sparse_matrix | A, |
magma_s_vector * | d, | ||
magma_queue_t | queue | ||
) |
It returns a vector d containing the inverse diagonal elements.
[in] | A | magma_s_sparse_matrix input matrix A |
[in,out] | d | magma_s_vector* vector with diagonal elements |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_sjacobisetup_matrix | ( | magma_s_sparse_matrix | A, |
magma_s_sparse_matrix * | M, | ||
magma_s_vector * | 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_s_sparse_matrix input matrix A |
[in] | M | magma_s_sparse_matrix* M = D^(-1) * (L+U) |
[in,out] | d | magma_s_vector* vector with diagonal elements of A |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_sjacobisetup_vector | ( | magma_s_vector | b, |
magma_s_vector | d, | ||
magma_s_vector * | 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_s_vector RHS b |
[in] | d | magma_s_vector vector with diagonal entries |
[in] | c | magma_s_vector* c = D^(-1) * b |
[in] | queue | magma_queue_t Queue to execute in. |