MAGMA  1.5.0
Matrix Algebra for GPU and Multicore Architectures
 All Functions Groups
double-complex precision

Functions

magma_int_t magma_z_precond (magma_z_sparse_matrix A, magma_z_vector b, magma_z_vector *x, magma_z_preconditioner precond)
 For a given input matrix A and vectors x, y and the preconditioner parameters, the respective preconditioner is chosen. More...
 
magma_int_t magma_z_precondsetup (magma_z_sparse_matrix A, magma_z_vector b, magma_z_preconditioner *precond)
 For a given input matrix A and vectors x, y and the preconditioner parameters, the respective preconditioner is preprocessed. More...
 
magma_int_t magma_z_applyprecond (magma_z_sparse_matrix A, magma_z_vector b, magma_z_vector *x, magma_z_preconditioner *precond)
 For a given input matrix A and vectors x, y and the preconditioner parameters, the respective preconditioner is applied. More...
 
magma_int_t magma_z_applyprecond_left (magma_z_sparse_matrix A, magma_z_vector b, magma_z_vector *x, magma_z_preconditioner *precond)
 For a given input matrix A and vectors x, y and the preconditioner parameters, the respective left preconditioner is applied. More...
 
magma_int_t magma_z_applyprecond_right (magma_z_sparse_matrix A, magma_z_vector b, magma_z_vector *x, magma_z_preconditioner *precond)
 For a given input matrix A and vectors x, y and the preconditioner parameters, the respective right-preconditioner is applied. More...
 
magma_int_t magma_zorthomgs (magma_int_t num_rows, magma_int_t num_vecs, magmaDoubleComplex *X)
 This routine orthogonalizes a set of vectors stored in a n x m - matrix X in column major: More...
 
magma_int_t magma_zresidual (magma_z_sparse_matrix A, magma_z_vector b, magma_z_vector x, double *res)
 Computes the residual ||b-Ax|| for a solution approximation x. More...
 
magma_int_t magma_znonlinres (magma_z_sparse_matrix A, magma_z_sparse_matrix L, magma_z_sparse_matrix U, magma_z_sparse_matrix *LU, real_Double_t *res)
 Computes the nonlinear residual A- LU and returns the difference as well es the Frobenius norm of the difference. More...
 
magma_int_t magma_zilures (magma_z_sparse_matrix A, magma_z_sparse_matrix L, magma_z_sparse_matrix U, magma_z_sparse_matrix *LU, real_Double_t *res)
 Computes the ILU residual A- LU and returns the difference as well es the Frobenius norm of the difference. More...
 
magma_int_t magma_z_vfree (magma_z_vector *x)
 Free the memory of a magma_z_vector. More...
 
magma_int_t magma_z_mfree (magma_z_sparse_matrix *A)
 Free the memory of a magma_z_sparse_matrix. More...
 
magma_int_t magma_z_vinit (magma_z_vector *x, magma_location_t mem_loc, magma_int_t num_rows, magmaDoubleComplex values)
 Initialize a magma_z_vector. More...
 
magma_int_t magma_zrowentries (magma_z_sparse_matrix *A)
 Checks the maximal number of nonzeros in a row of matrix A. More...
 
magma_int_t magma_zdiameter (magma_z_sparse_matrix *A)
 Computes the diameter of a sparse matrix and stores the value in diameter. More...
 
magma_int_t magma_z_csr_compressor (magmaDoubleComplex **val, magma_index_t **row, magma_index_t **col, magmaDoubleComplex **valn, magma_index_t **rown, magma_index_t **coln, magma_int_t *n)
 Helper function to compress CSR containing zero-entries. More...
 
magma_int_t magma_z_mconvert (magma_z_sparse_matrix A, magma_z_sparse_matrix *B, magma_storage_t old_format, magma_storage_t new_format)
 Converter between different sparse storage formats. More...
 
magma_int_t magma_z_LUmergein (magma_z_sparse_matrix L, magma_z_sparse_matrix U, magma_z_sparse_matrix *B)
 Merges an ILU factorization into one matrix. More...
 
magma_int_t magma_z_mpksetup_one (magma_z_sparse_matrix A, magma_z_sparse_matrix *B, magma_int_t offset, magma_int_t blocksize, magma_int_t s)
 Provides for a matrix A, a blocksize, an offset, and a number of matrix powers s, the local matrix B to needed by this processor for the matrix power kernel. More...
 
magma_int_t magma_z_mpksetup (magma_z_sparse_matrix A, magma_z_sparse_matrix B[MagmaMaxGPUs], magma_int_t num_procs, magma_int_t *offset, magma_int_t *blocksize, magma_int_t s)
 Provides for a matrix A, a number of processors num_procs, and a distribution *offset, *blocksize and s a set of matrices B each containing the matrix rows to compute the matrix power kernel. More...
 
magma_int_t magma_z_mpkinfo (magma_z_sparse_matrix A, magma_int_t num_procs, magma_int_t *offset, magma_int_t *blocksize, magma_int_t s, magma_index_t **num_addrows, magma_index_t **add_rows, magma_int_t *num_addvecs, magma_index_t **add_vecs, magma_int_t *num_vecs_back, magma_index_t **vecs_back)
 Provides for a matrix A, a number of processors num_procs, and a distribution *offset, *blocksize and s the number of rows added to the different matrices. More...
 
magma_int_t magma_z_mpk_compress (magma_int_t num_addrows, magma_index_t *add_rows, magmaDoubleComplex *x, magmaDoubleComplex *y)
 Packs for a given vector x and a key add_rows a compressed version where the add_rows are in consecutive order. More...
 
magma_int_t magma_z_mpk_uncompress (magma_int_t num_add_rows, magma_index_t *add_rows, magmaDoubleComplex *x, magmaDoubleComplex *y)
 Unpacks for a given vector x and a key add_rows the compressed version. More...
 
magma_int_t magma_z_mpk_uncompress_sel (magma_int_t num_addvecs, magma_index_t *add_vecs, magma_int_t offset, magma_int_t blocksize, magmaDoubleComplex *x, magmaDoubleComplex *y)
 Unpacks for a given vector x and a key add_rows the compressed version. More...
 
magma_int_t magma_z_mpk_mcompresso (magma_z_sparse_matrix A, magma_z_sparse_matrix *B, magma_int_t offset, magma_int_t blocksize, magma_int_t num_add_rows, magma_index_t *add_rows)
 Packs the local matrix for higher SpMV performance. More...
 
magma_int_t magma_z_mtransfer (magma_z_sparse_matrix A, magma_z_sparse_matrix *B, magma_location_t src, magma_location_t dst)
 Copies a matrix from memory location src to memory location dst. More...
 
magma_int_t magma_z_vtransfer (magma_z_vector x, magma_z_vector *y, magma_location_t src, magma_location_t dst)
 Copies a vector from memory location src to memory location dst. More...
 
magma_int_t magma_z_vvisu (magma_z_vector x, magma_int_t offset, magma_int_t visulen)
 Visualizes part of a vector of type magma_z_vector. More...
 
magma_int_t magma_z_vread (magma_z_vector *x, magma_int_t length, char *filename)
 Reads in a double vector of length "length". More...
 
magma_int_t magma_zmgenerator (magma_int_t n, magma_int_t offdiags, magma_index_t *diag_offset, magmaDoubleComplex *diag_vals, magma_z_sparse_matrix *A)
 Generate a symmetric n x n CSR matrix for a stencil. More...
 
magma_int_t magma_zilustruct (magma_z_sparse_matrix *A, magma_int_t levels)
 This routine computes the fill-in structure of an ILU(levels) factorization based on the successive multiplication of upper and lower triangular factors using the CUSPARSE library. More...
 
magma_int_t magma_zmhom (magma_z_sparse_matrix A, magma_int_t b, magma_index_t *p)
 – MAGMA (version 1.5.0-beta3) – Univ. More...
 
magma_int_t magma_zmscale (magma_z_sparse_matrix *A, magma_scale_t scaling)
 – MAGMA (version 1.5.0-beta3) – Univ. More...
 
magma_int_t magma_zmdiagadd (magma_z_sparse_matrix *A, magmaDoubleComplex add)
 – MAGMA (version 1.5.0-beta3) – Univ. More...
 
magma_int_t magma_zmsort (magma_z_sparse_matrix *A)
 Sorts columns and rows for a matrix in COO or CSRCOO format. More...
 
magma_int_t magma_z_initP2P (magma_int_t *bw_bmark, magma_int_t *num_gpus)
 Initializes P2P communication between GPUs. More...
 
magma_int_t magma_zsolverinfo (magma_z_solver_par *solver_par, magma_z_preconditioner *precond_par)
 – MAGMA (version 1.5.0-beta3) – Univ. More...
 
magma_int_t magma_zsolverinfo_free (magma_z_solver_par *solver_par, magma_z_preconditioner *precond_par)
 – MAGMA (version 1.5.0-beta3) – Univ. More...
 
magma_int_t magma_zsolverinfo_init (magma_z_solver_par *solver_par, magma_z_preconditioner *precond_par)
 – MAGMA (version 1.5.0-beta3) – Univ. More...
 
magma_int_t z_transpose_csr (magma_int_t n_rows, magma_int_t n_cols, magma_int_t nnz, magmaDoubleComplex *val, magma_index_t *row, magma_index_t *col, magma_int_t *new_n_rows, magma_int_t *new_n_cols, magma_int_t *new_nnz, magmaDoubleComplex **new_val, magma_index_t **new_row, magma_index_t **new_col)
 Transposes a matrix stored in CSR format. More...
 
magma_int_t magma_z_csrtranspose (magma_z_sparse_matrix A, magma_z_sparse_matrix *B)
 Helper function to transpose CSR matrix. More...
 
magma_int_t magma_z_cucsrtranspose (magma_z_sparse_matrix A, magma_z_sparse_matrix *B)
 Helper function to transpose CSR matrix. More...
 
magma_int_t read_z_csr_from_binary (magma_int_t *n_row, magma_int_t *n_col, magma_int_t *nnz, magmaDoubleComplex **val, magma_index_t **row, magma_index_t **col, const char *filename)
 Reads in a matrix stored in coo format from a binary and converts it into CSR format. More...
 
magma_int_t read_z_csr_from_mtx (magma_storage_t *type, magma_location_t *location, magma_int_t *n_row, magma_int_t *n_col, magma_int_t *nnz, magmaDoubleComplex **val, magma_index_t **row, magma_index_t **col, const char *filename)
 Reads in a matrix stored in coo format from a Matrix Market (.mtx) file and converts it into CSR format. More...
 
magma_int_t write_z_csr_mtx (magma_int_t n_row, magma_int_t n_col, magma_int_t nnz, magmaDoubleComplex **val, magma_index_t **row, magma_index_t **col, magma_order_t MajorType, const char *filename)
 Writes a CSR matrix to a file using Matrix Market format. More...
 
magma_int_t print_z_csr_mtx (magma_int_t n_row, magma_int_t n_col, magma_int_t nnz, magmaDoubleComplex **val, magma_index_t **row, magma_index_t **col, magma_order_t MajorType)
 Prints a CSR matrix in Matrix Market format. More...
 
magma_int_t print_z_csr (magma_int_t n_row, magma_int_t n_col, magma_int_t nnz, magmaDoubleComplex **val, magma_index_t **row, magma_index_t **col)
 Prints a CSR matrix in CSR format. More...
 
magma_int_t magma_z_mvisu (magma_z_sparse_matrix A)
 Prints a sparse matrix in CSR format. More...
 
magma_int_t magma_z_csr_mtx (magma_z_sparse_matrix *A, const char *filename)
 Reads in a matrix stored in coo format from a Matrix Market (.mtx) file and converts it into CSR format. More...
 
magma_int_t magma_z_csr_mtxsymm (magma_z_sparse_matrix *A, const char *filename)
 – MAGMA (version 1.5.0-beta3) – Univ. More...
 
void magmablas_dlag2s_sparse (magma_int_t M, magma_int_t N, const double *A, magma_int_t lda, float *SA, magma_int_t ldsa, magma_int_t *info)
 DLAG2S converts a DOUBLE PRECISION matrix A to a SINGLE PRECISION matrix SA. More...
 
magma_int_t magma_vector_dlag2s (magma_d_vector x, magma_s_vector *y)
 convertes magma_d_vector from Z to C More...
 
magma_int_t magma_z_spmv_shift (magmaDoubleComplex alpha, magma_z_sparse_matrix A, magmaDoubleComplex lambda, magma_z_vector x, magmaDoubleComplex beta, magma_int_t offset, magma_int_t blocksize, magma_index_t *add_rows, magma_z_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 - lambda I ) * x + beta * y. More...
 
int magma_z_mpk_compress_gpu (magma_int_t num_add_rows, magma_index_t *add_rows, magmaDoubleComplex *x, magmaDoubleComplex *y)
 Packs a vector x using a key add_rows into the compressed version. More...
 
magma_int_t magma_zbitflip (magmaDoubleComplex *d, magma_int_t loc, magma_int_t bit)
 – MAGMA (version 1.5.0-beta3) – Univ. More...
 
magma_int_t magma_vector_zlag2c (magma_z_vector x, magma_c_vector *y)
 convertes magma_z_vector from Z to C More...
 
void magmablas_zlag2c_sparse (magma_int_t M, magma_int_t N, const magmaDoubleComplex *A, magma_int_t lda, magmaFloatComplex *SA, magma_int_t ldsa, magma_int_t *info)
 ZLAG2C converts a COMPLEX_16 matrix A to a COMPLEX matrix SA. More...
 
magma_int_t magma_zlobpcg_res (magma_int_t num_rows, magma_int_t num_vecs, double *evalues, magmaDoubleComplex *X, magmaDoubleComplex *R, double *res)
 This routine computes for Block-LOBPCG, the set of residuals. More...
 
magma_int_t magma_zlobpcg_shift (magma_int_t num_rows, magma_int_t num_vecs, magma_int_t shift, magmaDoubleComplex *x)
 For a Block-LOBPCG, the set of residuals (entries consecutive in memory) shrinks and the vectors are shifted in case shift residuals drop below threshold. More...
 
magma_int_t magma_zcopyscale (int n, int k, magmaDoubleComplex *r, magmaDoubleComplex *v, magmaDoubleComplex *skp)
 Computes the correction term of the pipelined GMRES according to P. More...
 

Detailed Description

Function Documentation

magma_int_t magma_vector_dlag2s ( magma_d_vector  x,
magma_s_vector *  y 
)

convertes magma_d_vector from Z to C

Parameters
xmagma_d_vector input vector descriptor
ymagma_s_vector* output vector descriptor
magma_int_t magma_vector_zlag2c ( magma_z_vector  x,
magma_c_vector *  y 
)

convertes magma_z_vector from Z to C

Parameters
xmagma_z_vector input vector descriptor
ymagma_c_vector* output vector descriptor
magma_int_t magma_z_applyprecond ( magma_z_sparse_matrix  A,
magma_z_vector  b,
magma_z_vector *  x,
magma_z_preconditioner *  precond 
)

For a given input matrix A and vectors x, y and the preconditioner parameters, the respective preconditioner is applied.

E.g. for Jacobi: the scaling-vetor, for ILU the triangular solves.

Parameters
Amagma_z_sparse_matrix sparse matrix A
xmagma_z_vector input vector x
ymagma_z_vector input vector y
precondmagma_z_preconditioner preconditioner
magma_int_t magma_z_applyprecond_left ( magma_z_sparse_matrix  A,
magma_z_vector  b,
magma_z_vector *  x,
magma_z_preconditioner *  precond 
)

For a given input matrix A and vectors x, y and the preconditioner parameters, the respective left preconditioner is applied.

E.g. for Jacobi: the scaling-vetor, for ILU the left triangular solve.

Parameters
Amagma_z_sparse_matrix sparse matrix A
xmagma_z_vector input vector x
ymagma_z_vector input vector y
precondmagma_z_preconditioner preconditioner
magma_int_t magma_z_applyprecond_right ( magma_z_sparse_matrix  A,
magma_z_vector  b,
magma_z_vector *  x,
magma_z_preconditioner *  precond 
)

For a given input matrix A and vectors x, y and the preconditioner parameters, the respective right-preconditioner is applied.

E.g. for Jacobi: the scaling-vetor, for ILU the right triangular solve.

Parameters
Amagma_z_sparse_matrix sparse matrix A
xmagma_z_vector input vector x
ymagma_z_vector input vector y
precondmagma_z_preconditioner preconditioner
magma_int_t magma_z_csr_compressor ( magmaDoubleComplex **  val,
magma_index_t **  row,
magma_index_t **  col,
magmaDoubleComplex **  valn,
magma_index_t **  rown,
magma_index_t **  coln,
magma_int_t *  n 
)

Helper function to compress CSR containing zero-entries.

Parameters
valmagmaDoubleComplex** input val pointer to compress
rowmagma_int_t** input row pointer to modify
colmagma_int_t** input col pointer to compress
valnmagmaDoubleComplex** output val pointer
rownmagma_int_t** output row pointer
colnmagma_int_t** output col pointer
nmagma_int_t* number of rows in matrix
magma_int_t magma_z_csr_mtx ( magma_z_sparse_matrix *  A,
const char *  filename 
)

Reads in a matrix stored in coo format from a Matrix Market (.mtx) file and converts it into CSR format.

It duplicates the off-diagonal entries in the symmetric case.

Parameters
Amagma_z_sparse_matrix* matrix in magma sparse matrix format
filenameconst char* filname of the mtx matrix
magma_int_t magma_z_csr_mtxsymm ( magma_z_sparse_matrix *  A,
const char *  filename 
)

– MAGMA (version 1.5.0-beta3) – Univ.

of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver November 2011

Reads in a SYMMETRIC matrix stored in coo format from a Matrix Market (.mtx) file and converts it into CSR format. It does not duplicate the off-diagonal entries!

Parameters
Amagma_z_sparse_matrix* matrix in magma sparse matrix format
filenameconst char* filname of the mtx matrix
magma_int_t magma_z_csrtranspose ( magma_z_sparse_matrix  A,
magma_z_sparse_matrix *  B 
)

Helper function to transpose CSR matrix.

Parameters
Amagma_z_sparse_matrix input matrix (CSR)
Bmagma_z_sparse_matrix* output matrix (CSR)
magma_int_t magma_z_cucsrtranspose ( magma_z_sparse_matrix  A,
magma_z_sparse_matrix *  B 
)

Helper function to transpose CSR matrix.

Using the CUSPARSE CSR2CSC function.

Parameters
Amagma_z_sparse_matrix input matrix (CSR)
Bmagma_z_sparse_matrix* output matrix (CSR)
magma_int_t magma_z_initP2P ( magma_int_t *  bw_bmark,
magma_int_t *  num_gpus 
)

Initializes P2P communication between GPUs.

Parameters
bw_bmarkmagma_int_t* input: run the benchmark (1/0)
num_gpusmagma_int_t* output: number of GPUs
magma_int_t magma_z_LUmergein ( magma_z_sparse_matrix  L,
magma_z_sparse_matrix  U,
magma_z_sparse_matrix *  B 
)

Merges an ILU factorization into one matrix.

works only for the symmetric case!!!

Parameters
Lmagma_z_sparse_matrix sparse matrix L
Umagma_z_sparse_matrix sparse matrix U
Bmagma_z_sparse_matrix* output sparse matrix B
magma_int_t magma_z_mconvert ( magma_z_sparse_matrix  A,
magma_z_sparse_matrix *  B,
magma_storage_t  old_format,
magma_storage_t  new_format 
)

Converter between different sparse storage formats.

Parameters
Amagma_z_sparse_matrix sparse matrix A
Bmagma_z_sparse_matrix* copy of A in new format
old_formatmagma_storage_t original storage format
new_formatmagma_storage_t new storage format
magma_int_t magma_z_mfree ( magma_z_sparse_matrix *  A)

Free the memory of a magma_z_sparse_matrix.

Parameters
Amagma_z_sparse_matrix* matrix to free
magma_int_t magma_z_mpk_compress ( magma_int_t  num_addrows,
magma_index_t *  add_rows,
magmaDoubleComplex *  x,
magmaDoubleComplex *  y 
)

Packs for a given vector x and a key add_rows a compressed version where the add_rows are in consecutive order.

Parameters
num_addrowsmagma_int_t number of elements to pack
add_rowsmagma_int_t* indices of elements to pack
xmagmaDoubleComplex* uncompressed input vector
ymagmaDoubleComplex* compressed output vector
int magma_z_mpk_compress_gpu ( magma_int_t  num_add_rows,
magma_index_t *  add_rows,
magmaDoubleComplex *  x,
magmaDoubleComplex *  y 
)

Packs a vector x using a key add_rows into the compressed version.

Parameters
num_add_rowsmagma_int_tnumber of elements to unpack
add_rowsmagma_index_t* indices of elements to unpack
xmagmaDoubleComplex* uncompressed input vector
ymagmaDoubleComplex* compressed output vector
magma_int_t magma_z_mpk_mcompresso ( magma_z_sparse_matrix  A,
magma_z_sparse_matrix *  B,
magma_int_t  offset,
magma_int_t  blocksize,
magma_int_t  num_add_rows,
magma_index_t *  add_rows 
)

Packs the local matrix for higher SpMV performance.

Parameters
num_addrowsmagma_int_t number of elements to pack
add_rowsmagma_int_t* indices of elements to pack
xmagmaDoubleComplex* uncompressed input vector
ymagmaDoubleComplex* compressed output vector
magma_int_t magma_z_mpk_uncompress ( magma_int_t  num_add_rows,
magma_index_t *  add_rows,
magmaDoubleComplex *  x,
magmaDoubleComplex *  y 
)

Unpacks for a given vector x and a key add_rows the compressed version.

Parameters
num_add_rowsmagma_int_tnumber of elements to pack
add_rowsmagma_int_t* indices of elements to pack
xmagmaDoubleComplex* compressed input vector
ymagmaDoubleComplex* uncompressed output vector
magma_int_t magma_z_mpk_uncompress_sel ( magma_int_t  num_addvecs,
magma_index_t *  add_vecs,
magma_int_t  offset,
magma_int_t  blocksize,
magmaDoubleComplex *  x,
magmaDoubleComplex *  y 
)

Unpacks for a given vector x and a key add_rows the compressed version.

The selective version uncompresses only vectors within the area [ offset , offset+blocksize ]

Parameters
num_addvecsmagma_int_t number of elements to pack
add_vecsmagma_int_t* indices of elements to pack
offsetmagma_int_t lower bound of vector chunk
blocksizemagma_int_t number of locally computed elements
xmagmaDoubleComplex* compressed input vector
ymagmaDoubleComplex* uncompressed output vector
magma_int_t magma_z_mpkinfo ( magma_z_sparse_matrix  A,
magma_int_t  num_procs,
magma_int_t *  offset,
magma_int_t *  blocksize,
magma_int_t  s,
magma_index_t **  num_addrows,
magma_index_t **  add_rows,
magma_int_t *  num_addvecs,
magma_index_t **  add_vecs,
magma_int_t *  num_vecs_back,
magma_index_t **  vecs_back 
)

Provides for a matrix A, a number of processors num_procs, and a distribution *offset, *blocksize and s the number of rows added to the different matrices.

magma_sparse_matrix A input matrix A

Parameters
num_procsmagma_int_t number of processors
offsetmagma_int_t* array containing the offsets
blocksizemagma_int_t* array containing the chunk sizes
smagma_int_t matrix powers
num_addrowsmagma_int_t* output array: number of additional rows
num_addvecsmagma_int_t* number of additional vector entries
add_vecsmagma_int_t* array for additional vector entries
magma_int_t magma_z_mpksetup ( magma_z_sparse_matrix  A,
magma_z_sparse_matrix  B[MagmaMaxGPUs],
magma_int_t  num_procs,
magma_int_t *  offset,
magma_int_t *  blocksize,
magma_int_t  s 
)

Provides for a matrix A, a number of processors num_procs, and a distribution *offset, *blocksize and s a set of matrices B each containing the matrix rows to compute the matrix power kernel.

magma_sparse_matrix A input matrix A magma_sparse_matrix B[MagmaMaxGPUs] set of output matrices B

Parameters
num_procsmagma_int_t number of processors
offsetmagma_int_t* array containing the offsets
blocksizemagma_int_t* array containing the chunk sizes
smagma_int_t matrix powers
magma_int_t magma_z_mpksetup_one ( magma_z_sparse_matrix  A,
magma_z_sparse_matrix *  B,
magma_int_t  offset,
magma_int_t  blocksize,
magma_int_t  s 
)

Provides for a matrix A, a blocksize, an offset, and a number of matrix powers s, the local matrix B to needed by this processor for the matrix power kernel.

magma_sparse_matrix A input matrix A magma_sparse_matrix *B output matrix B

Parameters
offsetmagma_int_t first row to compute
blocksizemagma_int_t number of rows to compute
smagma_int_t matrix powers
magma_int_t magma_z_mtransfer ( magma_z_sparse_matrix  A,
magma_z_sparse_matrix *  B,
magma_location_t  src,
magma_location_t  dst 
)

Copies a matrix from memory location src to memory location dst.

Parameters
Amagma_z_sparse_matrix sparse matrix A
Bmagma_z_sparse_matrix* copy of A
srcmagma_location_t original location A
dstmagma_location_t location of the copy of A
magma_int_t magma_z_mvisu ( magma_z_sparse_matrix  A)

Prints a sparse matrix in CSR format.

Parameters
Amagma_z_sparse_matrix sparse matrix in Magma_CSR format
magma_int_t magma_z_precond ( magma_z_sparse_matrix  A,
magma_z_vector  b,
magma_z_vector *  x,
magma_z_preconditioner  precond 
)

For a given input matrix A and vectors x, y and the preconditioner parameters, the respective preconditioner is chosen.

It approximates x for A x = y.

Parameters
Amagma_z_sparse_matrix sparse matrix A
xmagma_z_vector input vector x
ymagma_z_vector input vector y
precondmagma_z_preconditioner preconditioner
magma_int_t magma_z_precondsetup ( magma_z_sparse_matrix  A,
magma_z_vector  b,
magma_z_preconditioner *  precond 
)

For a given input matrix A and vectors x, y and the preconditioner parameters, the respective preconditioner is preprocessed.

E.g. for Jacobi: the scaling-vetor, for ILU the factorization.

Parameters
Amagma_z_sparse_matrix sparse matrix A
xmagma_z_vector input vector x
ymagma_z_vector input vector y
precondmagma_z_preconditioner preconditioner
magma_int_t magma_z_spmv_shift ( magmaDoubleComplex  alpha,
magma_z_sparse_matrix  A,
magmaDoubleComplex  lambda,
magma_z_vector  x,
magmaDoubleComplex  beta,
magma_int_t  offset,
magma_int_t  blocksize,
magma_index_t *  add_rows,
magma_z_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 - lambda I ) * x + beta * y.

Parameters
alphamagmaDoubleComplex scalar alpha
Amagma_z_sparse_matrix sparse matrix A
lambdamagmaDoubleComplex scalar lambda
xmagma_z_vector input vector x
betamagmaDoubleComplex scalar beta
offsetmagma_int_t in case not the main diagonal is scaled
blocksizemagma_int_t in case of processing multiple vectors
add_rowsmagma_int_t* in case the matrixpowerskernel is used
ymagma_z_vector output vector y
magma_int_t magma_z_vfree ( magma_z_vector *  x)

Free the memory of a magma_z_vector.

Parameters
xmagma_z_vector* vector to free
magma_int_t magma_z_vinit ( magma_z_vector *  x,
magma_location_t  mem_loc,
magma_int_t  num_rows,
magmaDoubleComplex  values 
)

Initialize a magma_z_vector.

Parameters
xmagma_z_vector vector to initialize
mem_locmagma_location_t memory for vector
num_rowsmagma_int_t desired length of vector
valuesmagmaDoubleComplex entries in vector
magma_int_t magma_z_vread ( magma_z_vector *  x,
magma_int_t  length,
char *  filename 
)

Reads in a double vector of length "length".

Parameters
xmagma_z_vector vector to read in
lengthmagma_int_t length of vector
filenamechar* file where vector is stored
magma_int_t magma_z_vtransfer ( magma_z_vector  x,
magma_z_vector *  y,
magma_location_t  src,
magma_location_t  dst 
)

Copies a vector from memory location src to memory location dst.

Parameters
xmagma_z_vector vector x
ymagma_z_vector* copy of x
srcmagma_location_t original location x
dstmagma_location_t location of the copy of x
magma_int_t magma_z_vvisu ( magma_z_vector  x,
magma_int_t  offset,
magma_int_t  visulen 
)

Visualizes part of a vector of type magma_z_vector.

With input vector x , offset, visulen, the entries offset - (offset + visulen) of x are visualized.

Parameters
xmagma_z_vector vector to visualize
offsetmagma_int_t start inex of visualization
visulenmagma_int_t number of entries to visualize
magma_int_t magma_zbitflip ( magmaDoubleComplex *  d,
magma_int_t  loc,
magma_int_t  bit 
)

– MAGMA (version 1.5.0-beta3) – Univ.

of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver November 2011

This tool flips the bit 'bit' of the magmaDoubleComplex value d[ loc ].

magma_int_t magma_zcopyscale ( int  n,
int  k,
magmaDoubleComplex *  r,
magmaDoubleComplex *  v,
magmaDoubleComplex *  skp 
)

Computes the correction term of the pipelined GMRES according to P.

Ghysels and scales and copies the new search direction

Returns the vector v = r/ ( skp[k] - (sum_i=1^k skp[i]^2) ) .

Parameters
nint length of v_i
kint

skp entries v_i^T * r ( without r )

Parameters
rmagmaDoubleComplex* vector of length n
vmagmaDoubleComplex* vector of length n
skpmagmaDoubleComplex* array of parameters
magma_int_t magma_zdiameter ( magma_z_sparse_matrix *  A)

Computes the diameter of a sparse matrix and stores the value in diameter.

Parameters
Amagma_z_sparse_matrix* sparse matrix
magma_int_t magma_zilures ( magma_z_sparse_matrix  A,
magma_z_sparse_matrix  L,
magma_z_sparse_matrix  U,
magma_z_sparse_matrix *  LU,
real_Double_t *  res 
)

Computes the ILU residual A- LU and returns the difference as well es the Frobenius norm of the difference.

Parameters
Amagma_z_sparse_matrix input sparse matrix in CSR
Lmagma_z_sparse_matrix input sparse matrix in CSR
Umagma_z_sparse_matrix input sparse matrix in CSR
LUmagma_z_sparse_matrix* output sparse matrix in A-LU in CSR
resreal_Double_t* residual
magma_int_t magma_zilustruct ( magma_z_sparse_matrix *  A,
magma_int_t  levels 
)

This routine computes the fill-in structure of an ILU(levels) factorization based on the successive multiplication of upper and lower triangular factors using the CUSPARSE library.

Parameters
Amagma_z_sparse_matrix* matrix in magma sparse matrix format
levelsmagma_int_t fill in level
magma_int_t magma_zlobpcg_res ( magma_int_t  num_rows,
magma_int_t  num_vecs,
double *  evalues,
magmaDoubleComplex *  X,
magmaDoubleComplex *  R,
double *  res 
)

This routine computes for Block-LOBPCG, the set of residuals.

R = Ax - x evalues It replaces: for(int i=0; i < n; i++){ magma_zaxpy(m, MAGMA_Z_MAKE(-evalues[i],0),blockX+i*m,1,blockR+i*m,1); } The memory layout of x is:

/ 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
num_rowsmagma_int_t number of rows
num_vecsmagma_int_t number of vectors
evaluesdouble* array of eigenvalues/approximations
XmagmaDoubleComplex* block of eigenvector approximations
RmagmaDoubleComplex* block of residuals
resdouble* array of residuals
magma_int_t magma_zlobpcg_shift ( magma_int_t  num_rows,
magma_int_t  num_vecs,
magma_int_t  shift,
magmaDoubleComplex *  x 
)

For a Block-LOBPCG, the set of residuals (entries consecutive in memory) shrinks and the vectors are shifted in case shift residuals drop below threshold.

The memory layout of x is:

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

Parameters
num_rowsmagma_int_t number of rows
num_vecsmagma_int_t number of vectors
shiftmagma_int_t shift number
xmagmaDoubleComplex* input/output vector x
magma_int_t magma_zmdiagadd ( magma_z_sparse_matrix *  A,
magmaDoubleComplex  add 
)

– MAGMA (version 1.5.0-beta3) – Univ.

of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver November 2011

Adds a multiple of the Identity matrix to a matrix: A = A+add * I

Parameters
Amagma_z_sparse_matrix* input/output matrix
addmagmaDoubleComplex scaling for the identity matrix
magma_int_t magma_zmgenerator ( magma_int_t  n,
magma_int_t  offdiags,
magma_index_t *  diag_offset,
magmaDoubleComplex *  diag_vals,
magma_z_sparse_matrix *  A 
)

Generate a symmetric n x n CSR matrix for a stencil.

Parameters
nmagma_int_t number of rows
offdiagsmagma_int_t number of offdiagonals
diag_offsetmagma_int_t* array containing the offsets
                            (length offsets+1)
diag_valsmagmaDoubleComplex* array containing the values
                            (length offsets+1)
Amagma_z_sparse_matrix* matrix to generate
magma_int_t magma_zmhom ( magma_z_sparse_matrix  A,
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

Parameters
Amagma_z_sparse_matrix input/output matrix
bmagma_int_t blocksize
pmagma_index_t* homomorphism vector containing the indices
magma_int_t magma_zmscale ( magma_z_sparse_matrix *  A,
magma_scale_t  scaling 
)

– MAGMA (version 1.5.0-beta3) – Univ.

of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver November 2011

Scales a matrix.

Parameters
Amagma_z_sparse_matrix* input/output matrix
scalingmagma_scale_t scaling type (unit rownorm / unit diagonal)
magma_int_t magma_zmsort ( magma_z_sparse_matrix *  A)

Sorts columns and rows for a matrix in COO or CSRCOO format.

Parameters
Amagma_z_sparse_matrix* matrix in magma sparse matrix format
magma_int_t magma_znonlinres ( magma_z_sparse_matrix  A,
magma_z_sparse_matrix  L,
magma_z_sparse_matrix  U,
magma_z_sparse_matrix *  LU,
real_Double_t *  res 
)

Computes the nonlinear residual A- LU and returns the difference as well es the Frobenius norm of the difference.

Parameters
Amagma_z_sparse_matrix input sparse matrix in CSR
Lmagma_z_sparse_matrix input sparse matrix in CSR
Umagma_z_sparse_matrix input sparse matrix in CSR
LUmagma_z_sparse_matrix* output sparse matrix in A-LU in CSR
resreal_Double_t* residual
magma_int_t magma_zorthomgs ( magma_int_t  num_rows,
magma_int_t  num_vecs,
magmaDoubleComplex *  X 
)

This routine orthogonalizes a set of vectors stored in a n x m - matrix X in column major:

/ 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[1] x2[2] . | x1[3] x2[3] x3[3] | \ x1[4] x2[4] x3[4] /

This routine performs a modified Gram-Schmidt orthogonalization.

Parameters
num_rowsmagma_int_t number of rows
num_vecsmagma_int_t number of vectors
XmagmaDoubleComplex* input/output vector-block/matrix X
magma_int_t magma_zresidual ( magma_z_sparse_matrix  A,
magma_z_vector  b,
magma_z_vector  x,
double *  res 
)

Computes the residual ||b-Ax|| for a solution approximation x.

Parameters
Amagma_z_sparse_matrix input matrix A
bmagma_z_vector RHS b
xmagma_z_vector solution approximation
resmagmaDoubleComplex* return residual
magma_int_t magma_zrowentries ( magma_z_sparse_matrix *  A)

Checks the maximal number of nonzeros in a row of matrix A.

Inserts the data into max_nnz_row.

Parameters
Amagma_z_sparse_matrix* sparse matrix
magma_int_t magma_zsolverinfo ( magma_z_solver_par *  solver_par,
magma_z_preconditioner *  precond_par 
)

– MAGMA (version 1.5.0-beta3) – Univ.

of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver November 2011

Prints information about a previously called solver.

Parameters
solver_parmagma_z_solver_par* structure containing all solver information
precond_parmagma_z_preconditioner* structure containing all preconditioner information
magma_int_t magma_zsolverinfo_free ( magma_z_solver_par *  solver_par,
magma_z_preconditioner *  precond_par 
)

– MAGMA (version 1.5.0-beta3) – Univ.

of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver November 2011

Frees any memory assocoiated with the verbose mode of solver_par. The other values are set to default.

Parameters
solver_parmagma_z_solver_par* structure containing all solver information
precond_parmagma_z_preconditioner* structure containing all preconditioner information
magma_int_t magma_zsolverinfo_init ( magma_z_solver_par *  solver_par,
magma_z_preconditioner *  precond_par 
)

– MAGMA (version 1.5.0-beta3) – Univ.

of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver November 2011

Initializes all solver and preconditioner parameters.

Parameters
solver_parmagma_z_solver_par* structure containing all solver information
precond_parmagma_z_preconditioner* structure containing all preconditioner information
void magmablas_dlag2s_sparse ( magma_int_t  M,
magma_int_t  N,
const double *  A,
magma_int_t  lda,
float *  SA,
magma_int_t  ldsa,
magma_int_t *  info 
)

DLAG2S converts a DOUBLE PRECISION matrix A to a SINGLE PRECISION matrix SA.

RMAX is the overflow for the SINGLE PRECISION arithmetic. DLAG2S checks that all the entries of A are between -RMAX and RMAX. If not the convertion is aborted and a flag is raised.

Parameters
[in]MINTEGER The number of lines of the matrix A. M >= 0.
[in]NINTEGER The number of columns of the matrix A. N >= 0.
[in]ADOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N coefficient matrix A.
[in]ldaINTEGER The leading dimension of the array A. LDA >= max(1,M).
[out]SASINGLE PRECISION array, dimension (LDSA,N) On exit, if INFO=0, the M-by-N coefficient matrix SA; if INFO>0, the content of SA is unspecified.
[in]ldsaINTEGER The leading dimension of the array SA. LDSA >= max(1,M).
[out]infoINTEGER
  • = 0: successful exit.
  • < 0: if INFO = -i, the i-th argument had an illegal value
  • = 1: an entry of the matrix A is greater than the SINGLE PRECISION overflow threshold, in this case, the content of SA in exit is unspecified.
void magmablas_zlag2c_sparse ( magma_int_t  M,
magma_int_t  N,
const magmaDoubleComplex *  A,
magma_int_t  lda,
magmaFloatComplex *  SA,
magma_int_t  ldsa,
magma_int_t *  info 
)

ZLAG2C converts a COMPLEX_16 matrix A to a COMPLEX matrix SA.

RMAX is the overflow for the COMPLEX arithmetic. ZLAG2C checks that all the entries of A are between -RMAX and RMAX. If not the convertion is aborted and a flag is raised.

Parameters
[in]MINTEGER The number of lines of the matrix A. M >= 0.
[in]NINTEGER The number of columns of the matrix A. N >= 0.
[in]ACOMPLEX_16 array, dimension (LDA,N) On entry, the M-by-N coefficient matrix A.
[in]ldaINTEGER The leading dimension of the array A. LDA >= max(1,M).
[out]SACOMPLEX array, dimension (LDSA,N) On exit, if INFO=0, the M-by-N coefficient matrix SA; if INFO>0, the content of SA is unspecified.
[in]ldsaINTEGER The leading dimension of the array SA. LDSA >= max(1,M).
[out]infoINTEGER
  • = 0: successful exit.
  • < 0: if INFO = -i, the i-th argument had an illegal value
  • = 1: an entry of the matrix A is greater than the COMPLEX overflow threshold, in this case, the content of SA in exit is unspecified.
magma_int_t print_z_csr ( magma_int_t  n_row,
magma_int_t  n_col,
magma_int_t  nnz,
magmaDoubleComplex **  val,
magma_index_t **  row,
magma_index_t **  col 
)

Prints a CSR matrix in CSR format.

Parameters
n_rowmagma_int_t* number of rows in matrix
n_colmagma_int_t* number of columns in matrix
nnzmagma_int_t* number of nonzeros in matrix
valmagmaDoubleComplex** value array of CSR
rowmagma_index_t** row pointer of CSR
colmagma_index_t** column indices of CSR
magma_int_t print_z_csr_mtx ( magma_int_t  n_row,
magma_int_t  n_col,
magma_int_t  nnz,
magmaDoubleComplex **  val,
magma_index_t **  row,
magma_index_t **  col,
magma_order_t  MajorType 
)

Prints a CSR matrix in Matrix Market format.

Parameters
n_rowmagma_int_t* number of rows in matrix
n_colmagma_int_t* number of columns in matrix
nnzmagma_int_t* number of nonzeros in matrix
valmagmaDoubleComplex** value array of CSR
rowmagma_index_t** row pointer of CSR
colmagma_index_t** column indices of CSR
MajorTypemagma_index_t Row or Column sort default: 0 = RowMajor, 1 = ColMajor
magma_int_t read_z_csr_from_binary ( magma_int_t *  n_row,
magma_int_t *  n_col,
magma_int_t *  nnz,
magmaDoubleComplex **  val,
magma_index_t **  row,
magma_index_t **  col,
const char *  filename 
)

Reads in a matrix stored in coo format from a binary and converts it into CSR format.

It duplicates the off-diagonal entries in the symmetric case.

Parameters
n_rowmagma_int_t* number of rows in matrix
n_colmagma_int_t* number of columns in matrix
nnzmagma_int_t* number of nonzeros in matrix
valmagmaDoubleComplex** value array of CSR output
rowmagma_index_t** row pointer of CSR output
colmagma_index_t** column indices of CSR output
filenameconst char* filname of the mtx matrix
magma_int_t read_z_csr_from_mtx ( magma_storage_t *  type,
magma_location_t *  location,
magma_int_t *  n_row,
magma_int_t *  n_col,
magma_int_t *  nnz,
magmaDoubleComplex **  val,
magma_index_t **  row,
magma_index_t **  col,
const char *  filename 
)

Reads in a matrix stored in coo format from a Matrix Market (.mtx) file and converts it into CSR format.

It duplicates the off-diagonal entries in the symmetric case.

Parameters
typemagma_storage_t* storage type of matrix
locationmagma_location_t* location of matrix
n_rowmagma_int_t* number of rows in matrix
n_colmagma_int_t* number of columns in matrix
nnzmagma_int_t* number of nonzeros in matrix
valmagmaDoubleComplex** value array of CSR output
rowmagma_index_t** row pointer of CSR output
colmagma_index_t** column indices of CSR output
filenameconst char* filname of the mtx matrix
magma_int_t write_z_csr_mtx ( magma_int_t  n_row,
magma_int_t  n_col,
magma_int_t  nnz,
magmaDoubleComplex **  val,
magma_index_t **  row,
magma_index_t **  col,
magma_order_t  MajorType,
const char *  filename 
)

Writes a CSR matrix to a file using Matrix Market format.

Parameters
n_rowmagma_int_t* number of rows in matrix
n_colmagma_int_t* number of columns in matrix
nnzmagma_int_t* number of nonzeros in matrix
valmagmaDoubleComplex** value array of CSR
rowmagma_index_t** row pointer of CSR
colmagma_index_t** column indices of CSR
MajorTypemagma_index_t Row or Column sort default: 0 = RowMajor, 1 = ColMajor
filenameconst char* output-filname of the mtx matrix
magma_int_t z_transpose_csr ( magma_int_t  n_rows,
magma_int_t  n_cols,
magma_int_t  nnz,
magmaDoubleComplex *  val,
magma_index_t *  row,
magma_index_t *  col,
magma_int_t *  new_n_rows,
magma_int_t *  new_n_cols,
magma_int_t *  new_nnz,
magmaDoubleComplex **  new_val,
magma_index_t **  new_row,
magma_index_t **  new_col 
)

Transposes a matrix stored in CSR format.

Parameters
n_rowsmagma_int_t number of rows in input matrix
n_colsmagma_int_t number of columns in input matrix
nnzmagma_int_t number of nonzeros in input matrix
valmagmaDoubleComplex* value array of input matrix
rowmagma_index_t* row pointer of input matrix
colmagma_index_t* column indices of input matrix
new_n_rowsmagma_index_t* number of rows in transposed matrix
new_n_colsmagma_index_t* number of columns in transposed matrix
new_nnzmagma_index_t* number of nonzeros in transposed matrix
new_valmagmaDoubleComplex** value array of transposed matrix
new_rowmagma_index_t** row pointer of transposed matrix
new_colmagma_index_t** column indices of transposed matrix