MAGMA  2.2.0
Matrix Algebra for GPU and Multicore Architectures
double-complex precision

Functions

magma_int_t magma_z_precond (magma_z_matrix A, magma_z_matrix b, magma_z_matrix *x, magma_z_preconditioner *precond, magma_queue_t queue)
 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_matrix A, magma_z_matrix b, magma_z_solver_par *solver, magma_z_preconditioner *precond, magma_queue_t queue)
 For a given input matrix M and vectors x, y and the preconditioner parameters, the respective preconditioner is preprocessed. More...
 
magma_int_t magma_z_applyprecond (magma_z_matrix A, magma_z_matrix b, magma_z_matrix *x, magma_z_preconditioner *precond, magma_queue_t queue)
 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_trans_t trans, magma_z_matrix A, magma_z_matrix b, magma_z_matrix *x, magma_z_preconditioner *precond, magma_queue_t queue)
 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_trans_t trans, magma_z_matrix A, magma_z_matrix b, magma_z_matrix *x, magma_z_preconditioner *precond, magma_queue_t queue)
 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_z_solver (magma_z_matrix A, magma_z_matrix b, magma_z_matrix *x, magma_zopts *zopts, magma_queue_t queue)
 Allows the user to choose a solver. More...
 
magma_int_t magma_zapplycustomprecond_l (magma_z_matrix b, magma_z_matrix *x, magma_z_preconditioner *precond, magma_queue_t queue)
 This is an interface to the left solve for any custom preconditioner. More...
 
magma_int_t magma_zapplycustomprecond_r (magma_z_matrix b, magma_z_matrix *x, magma_z_preconditioner *precond, magma_queue_t queue)
 This is an interface to the right solve for any custom preconditioner. More...
 
magma_int_t magma_zmlumerge (magma_z_matrix L, magma_z_matrix U, magma_z_matrix *A)
 Takes an strictly lower triangular matrix L and an upper triangular matrix U and merges them into a matrix A containing the upper and lower triangular parts. More...
 
magma_int_t magma_zresidual (magma_z_matrix A, magma_z_matrix b, magma_z_matrix x, double *res, magma_queue_t queue)
 Computes the residual ||b-Ax|| for a solution approximation x. More...
 
magma_int_t magma_zresidual_slice (magma_int_t start, magma_int_t end, magma_z_matrix A, magma_z_matrix b, magma_z_matrix x, double *res, magma_queue_t queue)
 Computes the residual r=||b-Ax|| for the slice r(start:end) for a solution approximation x. More...
 
magma_int_t magma_zresidualvec (magma_z_matrix A, magma_z_matrix b, magma_z_matrix x, magma_z_matrix *r, double *res, magma_queue_t queue)
 Computes the residual r = b-Ax for a solution approximation x. More...
 
magma_int_t magma_zcsrsplit (magma_int_t offset, magma_int_t bsize, magma_z_matrix A, magma_z_matrix *D, magma_z_matrix *R, magma_queue_t queue)
 Splits a CSR matrix into two matrices, one containing the diagonal blocks with the diagonal element stored first, one containing the rest of the original matrix. More...
 
magma_int_t magma_zdomainoverlap (magma_index_t num_rows, magma_int_t *num_indices, magma_index_t *rowptr, magma_index_t *colidx, magma_index_t *x, magma_queue_t queue)
 Generates the update list. More...
 
magma_int_t magma_zmfree (magma_z_matrix *A, magma_queue_t queue)
 Free the memory of a magma_z_matrix. More...
 
magma_int_t magma_zmprepare_batched (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_z_matrix L, magma_z_matrix LC, magma_index_t *sizes, magma_index_t *locations, magmaDoubleComplex *trisystems, magmaDoubleComplex *rhs, magma_queue_t queue)
 Takes a sparse matrix and generates an array containing the sizes of the different systems an array containing the indices with the locations in the sparse matrix where the data comes from and goes back to an array containing all the sparse triangular systems. More...
 
magma_int_t magma_zmtrisolve_batched (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_z_matrix L, magma_z_matrix LC, magma_index_t *sizes, magma_index_t *locations, magmaDoubleComplex *trisystems, magmaDoubleComplex *rhs, magma_queue_t queue)
 Does all triangular solves. More...
 
magma_int_t magma_zmbackinsert_batched (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_z_matrix *M, magma_index_t *sizes, magma_index_t *locations, magmaDoubleComplex *trisystems, magmaDoubleComplex *rhs, magma_queue_t queue)
 Inserts the values into the preconditioner matrix. More...
 
magma_int_t magma_zmiluspai_sizecheck (magma_z_matrix A, magma_index_t batchsize, magma_index_t *maxsize, magma_queue_t queue)
 Checks for a matrix whether the batched ISAI works for a given thread-block size. More...
 
magma_int_t magma_zmisai_blockstruct (magma_int_t n, magma_int_t bs, magma_int_t offs, magma_uplo_t uplotype, magma_z_matrix *A, magma_queue_t queue)
 Generates a block-diagonal sparsity pattern with block-size bs. More...
 
magma_int_t magma_zrowentries (magma_z_matrix *A, magma_queue_t queue)
 Checks the maximal number of nonzeros in a row of matrix A. More...
 
magma_int_t magma_zdiameter (magma_z_matrix *A, magma_queue_t queue)
 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, magma_queue_t queue)
 Helper function to compress CSR containing zero-entries. More...
 
magma_int_t magma_zmconvert (magma_z_matrix A, magma_z_matrix *B, magma_storage_t old_format, magma_storage_t new_format, magma_queue_t queue)
 Converter between different sparse storage formats. More...
 
magma_int_t magma_zmcsrcompressor (magma_z_matrix *A, magma_queue_t queue)
 Removes zeros in a CSR matrix. More...
 
magma_int_t magma_zcsrset (magma_int_t m, magma_int_t n, magma_index_t *row, magma_index_t *col, magmaDoubleComplex *val, magma_z_matrix *A, magma_queue_t queue)
 Passes a CSR matrix to MAGMA. More...
 
magma_int_t magma_zcsrget (magma_z_matrix A, magma_int_t *m, magma_int_t *n, magma_index_t **row, magma_index_t **col, magmaDoubleComplex **val, magma_queue_t queue)
 Passes a MAGMA matrix to CSR structure. More...
 
magma_int_t magma_zcsrset_gpu (magma_int_t m, magma_int_t n, magmaIndex_ptr row, magmaIndex_ptr col, magmaDoubleComplex_ptr val, magma_z_matrix *A, magma_queue_t queue)
 Passes a CSR matrix to MAGMA (located on DEV). More...
 
magma_int_t magma_zcsrget_gpu (magma_z_matrix A, magma_int_t *m, magma_int_t *n, magmaIndex_ptr *row, magmaIndex_ptr *col, magmaDoubleComplex_ptr *val, magma_queue_t queue)
 Passes a MAGMA matrix to CSR structure (located on DEV). More...
 
magma_int_t magma_zmdiff (magma_z_matrix A, magma_z_matrix B, real_Double_t *res, magma_queue_t queue)
 Computes the Frobenius norm of the difference between the CSR matrices A and B. More...
 
magma_int_t magma_zmgenerator (magma_int_t n, magma_int_t offdiags, magma_index_t *diag_offset, magmaDoubleComplex *diag_vals, magma_z_matrix *A, magma_queue_t queue)
 Generate a symmetric n x n CSR matrix for a stencil. More...
 
magma_int_t magma_zm_27stencil (magma_int_t n, magma_z_matrix *A, magma_queue_t queue)
 Generate a 27-point stencil for a 3D FD discretization. More...
 
magma_int_t magma_zm_5stencil (magma_int_t n, magma_z_matrix *A, magma_queue_t queue)
 Generate a 5-point stencil for a 2D FD discretization. More...
 
magma_int_t magma_zsymbilu (magma_z_matrix *A, magma_int_t levels, magma_z_matrix *L, magma_z_matrix *U, magma_queue_t queue)
 This routine performs a symbolic ILU factorization. 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, magma_queue_t queue)
 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_zwrite_csr_mtx (magma_z_matrix A, magma_order_t MajorType, const char *filename, magma_queue_t queue)
 Writes a CSR matrix to a file using Matrix Market format. More...
 
magma_int_t magma_zprint_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, magma_queue_t queue)
 Prints a CSR matrix in Matrix Market format. More...
 
magma_int_t magma_zprint_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, magma_queue_t queue)
 Prints a CSR matrix in CSR format. More...
 
magma_int_t magma_zprint_matrix (magma_z_matrix A, magma_queue_t queue)
 Prints a sparse matrix in CSR format. More...
 
magma_int_t magma_z_csr_mtx (magma_z_matrix *A, const char *filename, magma_queue_t queue)
 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_matrix *A, const char *filename, magma_queue_t queue)
 Reads in a SYMMETRIC matrix stored in coo format from a Matrix Market (.mtx) file and converts it into CSR format. More...
 
magma_int_t magma_zmlumerge (magma_z_matrix L, magma_z_matrix U, magma_z_matrix *A, magma_queue_t queue)
 Takes an strictly lower triangular matrix L and an upper triangular matrix U and merges them into a matrix A containing the upper and lower triangular parts. More...
 
magma_int_t magma_zmscale (magma_z_matrix *A, magma_scale_t scaling, magma_queue_t queue)
 Scales a matrix. More...
 
magma_int_t magma_zmdiagadd (magma_z_matrix *A, magmaDoubleComplex add, magma_queue_t queue)
 Adds a multiple of the Identity matrix to a matrix: A = A+add * I. More...
 
magma_int_t magma_zmshrink (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue)
 Shrinks a non-square matrix (m < n) to the smaller dimension. More...
 
magma_int_t magma_zmslice (magma_int_t num_slices, magma_int_t slice, magma_z_matrix A, magma_z_matrix *B, magma_z_matrix *ALOC, magma_z_matrix *ANLOC, magma_index_t *comm_i, magmaDoubleComplex *comm_v, magma_int_t *start, magma_int_t *end, magma_queue_t queue)
 Takes a matrix and extracts a slice for solving the system in parallel: More...
 
magma_int_t magma_zmsupernodal (magma_int_t *max_bs, magma_z_matrix A, magma_z_matrix *S, magma_queue_t queue)
 Generates a block-diagonal sparsity pattern with block-size bs. More...
 
magma_int_t magma_zmvarsizeblockstruct (magma_int_t n, magma_int_t *bs, magma_int_t bsl, magma_uplo_t uplotype, magma_z_matrix *A, magma_queue_t queue)
 Generates a block-diagonal sparsity pattern with variable block-size. More...
 
magma_int_t magma_zmtransfer (magma_z_matrix A, magma_z_matrix *B, magma_location_t src, magma_location_t dst, magma_queue_t queue)
 Copies a matrix from memory location src to memory location dst. More...
 
magma_int_t z_transpose_csr (magma_int_t n_rows, magma_int_t n_cols, magma_int_t nnz, magmaDoubleComplex *values, magma_index_t *rowptr, magma_index_t *colind, magma_int_t *new_n_rows, magma_int_t *new_n_cols, magma_int_t *new_nnz, magmaDoubleComplex **new_values, magma_index_t **new_rowptr, magma_index_t **new_colind, magma_queue_t queue)
 Transposes a matrix stored in CSR format on the CPU host. More...
 
magma_int_t magma_zmtranspose (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue)
 Interface to cuSPARSE transpose. More...
 
magma_int_t magma_z_cucsrtranspose (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue)
 Helper function to transpose CSR matrix. More...
 
magma_int_t magma_zmtransposeconjugate (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue)
 This function forms the transpose conjugate of a matrix. More...
 
magma_int_t magma_zfrobenius (magma_z_matrix A, magma_z_matrix B, real_Double_t *res, magma_queue_t queue)
 Computes the Frobenius norm of the difference between the CSR matrices A and B. More...
 
magma_int_t magma_znonlinres (magma_z_matrix A, magma_z_matrix L, magma_z_matrix U, magma_z_matrix *LU, real_Double_t *res, magma_queue_t queue)
 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_matrix A, magma_z_matrix L, magma_z_matrix U, magma_z_matrix *LU, real_Double_t *res, real_Double_t *nonlinres, magma_queue_t queue)
 Computes the ILU residual A - LU and returns the difference as well es the Frobenius norm of the difference. More...
 
magma_int_t magma_zicres (magma_z_matrix A, magma_z_matrix C, magma_z_matrix CT, magma_z_matrix *LU, real_Double_t *res, real_Double_t *nonlinres, magma_queue_t queue)
 Computes the IC residual A - CC^T and returns the difference as well es the Frobenius norm of the difference. More...
 
magma_int_t magma_zinitguess (magma_z_matrix A, magma_z_matrix *L, magma_z_matrix *U, magma_queue_t queue)
 Computes an initial guess for the ParILU/ParIC. More...
 
magma_int_t magma_zinitrecursiveLU (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue)
 Using the iterative approach of computing ILU factorizations with increasing fill-in, it takes the input matrix A, containing the approximate factors, ( L and U as well ) computes a matrix with one higher level of fill-in, inserts the original approximation as initial guess, and provides the factors L and U also filled with the scaled initial guess. More...
 
magma_int_t magma_zmLdiagadd (magma_z_matrix *L, magma_queue_t queue)
 Checks for a lower triangular matrix whether it is strictly lower triangular and in the negative case adds a unit diagonal. More...
 
magma_int_t magma_zsolverinfo (magma_z_solver_par *solver_par, magma_z_preconditioner *precond_par, magma_queue_t queue)
 Prints information about a previously called solver. More...
 
magma_int_t magma_zsolverinfo_free (magma_z_solver_par *solver_par, magma_z_preconditioner *precond_par, magma_queue_t queue)
 Frees any memory assocoiated with the verbose mode of solver_par. More...
 
magma_int_t magma_zsolverinfo_init (magma_z_solver_par *solver_par, magma_z_preconditioner *precond_par, magma_queue_t queue)
 Initializes all solver and preconditioner parameters. More...
 
magma_int_t magma_zeigensolverinfo_init (magma_z_solver_par *solver_par, magma_queue_t queue)
 Initializes space for eigensolvers. More...
 
magma_int_t magma_zsort (magmaDoubleComplex *x, magma_int_t first, magma_int_t last, magma_queue_t queue)
 Sorts an array of values in increasing order. More...
 
magma_int_t magma_zmsort (magmaDoubleComplex *x, magma_index_t *col, magma_index_t *row, magma_int_t first, magma_int_t last, magma_queue_t queue)
 Sorts an array of values in increasing order. More...
 
magma_int_t magma_zindexsort (magma_index_t *x, magma_int_t first, magma_int_t last, magma_queue_t queue)
 Sorts an array of integers in increasing order. More...
 
magma_int_t magma_zindexsortval (magma_index_t *x, magmaDoubleComplex *y, magma_int_t first, magma_int_t last, magma_queue_t queue)
 Sorts an array of integers, updates a respective array of values. More...
 
magma_int_t magma_zmorderstatistics (magmaDoubleComplex *val, magma_index_t *col, magma_index_t *row, magma_int_t length, magma_int_t k, magma_int_t r, magmaDoubleComplex *element, magma_queue_t queue)
 Identifies the kth smallest/largest element in an array and reorders such that these elements come to the front. More...
 
magma_int_t magma_zorderstatistics (magmaDoubleComplex *val, magma_int_t length, magma_int_t k, magma_int_t r, magmaDoubleComplex *element, magma_queue_t queue)
 Identifies the kth smallest/largest element in an array. More...
 
magma_int_t magma_zparse_opts (int argc, char **argv, magma_zopts *opts, int *matrices, magma_queue_t queue)
 Parses input options for a solver. More...
 
magma_int_t magma_zvinit (magma_z_matrix *x, magma_location_t mem_loc, magma_int_t num_rows, magma_int_t num_cols, magmaDoubleComplex values, magma_queue_t queue)
 Allocates memory for magma_z_matrix and initializes it with the passed value. More...
 
magma_int_t magma_zprint_vector (magma_z_matrix x, magma_int_t offset, magma_int_t visulen, magma_queue_t queue)
 Visualizes part of a vector of type magma_z_matrix. More...
 
magma_int_t magma_zvread (magma_z_matrix *x, magma_int_t length, char *filename, magma_queue_t queue)
 Reads in a double vector of length "length". More...
 
magma_int_t magma_zvspread (magma_z_matrix *x, const char *filename, magma_queue_t queue)
 Reads in a sparse vector-block stored in COO format. More...
 
magma_int_t magma_zwrite_vector (magma_z_matrix A, const char *filename, magma_queue_t queue)
 Writes a vector to a file. More...
 
magma_int_t magma_zvset (magma_int_t m, magma_int_t n, magmaDoubleComplex *val, magma_z_matrix *v, magma_queue_t queue)
 Passes a vector to MAGMA. More...
 
magma_int_t magma_zvget (magma_z_matrix v, magma_int_t *m, magma_int_t *n, magmaDoubleComplex **val, magma_queue_t queue)
 Passes a MAGMA vector back. More...
 
magma_int_t magma_zvset_dev (magma_int_t m, magma_int_t n, magmaDoubleComplex_ptr val, magma_z_matrix *v, magma_queue_t queue)
 Passes a vector to MAGMA (located on DEV). More...
 
magma_int_t magma_zvget_dev (magma_z_matrix v, magma_int_t *m, magma_int_t *n, magmaDoubleComplex_ptr *val, magma_queue_t queue)
 Passes a MAGMA vector back (located on DEV). More...
 
magma_int_t magma_zvtranspose (magma_z_matrix x, magma_z_matrix *y, magma_queue_t queue)
 Transposes a vector from col to row major and vice versa. More...
 
magma_int_t magma_zdiagcheck (magma_z_matrix dA, magma_queue_t queue)
 This routine checks for a CSR matrix whether there exists a zero on the diagonal. More...
 
magma_int_t magma_vector_zlag2c (magma_z_matrix x, magma_c_vector *y, magma_queue_t queue)
 convertes magma_z_matrix from Z to C More...
 
magma_int_t magma_zmconjugate (magma_z_matrix *A, magma_queue_t queue)
 This function conjugates a matrix. More...
 
magma_int_t magma_zmcsrcompressor_gpu (magma_z_matrix *A, magma_queue_t queue)
 Removes zeros in a CSR matrix. More...
 
magma_int_t magma_zmisai_blockstruct_gpu (magma_int_t n, magma_int_t bs, magma_int_t offs, magma_uplo_t uplotype, magma_z_matrix *A, magma_queue_t queue)
 Generates a block-diagonal sparsity pattern with block-size bs on the GPU. More...
 
magma_int_t magma_zmbackinsert_batched_gpu (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_z_matrix *M, magma_index_t *sizes, magma_index_t *locations, magmaDoubleComplex *trisystems, magmaDoubleComplex *rhs, magma_queue_t queue)
 Inserts the values into the preconditioner matrix. More...
 
magma_int_t magma_zisaigenerator_16_gpu (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_z_matrix L, magma_z_matrix *M, magma_index_t *sizes, magma_index_t *locations, magmaDoubleComplex *trisystems, magmaDoubleComplex *rhs, magma_queue_t queue)
 This routine is designet to combine all kernels into one. More...
 
magma_int_t magma_zisaigenerator_32_gpu (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_z_matrix L, magma_z_matrix *M, magma_index_t *sizes, magma_index_t *locations, magmaDoubleComplex *trisystems, magmaDoubleComplex *rhs, magma_queue_t queue)
 This routine is designet to combine all kernels into one. More...
 
magma_int_t magma_zisaigenerator_8_gpu (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_z_matrix L, magma_z_matrix *M, magma_index_t *sizes, magma_index_t *locations, magmaDoubleComplex *trisystems, magmaDoubleComplex *rhs, magma_queue_t queue)
 This routine is designet to combine all kernels into one. More...
 
magma_int_t magma_zisai_generator_regs (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_z_matrix L, magma_z_matrix *M, magma_index_t *sizes, magma_index_t *locations, magmaDoubleComplex *trisystems, magmaDoubleComplex *rhs, magma_queue_t queue)
 This routine is designet to combine all kernels into one. More...
 
magma_int_t magma_zgeisai_maxblock (magma_z_matrix L, magma_z_matrix *MT, magma_queue_t queue)
 This routine maximizes the pattern for the ISAI preconditioner. More...
 
magma_int_t magma_zmtrisolve_batched_gpu (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_z_matrix L, magma_z_matrix LC, magma_index_t *sizes, magma_index_t *locations, magmaDoubleComplex *trisystems, magmaDoubleComplex *rhs, magma_queue_t queue)
 Does all triangular solves. More...
 
void magmablas_zlag2c_sparse (magma_int_t M, magma_int_t N, const magmaDoubleComplex_ptr A, magma_int_t lda, magmaFloatComplex *SA, magma_int_t ldsa, magma_queue_t queue, 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, magmaDouble_ptr evalues, magmaDoubleComplex_ptr X, magmaDoubleComplex_ptr R, magmaDouble_ptr res, magma_queue_t queue)
 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_ptr x, magma_queue_t queue)
 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 (magma_int_t n, magma_int_t k, magmaDoubleComplex_ptr r, magmaDoubleComplex_ptr v, magmaDoubleComplex_ptr skp, magma_queue_t queue)
 Computes the correction term of the pipelined GMRES according to P. More...
 

Detailed Description

Function Documentation

magma_int_t magma_z_precond ( magma_z_matrix  A,
magma_z_matrix  b,
magma_z_matrix *  x,
magma_z_preconditioner *  precond,
magma_queue_t  queue 
)

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
[in]Amagma_z_matrix sparse matrix A
[in]bmagma_z_matrix input vector b
[in]xmagma_z_matrix* output vector x
[in,out]precondmagma_z_preconditioner preconditioner
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_z_precondsetup ( magma_z_matrix  A,
magma_z_matrix  b,
magma_z_solver_par *  solver,
magma_z_preconditioner *  precond,
magma_queue_t  queue 
)

For a given input matrix M 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
[in]Amagma_z_matrix sparse matrix M
[in]bmagma_z_matrix input vector y
[in]solvermagma_z_solver_par solver structure using the preconditioner
[in,out]precondmagma_z_preconditioner preconditioner
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_z_applyprecond ( magma_z_matrix  A,
magma_z_matrix  b,
magma_z_matrix *  x,
magma_z_preconditioner *  precond,
magma_queue_t  queue 
)

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
[in]Amagma_z_matrix sparse matrix A
[in]bmagma_z_matrix input vector b
[in,out]xmagma_z_matrix* output vector x
[in]precondmagma_z_preconditioner preconditioner
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_z_applyprecond_left ( magma_trans_t  trans,
magma_z_matrix  A,
magma_z_matrix  b,
magma_z_matrix *  x,
magma_z_preconditioner *  precond,
magma_queue_t  queue 
)

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
[in]transmagma_trans_t mode of the preconditioner: MagmaTrans or MagmaNoTrans
[in]Amagma_z_matrix sparse matrix A
[in]bmagma_z_matrix input vector b
[in,out]xmagma_z_matrix* output vector x
[in]precondmagma_z_preconditioner preconditioner
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_z_applyprecond_right ( magma_trans_t  trans,
magma_z_matrix  A,
magma_z_matrix  b,
magma_z_matrix *  x,
magma_z_preconditioner *  precond,
magma_queue_t  queue 
)

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
[in]transmagma_trans_t mode of the preconditioner: MagmaTrans or MagmaNoTrans
[in]Amagma_z_matrix sparse matrix A
[in]bmagma_z_matrix input vector b
[in,out]xmagma_z_matrix* output vector x
[in]precondmagma_z_preconditioner preconditioner
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_z_solver ( magma_z_matrix  A,
magma_z_matrix  b,
magma_z_matrix *  x,
magma_zopts *  zopts,
magma_queue_t  queue 
)

Allows the user to choose a solver.

Parameters
[in]Amagma_z_matrix sparse matrix A
[in]bmagma_z_matrix input vector b
[in]xmagma_z_matrix* output vector x
[in]zoptsmagma_zopts options for solver and preconditioner
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zapplycustomprecond_l ( magma_z_matrix  b,
magma_z_matrix *  x,
magma_z_preconditioner *  precond,
magma_queue_t  queue 
)

This is an interface to the left solve for any custom preconditioner.

It should compute x = FUNCTION(b) The vectors are located on the device.

Parameters
[in]bmagma_z_matrix RHS
[in,out]xmagma_z_matrix* vector to precondition
[in,out]precondmagma_z_preconditioner* preconditioner parameters
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zapplycustomprecond_r ( magma_z_matrix  b,
magma_z_matrix *  x,
magma_z_preconditioner *  precond,
magma_queue_t  queue 
)

This is an interface to the right solve for any custom preconditioner.

It should compute x = FUNCTION(b) The vectors are located on the device.

Parameters
[in]bmagma_z_matrix RHS
[in,out]xmagma_z_matrix* vector to precondition
[in,out]precondmagma_z_preconditioner* preconditioner parameters
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmlumerge ( magma_z_matrix  L,
magma_z_matrix  U,
magma_z_matrix *  A 
)

Takes an strictly lower triangular matrix L and an upper triangular matrix U and merges them into a matrix A containing the upper and lower triangular parts.

Parameters
Lmagma_z_matrix input strictly lower triangular matrix L
Umagma_z_matrix input upper triangular matrix U
Amagma_z_matrix* output matrix
magma_int_t magma_zresidual ( magma_z_matrix  A,
magma_z_matrix  b,
magma_z_matrix  x,
double *  res,
magma_queue_t  queue 
)

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

Parameters
[in]Amagma_z_matrix input matrix A
[in]bmagma_z_matrix RHS b
[in]xmagma_z_matrix solution approximation
[out]resmagmaDoubleComplex* return residual
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zresidual_slice ( magma_int_t  start,
magma_int_t  end,
magma_z_matrix  A,
magma_z_matrix  b,
magma_z_matrix  x,
double *  res,
magma_queue_t  queue 
)

Computes the residual r=||b-Ax|| for the slice r(start:end) for a solution approximation x.

Parameters
[in]startmagma_int_t start of slice (row-index)
[in]endmagma_int_t end of slice (row-index)
[in]Amagma_z_matrix input matrix A
[in]bmagma_z_matrix RHS b
[in]xmagma_z_matrix solution approximation
[out]resmagmaDoubleComplex* return residual
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zresidualvec ( magma_z_matrix  A,
magma_z_matrix  b,
magma_z_matrix  x,
magma_z_matrix *  r,
double *  res,
magma_queue_t  queue 
)

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

It returns both, the actual residual and the residual vector

Parameters
[in]Amagma_z_matrix input matrix A
[in]bmagma_z_matrix RHS b
[in]xmagma_z_matrix solution approximation
[in,out]rmagma_z_matrix* residual vector
[out]resmagmaDoubleComplex* return residual
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zcsrsplit ( magma_int_t  offset,
magma_int_t  bsize,
magma_z_matrix  A,
magma_z_matrix *  D,
magma_z_matrix *  R,
magma_queue_t  queue 
)

Splits a CSR matrix into two matrices, one containing the diagonal blocks with the diagonal element stored first, one containing the rest of the original matrix.

Parameters
[in]offsetmagma_int_t size of the first block
[in]bsizemagma_int_t size of the diagonal blocks
[in]Amagma_z_matrix CSR input matrix
[out]Dmagma_z_matrix* CSR matrix containing diagonal blocks
[out]Rmagma_z_matrix* CSR matrix containing rest
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zdomainoverlap ( magma_index_t  num_rows,
magma_int_t *  num_indices,
magma_index_t *  rowptr,
magma_index_t *  colidx,
magma_index_t *  x,
magma_queue_t  queue 
)

Generates the update list.

Parameters
[in]xmagma_index_t* array to sort
[in]num_rowsmagma_int_t number of rows in matrix
[out]num_indicesmagma_int_t* number of indices in array
[in]rowptrmagma_index_t* rowpointer of matrix
[in]colidxmagma_index_t* colindices of matrix
[in]xmagma_index_t* array containing indices for domain overlap
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmfree ( magma_z_matrix *  A,
magma_queue_t  queue 
)

Free the memory of a magma_z_matrix.

Parameters
[in,out]Amagma_z_matrix* matrix to free
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmprepare_batched ( magma_uplo_t  uplotype,
magma_trans_t  transtype,
magma_diag_t  diagtype,
magma_z_matrix  L,
magma_z_matrix  LC,
magma_index_t *  sizes,
magma_index_t *  locations,
magmaDoubleComplex *  trisystems,
magmaDoubleComplex *  rhs,
magma_queue_t  queue 
)

Takes a sparse matrix and generates an array containing the sizes of the different systems an array containing the indices with the locations in the sparse matrix where the data comes from and goes back to an array containing all the sparse triangular systems.

  • padded with zeros to size 32x32 an array containing the RHS
Parameters
[in]uplotypemagma_uplo_t lower or upper triangular
[in]transtypemagma_trans_t possibility for transposed matrix
[in]diagtypemagma_diag_t unit diagonal or not
[in]Lmagma_z_matrix Matrix in CSR format
[in]LCmagma_z_matrix same matrix, also CSR, but col-major
[in,out]sizesmagma_int_t* Number of Elements that are replaced.
[in,out]locationsmagma_int_t* Array indicating the locations.
[in,out]trisystemsmagmaDoubleComplex* trisystems
[in,out]rhsmagmaDoubleComplex* right-hand sides
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmtrisolve_batched ( magma_uplo_t  uplotype,
magma_trans_t  transtype,
magma_diag_t  diagtype,
magma_z_matrix  L,
magma_z_matrix  LC,
magma_index_t *  sizes,
magma_index_t *  locations,
magmaDoubleComplex *  trisystems,
magmaDoubleComplex *  rhs,
magma_queue_t  queue 
)

Does all triangular solves.

Parameters
[in]uplotypemagma_uplo_t lower or upper triangular
[in]transtypemagma_trans_t possibility for transposed matrix
[in]diagtypemagma_diag_t unit diagonal or not
[in]Lmagma_z_matrix Matrix in CSR format
[in]LCmagma_z_matrix same matrix, also CSR, but col-major
[out]sizesmagma_int_t* Number of Elements that are replaced.
[out]locationsmagma_int_t* Array indicating the locations.
[out]trisystemsmagmaDoubleComplex* trisystems
[out]rhsmagmaDoubleComplex* right-hand sides
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmbackinsert_batched ( magma_uplo_t  uplotype,
magma_trans_t  transtype,
magma_diag_t  diagtype,
magma_z_matrix *  M,
magma_index_t *  sizes,
magma_index_t *  locations,
magmaDoubleComplex *  trisystems,
magmaDoubleComplex *  rhs,
magma_queue_t  queue 
)

Inserts the values into the preconditioner matrix.

Parameters
[in]uplotypemagma_uplo_t lower or upper triangular
[in]transtypemagma_trans_t possibility for transposed matrix
[in]diagtypemagma_diag_t unit diagonal or not
[in,out]Mmagma_z_matrix* SPAI preconditioner CSR col-major
[out]sizesmagma_int_t* Number of Elements that are replaced.
[out]locationsmagma_int_t* Array indicating the locations.
[out]trisystemsmagmaDoubleComplex* trisystems
[out]rhsmagmaDoubleComplex* right-hand sides
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmiluspai_sizecheck ( magma_z_matrix  A,
magma_index_t  batchsize,
magma_index_t *  maxsize,
magma_queue_t  queue 
)

Checks for a matrix whether the batched ISAI works for a given thread-block size.

Parameters
[in]Amagma_z_matrix system matrix
[in]batchsizemagma_int_t Size of the batch (GPU thread block).
[out]maxsizemagma_int_t* maximum A(:,i) and A(i,:).
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmisai_blockstruct ( magma_int_t  n,
magma_int_t  bs,
magma_int_t  offs,
magma_uplo_t  uplotype,
magma_z_matrix *  A,
magma_queue_t  queue 
)

Generates a block-diagonal sparsity pattern with block-size bs.

Parameters
[in]nmagma_int_t Size of the matrix.
[in]bsmagma_int_t Size of the diagonal blocks.
[in]offsmagma_int_t Size of the first diagonal block.
[in]uplotypemagma_uplo_t lower or upper triangular
[in,out]Amagma_z_matrix* Generated sparsity pattern matrix.
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zrowentries ( magma_z_matrix *  A,
magma_queue_t  queue 
)

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

Inserts the data into max_nnz_row.

Parameters
[in,out]Amagma_z_matrix* sparse matrix
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zdiameter ( magma_z_matrix *  A,
magma_queue_t  queue 
)

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

Parameters
[in,out]Amagma_z_matrix* sparse matrix
[in]queuemagma_queue_t Queue to execute in.
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,
magma_queue_t  queue 
)

Helper function to compress CSR containing zero-entries.

Parameters
[in]valmagmaDoubleComplex** input val pointer to compress
[in]rowmagma_int_t** input row pointer to modify
[in]colmagma_int_t** input col pointer to compress
[in]valnmagmaDoubleComplex** output val pointer
[out]rownmagma_int_t** output row pointer
[out]colnmagma_int_t** output col pointer
[out]nmagma_int_t* number of rows in matrix
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmconvert ( magma_z_matrix  A,
magma_z_matrix *  B,
magma_storage_t  old_format,
magma_storage_t  new_format,
magma_queue_t  queue 
)

Converter between different sparse storage formats.

Parameters
[in]Amagma_z_matrix sparse matrix A
[out]Bmagma_z_matrix* copy of A in new format
[in]old_formatmagma_storage_t original storage format
[in]new_formatmagma_storage_t new storage format
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmcsrcompressor ( magma_z_matrix *  A,
magma_queue_t  queue 
)

Removes zeros in a CSR matrix.

Parameters
[in,out]Amagma_z_matrix* input/output matrix
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zcsrset ( magma_int_t  m,
magma_int_t  n,
magma_index_t *  row,
magma_index_t *  col,
magmaDoubleComplex *  val,
magma_z_matrix *  A,
magma_queue_t  queue 
)

Passes a CSR matrix to MAGMA.

Parameters
[in]mmagma_int_t number of rows
[in]nmagma_int_t number of columns
[in]rowmagma_index_t* row pointer
[in]colmagma_index_t* column indices
[in]valmagmaDoubleComplex* array containing matrix entries
[out]Amagma_z_matrix* matrix in magma sparse matrix format
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zcsrget ( magma_z_matrix  A,
magma_int_t *  m,
magma_int_t *  n,
magma_index_t **  row,
magma_index_t **  col,
magmaDoubleComplex **  val,
magma_queue_t  queue 
)

Passes a MAGMA matrix to CSR structure.

Parameters
[in]Amagma_z_matrix magma sparse matrix in CSR format
[out]mmagma_int_t number of rows
[out]nmagma_int_t number of columns
[out]rowmagma_index_t* row pointer
[out]colmagma_index_t* column indices
[out]valmagmaDoubleComplex* array containing matrix entries
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zcsrset_gpu ( magma_int_t  m,
magma_int_t  n,
magmaIndex_ptr  row,
magmaIndex_ptr  col,
magmaDoubleComplex_ptr  val,
magma_z_matrix *  A,
magma_queue_t  queue 
)

Passes a CSR matrix to MAGMA (located on DEV).

Parameters
[in]mmagma_int_t number of rows
[in]nmagma_int_t number of columns
[in]rowmagmaIndex_ptr row pointer
[in]colmagmaIndex_ptr column indices
[in]valmagmaDoubleComplex_ptr array containing matrix entries
[out]Amagma_z_matrix* matrix in magma sparse matrix format
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zcsrget_gpu ( magma_z_matrix  A,
magma_int_t *  m,
magma_int_t *  n,
magmaIndex_ptr *  row,
magmaIndex_ptr *  col,
magmaDoubleComplex_ptr *  val,
magma_queue_t  queue 
)

Passes a MAGMA matrix to CSR structure (located on DEV).

Parameters
[in]Amagma_z_matrix magma sparse matrix in CSR format
[out]mmagma_int_t number of rows
[out]nmagma_int_t number of columns
[out]rowmagmaIndex_ptr row pointer
[out]colmagmaIndex_ptr column indices
[out]valmagmaDoubleComplex_ptr array containing matrix entries
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmdiff ( magma_z_matrix  A,
magma_z_matrix  B,
real_Double_t *  res,
magma_queue_t  queue 
)

Computes the Frobenius norm of the difference between the CSR matrices A and B.

They do not need to share the same sparsity pattern!

   res = ||A-B||_F = sqrt( sum_ij (A_ij-B_ij)^2 )
Parameters
[in]Amagma_z_matrix sparse matrix in CSR
[in]Bmagma_z_matrix sparse matrix in CSR
[out]resreal_Double_t* residual
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmgenerator ( magma_int_t  n,
magma_int_t  offdiags,
magma_index_t *  diag_offset,
magmaDoubleComplex *  diag_vals,
magma_z_matrix *  A,
magma_queue_t  queue 
)

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

Parameters
[in]nmagma_int_t number of rows
[in]offdiagsmagma_int_t number of offdiagonals
[in]diag_offsetmagma_int_t* array containing the offsets
                            (length offsets+1)
[in]diag_valsmagmaDoubleComplex* array containing the values
                            (length offsets+1)
[out]Amagma_z_matrix* matrix to generate
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zm_27stencil ( magma_int_t  n,
magma_z_matrix *  A,
magma_queue_t  queue 
)

Generate a 27-point stencil for a 3D FD discretization.

Parameters
[in]nmagma_int_t number of rows
[out]Amagma_z_matrix* matrix to generate
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zm_5stencil ( magma_int_t  n,
magma_z_matrix *  A,
magma_queue_t  queue 
)

Generate a 5-point stencil for a 2D FD discretization.

Parameters
[in]nmagma_int_t number of rows
[out]Amagma_z_matrix* matrix to generate
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zsymbilu ( magma_z_matrix *  A,
magma_int_t  levels,
magma_z_matrix *  L,
magma_z_matrix *  U,
magma_queue_t  queue 
)

This routine performs a symbolic ILU factorization.

The algorithm is taken from an implementation written by Edmond Chow.

Parameters
[in,out]Amagma_z_matrix* matrix in magma sparse matrix format containing the original matrix on input, and L,U on output
[in]levelsmagma_magma_int_t_t fill in level
[out]Lmagma_z_matrix* output lower triangular matrix in magma sparse matrix format empty on function call
[out]Umagma_z_matrix* output upper triangular matrix in magma sparse matrix format empty on function call
[in]queuemagma_queue_t Queue to execute in.
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,
magma_queue_t  queue 
)

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
[out]typemagma_storage_t* storage type of matrix
[out]locationmagma_location_t* location of matrix
[out]n_rowmagma_int_t* number of rows in matrix
[out]n_colmagma_int_t* number of columns in matrix
[out]nnzmagma_int_t* number of nonzeros in matrix
[out]valmagmaDoubleComplex** value array of CSR output
[out]rowmagma_index_t** row pointer of CSR output
[out]colmagma_index_t** column indices of CSR output
[in]filenameconst char* filname of the mtx matrix
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zwrite_csr_mtx ( magma_z_matrix  A,
magma_order_t  MajorType,
const char *  filename,
magma_queue_t  queue 
)

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

Parameters
[in]Amagma_z_matrix matrix to write out
[in]MajorTypemagma_index_t Row or Column sort default: 0 = RowMajor, 1 = ColMajor TODO: use named constants (e.g., MagmaRowMajor), not numbers.
[in]filenameconst char* output-filname of the mtx matrix
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zprint_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,
magma_queue_t  queue 
)

Prints a CSR matrix in Matrix Market format.

Parameters
[in]n_rowmagma_int_t* number of rows in matrix
[in]n_colmagma_int_t* number of columns in matrix
[in]nnzmagma_int_t* number of nonzeros in matrix
[in]valmagmaDoubleComplex** value array of CSR
[in]rowmagma_index_t** row pointer of CSR
[in]colmagma_index_t** column indices of CSR
[in]MajorTypemagma_index_t Row or Column sort default: 0 = RowMajor, 1 = ColMajor
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zprint_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,
magma_queue_t  queue 
)

Prints a CSR matrix in CSR format.

Parameters
[in]n_rowmagma_int_t* number of rows in matrix
[in]n_colmagma_int_t* number of columns in matrix
[in]nnzmagma_int_t* number of nonzeros in matrix
[in]valmagmaDoubleComplex** value array of CSR
[in]rowmagma_index_t** row pointer of CSR
[in]colmagma_index_t** column indices of CSR
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zprint_matrix ( magma_z_matrix  A,
magma_queue_t  queue 
)

Prints a sparse matrix in CSR format.

Parameters
[in]Amagma_z_matrix sparse matrix in Magma_CSR format
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_z_csr_mtx ( magma_z_matrix *  A,
const char *  filename,
magma_queue_t  queue 
)

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
[out]Amagma_z_matrix* matrix in magma sparse matrix format
[in]filenameconst char* filname of the mtx matrix
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_z_csr_mtxsymm ( magma_z_matrix *  A,
const char *  filename,
magma_queue_t  queue 
)

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
[out]Amagma_z_matrix* matrix in magma sparse matrix format
[in]filenameconst char* filname of the mtx matrix
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmlumerge ( magma_z_matrix  L,
magma_z_matrix  U,
magma_z_matrix *  A,
magma_queue_t  queue 
)

Takes an strictly lower triangular matrix L and an upper triangular matrix U and merges them into a matrix A containing the upper and lower triangular parts.

Parameters
[in]Lmagma_z_matrix input strictly lower triangular matrix L
[in]Umagma_z_matrix input upper triangular matrix U
[out]Amagma_z_matrix* output matrix
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmscale ( magma_z_matrix *  A,
magma_scale_t  scaling,
magma_queue_t  queue 
)

Scales a matrix.

Parameters
[in,out]Amagma_z_matrix* input/output matrix
[in]scalingmagma_scale_t scaling type (unit rownorm / unit diagonal)
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmdiagadd ( magma_z_matrix *  A,
magmaDoubleComplex  add,
magma_queue_t  queue 
)

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

Parameters
[in,out]Amagma_z_matrix* input/output matrix
[in]addmagmaDoubleComplex scaling for the identity matrix
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmshrink ( magma_z_matrix  A,
magma_z_matrix *  B,
magma_queue_t  queue 
)

Shrinks a non-square matrix (m < n) to the smaller dimension.

Parameters
[in]Amagma_z_matrix sparse matrix A
[out]Bmagma_z_matrix* sparse matrix A
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmslice ( magma_int_t  num_slices,
magma_int_t  slice,
magma_z_matrix  A,
magma_z_matrix *  B,
magma_z_matrix *  ALOC,
magma_z_matrix *  ANLOC,
magma_index_t *  comm_i,
magmaDoubleComplex *  comm_v,
magma_int_t *  start,
magma_int_t *  end,
magma_queue_t  queue 
)

Takes a matrix and extracts a slice for solving the system in parallel:

B = A( i:i+n, : ) and ALOC = A(i:i+n,i:i+n) and ANLOCA(0:start - end:n,:)

B is of size n x n, ALOC of size end-start x end-start, ANLOC of size end-start x n

The last slice might be smaller. For the non-local parts, B is the identity. comm contains 1ess in the locations that are non-local but needed to solve local system.

Parameters
[in]num_slicesmagma_int_t number of slices
[in]slicemagma_int_t slice id (0.. num_slices-1)
[in]Amagma_z_matrix sparse matrix in CSR
[out]Bmagma_z_matrix* sparse matrix in CSR
[out]ALOCmagma_z_matrix* sparse matrix in CSR
[out]ANLOCmagma_z_matrix* sparse matrix in CSR
[in,out]comm_imagma_int_t* communication plan
[in,out]comm_vmagmaDoubleComplex* communication plan
[in]queuemagma_queue_t Queue to execute in.
[out]startmagma_int_t* start of slice (row-index)
[out]endmagma_int_t* end of slice (row-index)
magma_int_t magma_zmsupernodal ( magma_int_t *  max_bs,
magma_z_matrix  A,
magma_z_matrix *  S,
magma_queue_t  queue 
)

Generates a block-diagonal sparsity pattern with block-size bs.

Parameters
[in,out]max_bsmagma_int_t* Size of the largest diagonal block.
[in]Amagma_z_matrix System matrix.
[in,out]Smagma_z_matrix* Generated sparsity pattern matrix.
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmvarsizeblockstruct ( magma_int_t  n,
magma_int_t *  bs,
magma_int_t  bsl,
magma_uplo_t  uplotype,
magma_z_matrix *  A,
magma_queue_t  queue 
)

Generates a block-diagonal sparsity pattern with variable block-size.

Parameters
[in]nmagma_int_t Size of the matrix.
[in]bsmagma_int_t* Vector containing the size of the diagonal blocks.
[in]bslmagma_int_t Size of the vector containing the block sizes.
[in]uplotypemagma_uplo_t lower or upper triangular
[in,out]Amagma_z_matrix* Generated sparsity pattern matrix.
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmtransfer ( magma_z_matrix  A,
magma_z_matrix *  B,
magma_location_t  src,
magma_location_t  dst,
magma_queue_t  queue 
)

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

Parameters
[in]Amagma_z_matrix sparse matrix A
[out]Bmagma_z_matrix* copy of A
[in]srcmagma_location_t original location A
[in]dstmagma_location_t location of the copy of A
[in]queuemagma_queue_t Queue to execute in.
magma_int_t z_transpose_csr ( magma_int_t  n_rows,
magma_int_t  n_cols,
magma_int_t  nnz,
magmaDoubleComplex *  values,
magma_index_t *  rowptr,
magma_index_t *  colind,
magma_int_t *  new_n_rows,
magma_int_t *  new_n_cols,
magma_int_t *  new_nnz,
magmaDoubleComplex **  new_values,
magma_index_t **  new_rowptr,
magma_index_t **  new_colind,
magma_queue_t  queue 
)

Transposes a matrix stored in CSR format on the CPU host.

Parameters
[in]n_rowsmagma_int_t number of rows in input matrix
[in]n_colsmagma_int_t number of columns in input matrix
[in]nnzmagma_int_t number of nonzeros in input matrix
[in]valuesmagmaDoubleComplex* value array of input matrix
[in]rowptrmagma_index_t* row pointer of input matrix
[in]colindmagma_index_t* column indices of input matrix
[in]new_n_rowsmagma_index_t* number of rows in transposed matrix
[in]new_n_colsmagma_index_t* number of columns in transposed matrix
[in]new_nnzmagma_index_t* number of nonzeros in transposed matrix
[in]new_valuesmagmaDoubleComplex** value array of transposed matrix
[in]new_rowptrmagma_index_t** row pointer of transposed matrix
[in]new_colindmagma_index_t** column indices of transposed matrix
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmtranspose ( magma_z_matrix  A,
magma_z_matrix *  B,
magma_queue_t  queue 
)

Interface to cuSPARSE transpose.

Parameters
[in]Amagma_z_matrix input matrix (CSR)
[out]Bmagma_z_matrix* output matrix (CSR)
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_z_cucsrtranspose ( magma_z_matrix  A,
magma_z_matrix *  B,
magma_queue_t  queue 
)

Helper function to transpose CSR matrix.

Using the CUSPARSE CSR2CSC function.

Parameters
[in]Amagma_z_matrix input matrix (CSR)
[out]Bmagma_z_matrix* output matrix (CSR)
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmtransposeconjugate ( magma_z_matrix  A,
magma_z_matrix *  B,
magma_queue_t  queue 
)

This function forms the transpose conjugate of a matrix.

For a real-value matrix, the output is the transpose.

Parameters
[in]Amagma_z_matrix input matrix (CSR)
[out]Bmagma_z_matrix* output matrix (CSR)
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zfrobenius ( magma_z_matrix  A,
magma_z_matrix  B,
real_Double_t *  res,
magma_queue_t  queue 
)

Computes the Frobenius norm of the difference between the CSR matrices A and B.

They need to share the same sparsity pattern!

Parameters
[in]Amagma_z_matrix sparse matrix in CSR
[in]Bmagma_z_matrix sparse matrix in CSR
[out]resreal_Double_t* Frobenius norm of difference
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_znonlinres ( magma_z_matrix  A,
magma_z_matrix  L,
magma_z_matrix  U,
magma_z_matrix *  LU,
real_Double_t *  res,
magma_queue_t  queue 
)

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

Parameters
[in]Amagma_z_matrix input sparse matrix in CSR
[in]Lmagma_z_matrix input sparse matrix in CSR
[in]Umagma_z_matrix input sparse matrix in CSR
[out]LUmagma_z_matrix* output sparse matrix in A-LU in CSR
[out]resreal_Double_t* Frobenius norm of difference
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zilures ( magma_z_matrix  A,
magma_z_matrix  L,
magma_z_matrix  U,
magma_z_matrix *  LU,
real_Double_t *  res,
real_Double_t *  nonlinres,
magma_queue_t  queue 
)

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

Parameters
[in]Amagma_z_matrix input sparse matrix in CSR
[in]Lmagma_z_matrix input sparse matrix in CSR
[in]Umagma_z_matrix input sparse matrix in CSR
[out]LUmagma_z_matrix* output sparse matrix in A-LU in CSR
[out]resreal_Double_t* Frobenius norm of difference
[out]nonlinresreal_Double_t* Frobenius norm of difference
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zicres ( magma_z_matrix  A,
magma_z_matrix  C,
magma_z_matrix  CT,
magma_z_matrix *  LU,
real_Double_t *  res,
real_Double_t *  nonlinres,
magma_queue_t  queue 
)

Computes the IC residual A - CC^T and returns the difference as well es the Frobenius norm of the difference.

Parameters
[in]Amagma_z_matrix input sparse matrix in CSR
[in]Cmagma_z_matrix input sparse matrix in CSR
[in]CTmagma_z_matrix input sparse matrix in CSR
[in]LUmagma_z_matrix* output sparse matrix in A-LU in CSR
[out]resreal_Double_t* IC residual
[out]nonlinresreal_Double_t* nonlinear residual
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zinitguess ( magma_z_matrix  A,
magma_z_matrix *  L,
magma_z_matrix *  U,
magma_queue_t  queue 
)

Computes an initial guess for the ParILU/ParIC.

Parameters
[in]Amagma_z_matrix sparse matrix in CSR
[out]Lmagma_z_matrix* sparse matrix in CSR
[out]Umagma_z_matrix* sparse matrix in CSR
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zinitrecursiveLU ( magma_z_matrix  A,
magma_z_matrix *  B,
magma_queue_t  queue 
)

Using the iterative approach of computing ILU factorizations with increasing fill-in, it takes the input matrix A, containing the approximate factors, ( L and U as well ) computes a matrix with one higher level of fill-in, inserts the original approximation as initial guess, and provides the factors L and U also filled with the scaled initial guess.

Parameters
[in]Amagma_z_matrix* sparse matrix in CSR
[out]Bmagma_z_matrix* sparse matrix in CSR
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmLdiagadd ( magma_z_matrix *  L,
magma_queue_t  queue 
)

Checks for a lower triangular matrix whether it is strictly lower triangular and in the negative case adds a unit diagonal.

It does this in-place.

Parameters
[in,out]Lmagma_z_matrix* sparse matrix in CSR
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zsolverinfo ( magma_z_solver_par *  solver_par,
magma_z_preconditioner *  precond_par,
magma_queue_t  queue 
)

Prints information about a previously called solver.

Parameters
[in]solver_parmagma_z_solver_par* structure containing all solver information
[in,out]precond_parmagma_z_preconditioner* structure containing all preconditioner information
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zsolverinfo_free ( magma_z_solver_par *  solver_par,
magma_z_preconditioner *  precond_par,
magma_queue_t  queue 
)

Frees any memory assocoiated with the verbose mode of solver_par.

The other values are set to default.

Parameters
[in,out]solver_parmagma_z_solver_par* structure containing all solver information
[in,out]precond_parmagma_z_preconditioner* structure containing all preconditioner information
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zsolverinfo_init ( magma_z_solver_par *  solver_par,
magma_z_preconditioner *  precond_par,
magma_queue_t  queue 
)

Initializes all solver and preconditioner parameters.

Parameters
[in,out]solver_parmagma_z_solver_par* structure containing all solver information
[in,out]precond_parmagma_z_preconditioner* structure containing all preconditioner information
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zeigensolverinfo_init ( magma_z_solver_par *  solver_par,
magma_queue_t  queue 
)

Initializes space for eigensolvers.

Parameters
[in,out]solver_parmagma_z_solver_par* structure containing all solver information
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zsort ( magmaDoubleComplex *  x,
magma_int_t  first,
magma_int_t  last,
magma_queue_t  queue 
)

Sorts an array of values in increasing order.

Parameters
[in,out]xmagmaDoubleComplex* array to sort
[in]firstmagma_int_t pointer to first element
[in]lastmagma_int_t pointer to last element
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmsort ( magmaDoubleComplex *  x,
magma_index_t *  col,
magma_index_t *  row,
magma_int_t  first,
magma_int_t  last,
magma_queue_t  queue 
)

Sorts an array of values in increasing order.

Parameters
[in,out]xmagmaDoubleComplex* array to sort
[in,out]colmagma_index_t* Target array, will be modified during operation.
[in,out]rowmagma_index_t* Target array, will be modified during operation.
[in]firstmagma_int_t pointer to first element
[in]lastmagma_int_t pointer to last element
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zindexsort ( magma_index_t *  x,
magma_int_t  first,
magma_int_t  last,
magma_queue_t  queue 
)

Sorts an array of integers in increasing order.

Parameters
[in,out]xmagma_index_t* array to sort
[in]firstmagma_int_t pointer to first element
[in]lastmagma_int_t pointer to last element
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zindexsortval ( magma_index_t *  x,
magmaDoubleComplex *  y,
magma_int_t  first,
magma_int_t  last,
magma_queue_t  queue 
)

Sorts an array of integers, updates a respective array of values.

Parameters
[in,out]xmagma_index_t* array to sort
[in,out]ymagmaDoubleComplex* array to sort
[in]firstmagma_int_t pointer to first element
[in]lastmagma_int_t pointer to last element
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmorderstatistics ( magmaDoubleComplex *  val,
magma_index_t *  col,
magma_index_t *  row,
magma_int_t  length,
magma_int_t  k,
magma_int_t  r,
magmaDoubleComplex *  element,
magma_queue_t  queue 
)

Identifies the kth smallest/largest element in an array and reorders such that these elements come to the front.

The related arrays col and row are also reordered.

Parameters
[in,out]valmagmaDoubleComplex* Target array, will be modified during operation.
[in,out]colmagma_index_t* Target array, will be modified during operation.
[in,out]rowmagma_index_t* Target array, will be modified during operation.
[in]lengthmagma_int_t Length of the target array.
[in]kmagma_int_t Element to be identified (largest/smallest).
[in]rmagma_int_t rule how to sort: '1' -> largest, '0' -> smallest
[out]elementmagmaDoubleComplex* location of the respective element
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zorderstatistics ( magmaDoubleComplex *  val,
magma_int_t  length,
magma_int_t  k,
magma_int_t  r,
magmaDoubleComplex *  element,
magma_queue_t  queue 
)

Identifies the kth smallest/largest element in an array.

Parameters
[in,out]valmagmaDoubleComplex* Target array, will be modified during operation.
[in]lengthmagma_int_t Length of the target array.
[in]kmagma_int_t Element to be identified (largest/smallest).
[in]rmagma_int_t rule how to sort: '1' -> largest, '0' -> smallest
[out]elementmagmaDoubleComplex* location of the respective element
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zparse_opts ( int  argc,
char **  argv,
magma_zopts *  opts,
int *  matrices,
magma_queue_t  queue 
)

Parses input options for a solver.

Parameters
[in]argcint command line input
[in]argvchar** command line input
[in,out]optsmagma_zopts * magma solver options
[out]matricesint counter how many linear systems to process
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zvinit ( magma_z_matrix *  x,
magma_location_t  mem_loc,
magma_int_t  num_rows,
magma_int_t  num_cols,
magmaDoubleComplex  values,
magma_queue_t  queue 
)

Allocates memory for magma_z_matrix and initializes it with the passed value.

Parameters
[out]xmagma_z_matrix* vector to initialize
[in]mem_locmagma_location_t memory for vector
[in]num_rowsmagma_int_t desired length of vector
[in]num_colsmagma_int_t desired width of vector-block (columns of dense matrix)
[in]valuesmagmaDoubleComplex entries in vector
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zprint_vector ( magma_z_matrix  x,
magma_int_t  offset,
magma_int_t  visulen,
magma_queue_t  queue 
)

Visualizes part of a vector of type magma_z_matrix.

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

Parameters
[in]xmagma_z_matrix vector to visualize
[in]offsetmagma_int_t start inex of visualization
[in]visulenmagma_int_t number of entries to visualize
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zvread ( magma_z_matrix *  x,
magma_int_t  length,
char *  filename,
magma_queue_t  queue 
)

Reads in a double vector of length "length".

Parameters
[out]xmagma_z_matrix * vector to read in
[in]lengthmagma_int_t length of vector
[in]filenamechar* file where vector is stored
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zvspread ( magma_z_matrix *  x,
const char *  filename,
magma_queue_t  queue 
)

Reads in a sparse vector-block stored in COO format.

Parameters
[out]xmagma_z_matrix * vector to read in
[in]filenamechar* file where vector is stored
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zwrite_vector ( magma_z_matrix  A,
const char *  filename,
magma_queue_t  queue 
)

Writes a vector to a file.

Parameters
[in]Amagma_z_matrix matrix to write out
[in]filenameconst char* output-filname of the mtx matrix
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zvset ( magma_int_t  m,
magma_int_t  n,
magmaDoubleComplex *  val,
magma_z_matrix *  v,
magma_queue_t  queue 
)

Passes a vector to MAGMA.

Parameters
[in]mmagma_int_t number of rows
[in]nmagma_int_t number of columns
[in]valmagmaDoubleComplex* array containing vector entries
[out]vmagma_z_matrix* magma vector
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zvget ( magma_z_matrix  v,
magma_int_t *  m,
magma_int_t *  n,
magmaDoubleComplex **  val,
magma_queue_t  queue 
)

Passes a MAGMA vector back.

Parameters
[in]vmagma_z_matrix magma vector
[out]mmagma_int_t number of rows
[out]nmagma_int_t number of columns
[out]valmagmaDoubleComplex* array containing vector entries
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zvset_dev ( magma_int_t  m,
magma_int_t  n,
magmaDoubleComplex_ptr  val,
magma_z_matrix *  v,
magma_queue_t  queue 
)

Passes a vector to MAGMA (located on DEV).

Parameters
[in]mmagma_int_t number of rows
[in]nmagma_int_t number of columns
[in]valmagmaDoubleComplex_ptr array containing vector entries
[out]vmagma_z_matrix* magma vector
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zvget_dev ( magma_z_matrix  v,
magma_int_t *  m,
magma_int_t *  n,
magmaDoubleComplex_ptr *  val,
magma_queue_t  queue 
)

Passes a MAGMA vector back (located on DEV).

Parameters
[in]vmagma_z_matrix magma vector
[out]mmagma_int_t number of rows
[out]nmagma_int_t number of columns
[out]valmagmaDoubleComplex_ptr array containing vector entries
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zvtranspose ( magma_z_matrix  x,
magma_z_matrix *  y,
magma_queue_t  queue 
)

Transposes a vector from col to row major and vice versa.

Parameters
[in]xmagma_z_matrix input vector
[out]ymagma_z_matrix* output vector
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zdiagcheck ( magma_z_matrix  dA,
magma_queue_t  queue 
)

This routine checks for a CSR matrix whether there exists a zero on the diagonal.

This can be the diagonal entry missing or an explicit zero.

Parameters
[in]dAmagma_z_matrix matrix in CSR format
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_vector_zlag2c ( magma_z_matrix  x,
magma_c_vector *  y,
magma_queue_t  queue 
)

convertes magma_z_matrix from Z to C

Parameters
xmagma_z_matrix input vector descriptor
ymagma_c_vector* output vector descriptor
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmconjugate ( magma_z_matrix *  A,
magma_queue_t  queue 
)

This function conjugates a matrix.

For a real matrix, no value is changed.

Parameters
[in,out]Amagma_z_matrix* input/output matrix
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmcsrcompressor_gpu ( magma_z_matrix *  A,
magma_queue_t  queue 
)

Removes zeros in a CSR matrix.

This is a GPU implementation of the CSR compressor.

Parameters
[in,out]Amagma_z_matrix* input/output matrix
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmisai_blockstruct_gpu ( magma_int_t  n,
magma_int_t  bs,
magma_int_t  offs,
magma_uplo_t  uplotype,
magma_z_matrix *  A,
magma_queue_t  queue 
)

Generates a block-diagonal sparsity pattern with block-size bs on the GPU.

Parameters
[in]nmagma_int_t Size of the matrix.
[in]bsmagma_int_t Size of the diagonal blocks.
[in]offsmagma_int_t Size of the first diagonal block.
[in]uplotypemagma_uplo_t lower or upper triangular
[in,out]Amagma_z_matrix* Generated sparsity pattern matrix.
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmbackinsert_batched_gpu ( magma_uplo_t  uplotype,
magma_trans_t  transtype,
magma_diag_t  diagtype,
magma_z_matrix *  M,
magma_index_t *  sizes,
magma_index_t *  locations,
magmaDoubleComplex *  trisystems,
magmaDoubleComplex *  rhs,
magma_queue_t  queue 
)

Inserts the values into the preconditioner matrix.

Parameters
[in]uplotypemagma_uplo_t lower or upper triangular
[in]transtypemagma_trans_t possibility for transposed matrix
[in]diagtypemagma_diag_t unit diagonal or not
[in,out]Mmagma_z_matrix* SPAI preconditioner CSR col-major
[out]sizesmagma_int_t* Number of Elements that are replaced.
[out]locationsmagma_int_t* Array indicating the locations.
[out]trisystemsmagmaDoubleComplex* trisystems
[out]rhsmagmaDoubleComplex* right-hand sides
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zisaigenerator_16_gpu ( magma_uplo_t  uplotype,
magma_trans_t  transtype,
magma_diag_t  diagtype,
magma_z_matrix  L,
magma_z_matrix *  M,
magma_index_t *  sizes,
magma_index_t *  locations,
magmaDoubleComplex *  trisystems,
magmaDoubleComplex *  rhs,
magma_queue_t  queue 
)

This routine is designet to combine all kernels into one.

Parameters
[in]uplotypemagma_uplo_t lower or upper triangular
[in]transtypemagma_trans_t possibility for transposed matrix
[in]diagtypemagma_diag_t unit diagonal or not
[in]Lmagma_z_matrix triangular factor for which the ISAI matrix is computed. Col-Major CSR storage.
[in,out]Mmagma_z_matrix* SPAI preconditioner CSR col-major
[out]sizesmagma_int_t* Number of Elements that are replaced.
[out]locationsmagma_int_t* Array indicating the locations.
[out]trisystemsmagmaDoubleComplex* trisystems
[out]rhsmagmaDoubleComplex* right-hand sides
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zisaigenerator_32_gpu ( magma_uplo_t  uplotype,
magma_trans_t  transtype,
magma_diag_t  diagtype,
magma_z_matrix  L,
magma_z_matrix *  M,
magma_index_t *  sizes,
magma_index_t *  locations,
magmaDoubleComplex *  trisystems,
magmaDoubleComplex *  rhs,
magma_queue_t  queue 
)

This routine is designet to combine all kernels into one.

Parameters
[in]uplotypemagma_uplo_t lower or upper triangular
[in]transtypemagma_trans_t possibility for transposed matrix
[in]diagtypemagma_diag_t unit diagonal or not
[in]Lmagma_z_matrix triangular factor for which the ISAI matrix is computed. Col-Major CSR storage.
[in,out]Mmagma_z_matrix* SPAI preconditioner CSR col-major
[out]sizesmagma_int_t* Number of Elements that are replaced.
[out]locationsmagma_int_t* Array indicating the locations.
[out]trisystemsmagmaDoubleComplex* trisystems
[out]rhsmagmaDoubleComplex* right-hand sides
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zisaigenerator_8_gpu ( magma_uplo_t  uplotype,
magma_trans_t  transtype,
magma_diag_t  diagtype,
magma_z_matrix  L,
magma_z_matrix *  M,
magma_index_t *  sizes,
magma_index_t *  locations,
magmaDoubleComplex *  trisystems,
magmaDoubleComplex *  rhs,
magma_queue_t  queue 
)

This routine is designet to combine all kernels into one.

Parameters
[in]uplotypemagma_uplo_t lower or upper triangular
[in]transtypemagma_trans_t possibility for transposed matrix
[in]diagtypemagma_diag_t unit diagonal or not
[in]Lmagma_z_matrix triangular factor for which the ISAI matrix is computed. Col-Major CSR storage.
[in,out]Mmagma_z_matrix* SPAI preconditioner CSR col-major
[out]sizesmagma_int_t* Number of Elements that are replaced.
[out]locationsmagma_int_t* Array indicating the locations.
[out]trisystemsmagmaDoubleComplex* trisystems
[out]rhsmagmaDoubleComplex* right-hand sides
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zisai_generator_regs ( magma_uplo_t  uplotype,
magma_trans_t  transtype,
magma_diag_t  diagtype,
magma_z_matrix  L,
magma_z_matrix *  M,
magma_index_t *  sizes,
magma_index_t *  locations,
magmaDoubleComplex *  trisystems,
magmaDoubleComplex *  rhs,
magma_queue_t  queue 
)

This routine is designet to combine all kernels into one.

Parameters
[in]uplotypemagma_uplo_t lower or upper triangular
[in]transtypemagma_trans_t possibility for transposed matrix
[in]diagtypemagma_diag_t unit diagonal or not
[in]Lmagma_z_matrix triangular factor for which the ISAI matrix is computed. Col-Major CSR storage.
[in,out]Mmagma_z_matrix* SPAI preconditioner CSR col-major
[out]sizesmagma_int_t* Number of Elements that are replaced.
[out]locationsmagma_int_t* Array indicating the locations.
[out]trisystemsmagmaDoubleComplex* trisystems
[out]rhsmagmaDoubleComplex* right-hand sides
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zgeisai_maxblock ( magma_z_matrix  L,
magma_z_matrix *  MT,
magma_queue_t  queue 
)

This routine maximizes the pattern for the ISAI preconditioner.

Precisely, it computes L, L^2, L^3, L^4, L^5 and then selects the columns of M_L such that the nonzer-per-column are the lower max than the implementation-specific limit (32).

The input is the original matrix (row-major) The output is already col-major.

Parameters
[in,out]Lmagma_z_matrix Incomplete factor.
[in,out]MTmagma_z_matrix* SPAI preconditioner structure, CSR col-major.
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zmtrisolve_batched_gpu ( magma_uplo_t  uplotype,
magma_trans_t  transtype,
magma_diag_t  diagtype,
magma_z_matrix  L,
magma_z_matrix  LC,
magma_index_t *  sizes,
magma_index_t *  locations,
magmaDoubleComplex *  trisystems,
magmaDoubleComplex *  rhs,
magma_queue_t  queue 
)

Does all triangular solves.

Parameters
[in]uplotypemagma_uplo_t lower or upper triangular
[in]transtypemagma_trans_t possibility for transposed matrix
[in]diagtypemagma_diag_t unit diagonal or not
[in]Lmagma_z_matrix Matrix in CSR format
[in]LCmagma_z_matrix same matrix, also CSR, but col-major
[out]sizesmagma_int_t* Number of Elements that are replaced.
[out]locationsmagma_int_t* Array indicating the locations.
[out]trisystemsmagmaDoubleComplex* trisystems
[out]rhsmagmaDoubleComplex* right-hand sides
[in]queuemagma_queue_t Queue to execute in.
void magmablas_zlag2c_sparse ( magma_int_t  M,
magma_int_t  N,
const magmaDoubleComplex_ptr  A,
magma_int_t  lda,
magmaFloatComplex *  SA,
magma_int_t  ldsa,
magma_queue_t  queue,
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).
[in,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).
[in]queuemagma_queue_t Queue to execute in.
[in,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 magma_zlobpcg_res ( magma_int_t  num_rows,
magma_int_t  num_vecs,
magmaDouble_ptr  evalues,
magmaDoubleComplex_ptr  X,
magmaDoubleComplex_ptr  R,
magmaDouble_ptr  res,
magma_queue_t  queue 
)

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
[in]num_rowsmagma_int_t number of rows
[in]num_vecsmagma_int_t number of vectors
[in]evaluesmagmaDouble_ptr array of eigenvalues/approximations
[in]XmagmaDoubleComplex_ptr block of eigenvector approximations
[in]RmagmaDoubleComplex_ptr block of residuals
[in]resmagmaDouble_ptr array of residuals
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zlobpcg_shift ( magma_int_t  num_rows,
magma_int_t  num_vecs,
magma_int_t  shift,
magmaDoubleComplex_ptr  x,
magma_queue_t  queue 
)

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
[in]num_rowsmagma_int_t number of rows
[in]num_vecsmagma_int_t number of vectors
[in]shiftmagma_int_t shift number
[in,out]xmagmaDoubleComplex_ptr input/output vector x
[in]queuemagma_queue_t Queue to execute in.
magma_int_t magma_zcopyscale ( magma_int_t  n,
magma_int_t  k,
magmaDoubleComplex_ptr  r,
magmaDoubleComplex_ptr  v,
magmaDoubleComplex_ptr  skp,
magma_queue_t  queue 
)

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
[in]nint length of v_i
[in]kint

skp entries v_i^T * r ( without r )

Parameters
[in]rmagmaDoubleComplex_ptr vector of length n
[in]vmagmaDoubleComplex_ptr vector of length n
[in]skpmagmaDoubleComplex_ptr array of parameters
[in]queuemagma_queue_t Queue to execute in.