![]() |
MAGMA
1.5.0
Matrix Algebra for GPU and Multicore Architectures
|
Functions | |
magma_int_t | magma_cjacobisetup_matrix (magma_c_sparse_matrix A, magma_c_vector b, magma_c_sparse_matrix *M, magma_c_vector *d) |
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_cjacobisetup_diagscal (magma_c_sparse_matrix A, magma_c_vector *d) |
It returns a vector d containing the inverse diagonal elements. More... | |
magma_int_t | magma_cjacobisetup_vector (magma_c_vector b, magma_c_vector d, magma_c_vector *c) |
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_cjacobisetup (magma_c_sparse_matrix A, magma_c_vector b, magma_c_sparse_matrix *M, magma_c_vector *c) |
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_cjacobiiter (magma_c_sparse_matrix M, magma_c_vector c, magma_c_vector *x, magma_c_solver_par *solver_par) |
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_cfrobenius (magma_c_sparse_matrix A, magma_c_sparse_matrix B, real_Double_t *res) |
Computes the Frobenius norm of the difference between the CSR matrices A and B. More... | |
magma_int_t | magma_cinitguess (magma_c_sparse_matrix A, magma_c_sparse_matrix *L, magma_c_sparse_matrix *U) |
Computes an initial guess for the iterative ILU/IC. More... | |
magma_int_t | magma_cmhom_fd (magma_c_sparse_matrix A, magma_int_t n, magma_int_t b, magma_index_t *p) |
– MAGMA (version 1.5.0-beta3) – Univ. More... | |
magma_int_t | magma_cmreorder (magma_c_sparse_matrix A, magma_int_t n, magma_int_t b, magma_c_sparse_matrix *B) |
– MAGMA (version 1.5.0-beta3) – Univ. More... | |
void | magma_ccompactActive (magma_int_t m, magma_int_t n, magmaFloatComplex *dA, magma_int_t ldda, magma_index_t *active) |
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_cgeelltmv (magma_trans_t transA, magma_int_t m, magma_int_t n, magma_int_t nnz_per_row, magmaFloatComplex alpha, magmaFloatComplex *d_val, magma_index_t *d_colind, magmaFloatComplex *d_x, magmaFloatComplex beta, magmaFloatComplex *d_y) |
This routine computes y = alpha * A^t * x + beta * y on the GPU. More... | |
magma_int_t | magma_cjacobi_diagscal (int num_rows, magmaFloatComplex *b, magmaFloatComplex *d, magmaFloatComplex *c) |
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_cgemvmdot (int n, int k, magmaFloatComplex *v, magmaFloatComplex *r, magmaFloatComplex *d1, magmaFloatComplex *d2, magmaFloatComplex *skp) |
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_c_spmv (magmaFloatComplex alpha, magma_c_sparse_matrix A, magma_c_vector x, magmaFloatComplex beta, magma_c_vector y) |
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... | |
magma_int_t magma_c_spmv | ( | magmaFloatComplex | alpha, |
magma_c_sparse_matrix | A, | ||
magma_c_vector | x, | ||
magmaFloatComplex | beta, | ||
magma_c_vector | y | ||
) |
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.
alpha | magmaFloatComplex scalar alpha |
A | magma_c_sparse_matrix sparse matrix A |
x | magma_c_vector input vector x |
beta | magmaFloatComplex scalar beta |
y | magma_c_vector output vector y |
void magma_ccompactActive | ( | magma_int_t | m, |
magma_int_t | n, | ||
magmaFloatComplex * | dA, | ||
magma_int_t | ldda, | ||
magma_index_t * | active | ||
) |
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 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 |
magma_int_t magma_cfrobenius | ( | magma_c_sparse_matrix | A, |
magma_c_sparse_matrix | B, | ||
real_Double_t * | res | ||
) |
Computes the Frobenius norm of the difference between the CSR matrices A and B.
They need to share the same sparsity pattern!
A | magma_c_sparse_matrix sparse matrix in CSR |
B | magma_c_sparse_matrix sparse matrix in CSR |
res | real_Double_t* residual |
magma_int_t magma_cgeelltmv | ( | magma_trans_t | transA, |
magma_int_t | m, | ||
magma_int_t | n, | ||
magma_int_t | nnz_per_row, | ||
magmaFloatComplex | alpha, | ||
magmaFloatComplex * | d_val, | ||
magma_index_t * | d_colind, | ||
magmaFloatComplex * | d_x, | ||
magmaFloatComplex | beta, | ||
magmaFloatComplex * | d_y | ||
) |
This routine computes y = alpha * A^t * x + beta * y on the GPU.
Input format is ELL.
transA | magma_trans_t transposition parameter for A |
m | magma_int_t number of rows in A |
n | magma_int_t number of columns in A |
nnz_per_row | magma_int_t number of elements in the longest row |
alpha | magmaFloatComplex scalar multiplier |
d_val | magmaFloatComplex* array containing values of A in ELL |
d_colind | magma_int_t* columnindices of A in ELL |
d_x | magmaFloatComplex* input vector x |
beta | magmaFloatComplex scalar multiplier |
d_y | magmaFloatComplex* input/output vector y |
magma_int_t magma_cgemvmdot | ( | int | n, |
int | k, | ||
magmaFloatComplex * | v, | ||
magmaFloatComplex * | r, | ||
magmaFloatComplex * | d1, | ||
magmaFloatComplex * | d2, | ||
magmaFloatComplex * | skp | ||
) |
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.
n | int length of v_i and r |
k | int vectors v_i |
v | magmaFloatComplex* v = (v_0 .. v_i.. v_k) |
r | magmaFloatComplex* r |
d1 | magmaFloatComplex* workspace |
d2 | magmaFloatComplex* workspace |
skp | magmaFloatComplex* vector[k] of scalar products (<v_i,r>...) |
magma_int_t magma_cinitguess | ( | magma_c_sparse_matrix | A, |
magma_c_sparse_matrix * | L, | ||
magma_c_sparse_matrix * | U | ||
) |
Computes an initial guess for the iterative ILU/IC.
A | magma_c_sparse_matrix sparse matrix in CSR |
B | magma_c_sparse_matrix* sparse matrix in CSR |
magma_int_t magma_cjacobi_diagscal | ( | int | num_rows, |
magmaFloatComplex * | b, | ||
magmaFloatComplex * | d, | ||
magmaFloatComplex * | c | ||
) |
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
num_rows | magma_int_t number of rows |
b | magma_c_vector RHS b |
d | magma_c_vector vector with diagonal entries |
c | magma_c_vector* c = D^(-1) * b |
magma_int_t magma_cjacobiiter | ( | magma_c_sparse_matrix | M, |
magma_c_vector | c, | ||
magma_c_vector * | x, | ||
magma_c_solver_par * | solver_par | ||
) |
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.
m | magma_c_sparse_matrix input matrix M = D^(-1) * (L+U) |
c | magma_c_vector c = D^(-1) * b |
x | magma_c_vector* iteration vector x |
solver_par | magma_c_solver_par* solver parameters |
magma_int_t magma_cjacobisetup | ( | magma_c_sparse_matrix | A, |
magma_c_vector | b, | ||
magma_c_sparse_matrix * | M, | ||
magma_c_vector * | c | ||
) |
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.
A | magma_c_sparse_matrix input matrix A |
b | magma_c_vector RHS b |
m | magma_c_sparse_matrix* M = D^(-1) * (L+U) |
c | magma_c_vector* c = D^(-1) * b |
magma_int_t magma_cjacobisetup_diagscal | ( | magma_c_sparse_matrix | A, |
magma_c_vector * | d | ||
) |
It returns a vector d containing the inverse diagonal elements.
A | magma_c_sparse_matrix input matrix A |
d | magma_c_vector* vector with diagonal elements |
magma_int_t magma_cjacobisetup_matrix | ( | magma_c_sparse_matrix | A, |
magma_c_vector | b, | ||
magma_c_sparse_matrix * | M, | ||
magma_c_vector * | d | ||
) |
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.
A | magma_c_sparse_matrix input matrix A |
b | magma_c_vector RHS b |
m | magma_c_sparse_matrix* M = D^(-1) * (L+U) |
d | magma_c_vector* vector with diagonal elements |
magma_int_t magma_cjacobisetup_vector | ( | magma_c_vector | b, |
magma_c_vector | d, | ||
magma_c_vector * | c | ||
) |
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
b | magma_c_vector RHS b |
d | magma_c_vector vector with diagonal entries |
c | magma_c_vector* c = D^(-1) * b |
magma_int_t magma_cmhom_fd | ( | magma_c_sparse_matrix | A, |
magma_int_t | n, | ||
magma_int_t | b, | ||
magma_index_t * | p | ||
) |
– MAGMA (version 1.5.0-beta3) – Univ.
of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver November 2011
Takes a matrix and a blocksize b to generate a homomorphism that orders the matrix entries according to the subdomains of size b x b. Returns p on the device
example:
/ a 0 0 b 0 \ | 0 c 0 d 0 |
A= | 0 e f g 0 | b = 2 | h 0 0 0 0 | \ i j 0 0 0 /
will generate the projection:
0 2 1 3 4 7 8 9 10 11
according to
a c b d e h f g i j
A | magma_c_sparse_matrix input/output matrix |
b | magma_int_t blocksize |
p | magma_index_t* homomorphism vector containing the indices |
magma_int_t magma_cmreorder | ( | magma_c_sparse_matrix | A, |
magma_int_t | n, | ||
magma_int_t | b, | ||
magma_c_sparse_matrix * | B | ||
) |
– MAGMA (version 1.5.0-beta3) – Univ.
of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver November 2011
Takes a matrix and a reordering scheme such that the output mat
example:
/ a 0 0 b 0 \ | 0 c 0 d 0 |
A= | 0 e f g 0 | b = 2 | h 0 0 0 0 | \ i j 0 0 0 /
will generate the projection:
0 2 1 3 4 7 8 9 10 11
according to
a c b d e h f g i j
A | magma_c_sparse_matrix input/output matrix |
n | magma_int_t nodes in one dimension |
b | magma_int_t blocksize |
B | magma_c_sparse_matrix* new matrix filled with new indices |