![]() |
MAGMA
2.2.0
Matrix Algebra for GPU and Multicore Architectures
|
Functions | |
magma_int_t | magma_dresidual (magma_d_matrix A, magma_d_matrix b, magma_d_matrix x, double *res, magma_queue_t queue) |
Computes the residual ||b-Ax|| for a solution approximation x. More... | |
magma_int_t | magma_dresidual_slice (magma_int_t start, magma_int_t end, magma_d_matrix A, magma_d_matrix b, magma_d_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_dresidualvec (magma_d_matrix A, magma_d_matrix b, magma_d_matrix x, magma_d_matrix *r, double *res, magma_queue_t queue) |
Computes the residual r = b-Ax for a solution approximation x. More... | |
magma_int_t | magma_d_precond (magma_d_matrix A, magma_d_matrix b, magma_d_matrix *x, magma_d_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_d_precondsetup (magma_d_matrix A, magma_d_matrix b, magma_d_solver_par *solver, magma_d_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_d_applyprecond (magma_d_matrix A, magma_d_matrix b, magma_d_matrix *x, magma_d_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_d_applyprecond_left (magma_trans_t trans, magma_d_matrix A, magma_d_matrix b, magma_d_matrix *x, magma_d_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_d_applyprecond_right (magma_trans_t trans, magma_d_matrix A, magma_d_matrix b, magma_d_matrix *x, magma_d_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_d_solver (magma_d_matrix A, magma_d_matrix b, magma_d_matrix *x, magma_dopts *zopts, magma_queue_t queue) |
Allows the user to choose a solver. More... | |
magma_int_t | magma_dapplycustomprecond_l (magma_d_matrix b, magma_d_matrix *x, magma_d_preconditioner *precond, magma_queue_t queue) |
This is an interface to the left solve for any custom preconditioner. More... | |
magma_int_t | magma_dapplycustomprecond_r (magma_d_matrix b, magma_d_matrix *x, magma_d_preconditioner *precond, magma_queue_t queue) |
This is an interface to the right solve for any custom preconditioner. More... | |
magma_int_t | magma_dcsrsplit (magma_int_t offset, magma_int_t bsize, magma_d_matrix A, magma_d_matrix *D, magma_d_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_ddomainoverlap (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_dmfree (magma_d_matrix *A, magma_queue_t queue) |
Free the memory of a magma_d_matrix. More... | |
magma_int_t | magma_dmprepare_batched (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_d_matrix L, magma_d_matrix LC, magma_index_t *sizes, magma_index_t *locations, double *trisystems, double *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_dmtrisolve_batched (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_d_matrix L, magma_d_matrix LC, magma_index_t *sizes, magma_index_t *locations, double *trisystems, double *rhs, magma_queue_t queue) |
Does all triangular solves. More... | |
magma_int_t | magma_dmbackinsert_batched (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_d_matrix *M, magma_index_t *sizes, magma_index_t *locations, double *trisystems, double *rhs, magma_queue_t queue) |
Inserts the values into the preconditioner matrix. More... | |
magma_int_t | magma_dmiluspai_sizecheck (magma_d_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_dmisai_blockstruct (magma_int_t n, magma_int_t bs, magma_int_t offs, magma_uplo_t uplotype, magma_d_matrix *A, magma_queue_t queue) |
Generates a block-diagonal sparsity pattern with block-size bs. More... | |
magma_int_t | magma_drowentries (magma_d_matrix *A, magma_queue_t queue) |
Checks the maximal number of nonzeros in a row of matrix A. More... | |
magma_int_t | magma_ddiameter (magma_d_matrix *A, magma_queue_t queue) |
Computes the diameter of a sparse matrix and stores the value in diameter. More... | |
magma_int_t | magma_d_csr_compressor (double **val, magma_index_t **row, magma_index_t **col, double **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_dmconvert (magma_d_matrix A, magma_d_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_dmcsrcompressor (magma_d_matrix *A, magma_queue_t queue) |
Removes zeros in a CSR matrix. More... | |
magma_int_t | magma_dcsrset (magma_int_t m, magma_int_t n, magma_index_t *row, magma_index_t *col, double *val, magma_d_matrix *A, magma_queue_t queue) |
Passes a CSR matrix to MAGMA. More... | |
magma_int_t | magma_dcsrget (magma_d_matrix A, magma_int_t *m, magma_int_t *n, magma_index_t **row, magma_index_t **col, double **val, magma_queue_t queue) |
Passes a MAGMA matrix to CSR structure. More... | |
magma_int_t | magma_dcsrset_gpu (magma_int_t m, magma_int_t n, magmaIndex_ptr row, magmaIndex_ptr col, magmaDouble_ptr val, magma_d_matrix *A, magma_queue_t queue) |
Passes a CSR matrix to MAGMA (located on DEV). More... | |
magma_int_t | magma_dcsrget_gpu (magma_d_matrix A, magma_int_t *m, magma_int_t *n, magmaIndex_ptr *row, magmaIndex_ptr *col, magmaDouble_ptr *val, magma_queue_t queue) |
Passes a MAGMA matrix to CSR structure (located on DEV). More... | |
magma_int_t | magma_dmdiff (magma_d_matrix A, magma_d_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_dmgenerator (magma_int_t n, magma_int_t offdiags, magma_index_t *diag_offset, double *diag_vals, magma_d_matrix *A, magma_queue_t queue) |
Generate a symmetric n x n CSR matrix for a stencil. More... | |
magma_int_t | magma_dm_27stencil (magma_int_t n, magma_d_matrix *A, magma_queue_t queue) |
Generate a 27-point stencil for a 3D FD discretization. More... | |
magma_int_t | magma_dm_5stencil (magma_int_t n, magma_d_matrix *A, magma_queue_t queue) |
Generate a 5-point stencil for a 2D FD discretization. More... | |
magma_int_t | magma_dsymbilu (magma_d_matrix *A, magma_int_t levels, magma_d_matrix *L, magma_d_matrix *U, magma_queue_t queue) |
This routine performs a symbolic ILU factorization. More... | |
magma_int_t | read_d_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, double **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_dwrite_csr_mtx (magma_d_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_dprint_csr_mtx (magma_int_t n_row, magma_int_t n_col, magma_int_t nnz, double **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_dprint_csr (magma_int_t n_row, magma_int_t n_col, magma_int_t nnz, double **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_dprint_matrix (magma_d_matrix A, magma_queue_t queue) |
Prints a sparse matrix in CSR format. More... | |
magma_int_t | magma_d_csr_mtx (magma_d_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_d_csr_mtxsymm (magma_d_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_dmlumerge (magma_d_matrix L, magma_d_matrix U, magma_d_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_dmscale (magma_d_matrix *A, magma_scale_t scaling, magma_queue_t queue) |
Scales a matrix. More... | |
magma_int_t | magma_dmdiagadd (magma_d_matrix *A, double add, magma_queue_t queue) |
Adds a multiple of the Identity matrix to a matrix: A = A+add * I. More... | |
magma_int_t | magma_dmshrink (magma_d_matrix A, magma_d_matrix *B, magma_queue_t queue) |
Shrinks a non-square matrix (m < n) to the smaller dimension. More... | |
magma_int_t | magma_dmslice (magma_int_t num_slices, magma_int_t slice, magma_d_matrix A, magma_d_matrix *B, magma_d_matrix *ALOC, magma_d_matrix *ANLOC, magma_index_t *comm_i, double *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_dmsupernodal (magma_int_t *max_bs, magma_d_matrix A, magma_d_matrix *S, magma_queue_t queue) |
Generates a block-diagonal sparsity pattern with block-size bs. More... | |
magma_int_t | magma_dmvarsizeblockstruct (magma_int_t n, magma_int_t *bs, magma_int_t bsl, magma_uplo_t uplotype, magma_d_matrix *A, magma_queue_t queue) |
Generates a block-diagonal sparsity pattern with variable block-size. More... | |
magma_int_t | magma_dmtransfer (magma_d_matrix A, magma_d_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 | d_transpose_csr (magma_int_t n_rows, magma_int_t n_cols, magma_int_t nnz, double *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, double **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_dmtranspose (magma_d_matrix A, magma_d_matrix *B, magma_queue_t queue) |
Interface to cuSPARSE transpose. More... | |
magma_int_t | magma_d_cucsrtranspose (magma_d_matrix A, magma_d_matrix *B, magma_queue_t queue) |
Helper function to transpose CSR matrix. More... | |
magma_int_t | magma_dmtransposeconjugate (magma_d_matrix A, magma_d_matrix *B, magma_queue_t queue) |
This function forms the transpose conjugate of a matrix. More... | |
magma_int_t | magma_dfrobenius (magma_d_matrix A, magma_d_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_dnonlinres (magma_d_matrix A, magma_d_matrix L, magma_d_matrix U, magma_d_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_dilures (magma_d_matrix A, magma_d_matrix L, magma_d_matrix U, magma_d_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_dicres (magma_d_matrix A, magma_d_matrix C, magma_d_matrix CT, magma_d_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_dinitguess (magma_d_matrix A, magma_d_matrix *L, magma_d_matrix *U, magma_queue_t queue) |
Computes an initial guess for the ParILU/ParIC. More... | |
magma_int_t | magma_dinitrecursiveLU (magma_d_matrix A, magma_d_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_dmLdiagadd (magma_d_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_dsolverinfo (magma_d_solver_par *solver_par, magma_d_preconditioner *precond_par, magma_queue_t queue) |
Prints information about a previously called solver. More... | |
magma_int_t | magma_dsolverinfo_free (magma_d_solver_par *solver_par, magma_d_preconditioner *precond_par, magma_queue_t queue) |
Frees any memory assocoiated with the verbose mode of solver_par. More... | |
magma_int_t | magma_dsolverinfo_init (magma_d_solver_par *solver_par, magma_d_preconditioner *precond_par, magma_queue_t queue) |
Initializes all solver and preconditioner parameters. More... | |
magma_int_t | magma_deigensolverinfo_init (magma_d_solver_par *solver_par, magma_queue_t queue) |
Initializes space for eigensolvers. More... | |
magma_int_t | magma_dsort (double *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_dmsort (double *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_dindexsort (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_dindexsortval (magma_index_t *x, double *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_dmorderstatistics (double *val, magma_index_t *col, magma_index_t *row, magma_int_t length, magma_int_t k, magma_int_t r, double *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_dorderstatistics (double *val, magma_int_t length, magma_int_t k, magma_int_t r, double *element, magma_queue_t queue) |
Identifies the kth smallest/largest element in an array. More... | |
magma_int_t | magma_dparse_opts (int argc, char **argv, magma_dopts *opts, int *matrices, magma_queue_t queue) |
Parses input options for a solver. More... | |
magma_int_t | magma_dvinit (magma_d_matrix *x, magma_location_t mem_loc, magma_int_t num_rows, magma_int_t num_cols, double values, magma_queue_t queue) |
Allocates memory for magma_d_matrix and initializes it with the passed value. More... | |
magma_int_t | magma_dprint_vector (magma_d_matrix x, magma_int_t offset, magma_int_t visulen, magma_queue_t queue) |
Visualizes part of a vector of type magma_d_matrix. More... | |
magma_int_t | magma_dvread (magma_d_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_dvspread (magma_d_matrix *x, const char *filename, magma_queue_t queue) |
Reads in a sparse vector-block stored in COO format. More... | |
magma_int_t | magma_dwrite_vector (magma_d_matrix A, const char *filename, magma_queue_t queue) |
Writes a vector to a file. More... | |
magma_int_t | magma_dvset (magma_int_t m, magma_int_t n, double *val, magma_d_matrix *v, magma_queue_t queue) |
Passes a vector to MAGMA. More... | |
magma_int_t | magma_dvget (magma_d_matrix v, magma_int_t *m, magma_int_t *n, double **val, magma_queue_t queue) |
Passes a MAGMA vector back. More... | |
magma_int_t | magma_dvset_dev (magma_int_t m, magma_int_t n, magmaDouble_ptr val, magma_d_matrix *v, magma_queue_t queue) |
Passes a vector to MAGMA (located on DEV). More... | |
magma_int_t | magma_dvget_dev (magma_d_matrix v, magma_int_t *m, magma_int_t *n, magmaDouble_ptr *val, magma_queue_t queue) |
Passes a MAGMA vector back (located on DEV). More... | |
magma_int_t | magma_dvtranspose (magma_d_matrix x, magma_d_matrix *y, magma_queue_t queue) |
Transposes a vector from col to row major and vice versa. More... | |
magma_int_t | magma_dmisai_blockstruct_gpu (magma_int_t n, magma_int_t bs, magma_int_t offs, magma_uplo_t uplotype, magma_d_matrix *A, magma_queue_t queue) |
Generates a block-diagonal sparsity pattern with block-size bs on the GPU. More... | |
magma_int_t | magma_dmbackinsert_batched_gpu (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_d_matrix *M, magma_index_t *sizes, magma_index_t *locations, double *trisystems, double *rhs, magma_queue_t queue) |
Inserts the values into the preconditioner matrix. More... | |
magma_int_t | magma_disaigenerator_16_gpu (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_d_matrix L, magma_d_matrix *M, magma_index_t *sizes, magma_index_t *locations, double *trisystems, double *rhs, magma_queue_t queue) |
This routine is designet to combine all kernels into one. More... | |
magma_int_t | magma_disaigenerator_32_gpu (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_d_matrix L, magma_d_matrix *M, magma_index_t *sizes, magma_index_t *locations, double *trisystems, double *rhs, magma_queue_t queue) |
This routine is designet to combine all kernels into one. More... | |
magma_int_t | magma_disaigenerator_8_gpu (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_d_matrix L, magma_d_matrix *M, magma_index_t *sizes, magma_index_t *locations, double *trisystems, double *rhs, magma_queue_t queue) |
This routine is designet to combine all kernels into one. More... | |
magma_int_t | magma_disai_generator_regs (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_d_matrix L, magma_d_matrix *M, magma_index_t *sizes, magma_index_t *locations, double *trisystems, double *rhs, magma_queue_t queue) |
This routine is designet to combine all kernels into one. More... | |
magma_int_t | magma_dgeisai_maxblock (magma_d_matrix L, magma_d_matrix *MT, magma_queue_t queue) |
This routine maximizes the pattern for the ISAI preconditioner. More... | |
magma_int_t | magma_dmtrisolve_batched_gpu (magma_uplo_t uplotype, magma_trans_t transtype, magma_diag_t diagtype, magma_d_matrix L, magma_d_matrix LC, magma_index_t *sizes, magma_index_t *locations, double *trisystems, double *rhs, magma_queue_t queue) |
Does all triangular solves. More... | |
magma_int_t | magma_dlobpcg_res (magma_int_t num_rows, magma_int_t num_vecs, magmaDouble_ptr evalues, magmaDouble_ptr X, magmaDouble_ptr R, magmaDouble_ptr res, magma_queue_t queue) |
This routine computes for Block-LOBPCG, the set of residuals. More... | |
magma_int_t | magma_dlobpcg_shift (magma_int_t num_rows, magma_int_t num_vecs, magma_int_t shift, magmaDouble_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_dcopyscale (magma_int_t n, magma_int_t k, magmaDouble_ptr r, magmaDouble_ptr v, magmaDouble_ptr skp, magma_queue_t queue) |
Computes the correction term of the pipelined GMRES according to P. More... | |
magma_int_t | magma_ddiagcheck (magma_d_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_dmconjugate (magma_d_matrix *A, magma_queue_t queue) |
This function conjugates a matrix. More... | |
magma_int_t | magma_dmcsrcompressor_gpu (magma_d_matrix *A, magma_queue_t queue) |
Removes zeros in a CSR matrix. More... | |
magma_int_t magma_dresidual | ( | magma_d_matrix | A, |
magma_d_matrix | b, | ||
magma_d_matrix | x, | ||
double * | res, | ||
magma_queue_t | queue | ||
) |
Computes the residual ||b-Ax|| for a solution approximation x.
[in] | A | magma_d_matrix input matrix A |
[in] | b | magma_d_matrix RHS b |
[in] | x | magma_d_matrix solution approximation |
[out] | res | double* return residual |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dresidual_slice | ( | magma_int_t | start, |
magma_int_t | end, | ||
magma_d_matrix | A, | ||
magma_d_matrix | b, | ||
magma_d_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.
[in] | start | magma_int_t start of slice (row-index) |
[in] | end | magma_int_t end of slice (row-index) |
[in] | A | magma_d_matrix input matrix A |
[in] | b | magma_d_matrix RHS b |
[in] | x | magma_d_matrix solution approximation |
[out] | res | double* return residual |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dresidualvec | ( | magma_d_matrix | A, |
magma_d_matrix | b, | ||
magma_d_matrix | x, | ||
magma_d_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
[in] | A | magma_d_matrix input matrix A |
[in] | b | magma_d_matrix RHS b |
[in] | x | magma_d_matrix solution approximation |
[in,out] | r | magma_d_matrix* residual vector |
[out] | res | double* return residual |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_d_precond | ( | magma_d_matrix | A, |
magma_d_matrix | b, | ||
magma_d_matrix * | x, | ||
magma_d_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.
[in] | A | magma_d_matrix sparse matrix A |
[in] | b | magma_d_matrix input vector b |
[in] | x | magma_d_matrix* output vector x |
[in,out] | precond | magma_d_preconditioner preconditioner |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_d_precondsetup | ( | magma_d_matrix | A, |
magma_d_matrix | b, | ||
magma_d_solver_par * | solver, | ||
magma_d_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.
[in] | A | magma_d_matrix sparse matrix M |
[in] | b | magma_d_matrix input vector y |
[in] | solver | magma_d_solver_par solver structure using the preconditioner |
[in,out] | precond | magma_d_preconditioner preconditioner |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_d_applyprecond | ( | magma_d_matrix | A, |
magma_d_matrix | b, | ||
magma_d_matrix * | x, | ||
magma_d_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.
[in] | A | magma_d_matrix sparse matrix A |
[in] | b | magma_d_matrix input vector b |
[in,out] | x | magma_d_matrix* output vector x |
[in] | precond | magma_d_preconditioner preconditioner |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_d_applyprecond_left | ( | magma_trans_t | trans, |
magma_d_matrix | A, | ||
magma_d_matrix | b, | ||
magma_d_matrix * | x, | ||
magma_d_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.
[in] | trans | magma_trans_t mode of the preconditioner: MagmaTrans or MagmaNoTrans |
[in] | A | magma_d_matrix sparse matrix A |
[in] | b | magma_d_matrix input vector b |
[in,out] | x | magma_d_matrix* output vector x |
[in] | precond | magma_d_preconditioner preconditioner |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_d_applyprecond_right | ( | magma_trans_t | trans, |
magma_d_matrix | A, | ||
magma_d_matrix | b, | ||
magma_d_matrix * | x, | ||
magma_d_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.
[in] | trans | magma_trans_t mode of the preconditioner: MagmaTrans or MagmaNoTrans |
[in] | A | magma_d_matrix sparse matrix A |
[in] | b | magma_d_matrix input vector b |
[in,out] | x | magma_d_matrix* output vector x |
[in] | precond | magma_d_preconditioner preconditioner |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_d_solver | ( | magma_d_matrix | A, |
magma_d_matrix | b, | ||
magma_d_matrix * | x, | ||
magma_dopts * | zopts, | ||
magma_queue_t | queue | ||
) |
Allows the user to choose a solver.
[in] | A | magma_d_matrix sparse matrix A |
[in] | b | magma_d_matrix input vector b |
[in] | x | magma_d_matrix* output vector x |
[in] | zopts | magma_dopts options for solver and preconditioner |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dapplycustomprecond_l | ( | magma_d_matrix | b, |
magma_d_matrix * | x, | ||
magma_d_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.
[in] | b | magma_d_matrix RHS |
[in,out] | x | magma_d_matrix* vector to precondition |
[in,out] | precond | magma_d_preconditioner* preconditioner parameters |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dapplycustomprecond_r | ( | magma_d_matrix | b, |
magma_d_matrix * | x, | ||
magma_d_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.
[in] | b | magma_d_matrix RHS |
[in,out] | x | magma_d_matrix* vector to precondition |
[in,out] | precond | magma_d_preconditioner* preconditioner parameters |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dcsrsplit | ( | magma_int_t | offset, |
magma_int_t | bsize, | ||
magma_d_matrix | A, | ||
magma_d_matrix * | D, | ||
magma_d_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.
[in] | offset | magma_int_t size of the first block |
[in] | bsize | magma_int_t size of the diagonal blocks |
[in] | A | magma_d_matrix CSR input matrix |
[out] | D | magma_d_matrix* CSR matrix containing diagonal blocks |
[out] | R | magma_d_matrix* CSR matrix containing rest |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_ddomainoverlap | ( | 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.
[in] | x | magma_index_t* array to sort |
[in] | num_rows | magma_int_t number of rows in matrix |
[out] | num_indices | magma_int_t* number of indices in array |
[in] | rowptr | magma_index_t* rowpointer of matrix |
[in] | colidx | magma_index_t* colindices of matrix |
[in] | x | magma_index_t* array containing indices for domain overlap |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmfree | ( | magma_d_matrix * | A, |
magma_queue_t | queue | ||
) |
Free the memory of a magma_d_matrix.
[in,out] | A | magma_d_matrix* matrix to free |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmprepare_batched | ( | magma_uplo_t | uplotype, |
magma_trans_t | transtype, | ||
magma_diag_t | diagtype, | ||
magma_d_matrix | L, | ||
magma_d_matrix | LC, | ||
magma_index_t * | sizes, | ||
magma_index_t * | locations, | ||
double * | trisystems, | ||
double * | 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.
[in] | uplotype | magma_uplo_t lower or upper triangular |
[in] | transtype | magma_trans_t possibility for transposed matrix |
[in] | diagtype | magma_diag_t unit diagonal or not |
[in] | L | magma_d_matrix Matrix in CSR format |
[in] | LC | magma_d_matrix same matrix, also CSR, but col-major |
[in,out] | sizes | magma_int_t* Number of Elements that are replaced. |
[in,out] | locations | magma_int_t* Array indicating the locations. |
[in,out] | trisystems | double* trisystems |
[in,out] | rhs | double* right-hand sides |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmtrisolve_batched | ( | magma_uplo_t | uplotype, |
magma_trans_t | transtype, | ||
magma_diag_t | diagtype, | ||
magma_d_matrix | L, | ||
magma_d_matrix | LC, | ||
magma_index_t * | sizes, | ||
magma_index_t * | locations, | ||
double * | trisystems, | ||
double * | rhs, | ||
magma_queue_t | queue | ||
) |
Does all triangular solves.
[in] | uplotype | magma_uplo_t lower or upper triangular |
[in] | transtype | magma_trans_t possibility for transposed matrix |
[in] | diagtype | magma_diag_t unit diagonal or not |
[in] | L | magma_d_matrix Matrix in CSR format |
[in] | LC | magma_d_matrix same matrix, also CSR, but col-major |
[out] | sizes | magma_int_t* Number of Elements that are replaced. |
[out] | locations | magma_int_t* Array indicating the locations. |
[out] | trisystems | double* trisystems |
[out] | rhs | double* right-hand sides |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmbackinsert_batched | ( | magma_uplo_t | uplotype, |
magma_trans_t | transtype, | ||
magma_diag_t | diagtype, | ||
magma_d_matrix * | M, | ||
magma_index_t * | sizes, | ||
magma_index_t * | locations, | ||
double * | trisystems, | ||
double * | rhs, | ||
magma_queue_t | queue | ||
) |
Inserts the values into the preconditioner matrix.
[in] | uplotype | magma_uplo_t lower or upper triangular |
[in] | transtype | magma_trans_t possibility for transposed matrix |
[in] | diagtype | magma_diag_t unit diagonal or not |
[in,out] | M | magma_d_matrix* SPAI preconditioner CSR col-major |
[out] | sizes | magma_int_t* Number of Elements that are replaced. |
[out] | locations | magma_int_t* Array indicating the locations. |
[out] | trisystems | double* trisystems |
[out] | rhs | double* right-hand sides |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmiluspai_sizecheck | ( | magma_d_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.
[in] | A | magma_d_matrix system matrix |
[in] | batchsize | magma_int_t Size of the batch (GPU thread block). |
[out] | maxsize | magma_int_t* maximum A(:,i) and A(i,:). |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmisai_blockstruct | ( | magma_int_t | n, |
magma_int_t | bs, | ||
magma_int_t | offs, | ||
magma_uplo_t | uplotype, | ||
magma_d_matrix * | A, | ||
magma_queue_t | queue | ||
) |
Generates a block-diagonal sparsity pattern with block-size bs.
[in] | n | magma_int_t Size of the matrix. |
[in] | bs | magma_int_t Size of the diagonal blocks. |
[in] | offs | magma_int_t Size of the first diagonal block. |
[in] | uplotype | magma_uplo_t lower or upper triangular |
[in,out] | A | magma_d_matrix* Generated sparsity pattern matrix. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_drowentries | ( | magma_d_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.
[in,out] | A | magma_d_matrix* sparse matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_ddiameter | ( | magma_d_matrix * | A, |
magma_queue_t | queue | ||
) |
Computes the diameter of a sparse matrix and stores the value in diameter.
[in,out] | A | magma_d_matrix* sparse matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_d_csr_compressor | ( | double ** | val, |
magma_index_t ** | row, | ||
magma_index_t ** | col, | ||
double ** | 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.
[in] | val | double** input val pointer to compress |
[in] | row | magma_int_t** input row pointer to modify |
[in] | col | magma_int_t** input col pointer to compress |
[in] | valn | double** output val pointer |
[out] | rown | magma_int_t** output row pointer |
[out] | coln | magma_int_t** output col pointer |
[out] | n | magma_int_t* number of rows in matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmconvert | ( | magma_d_matrix | A, |
magma_d_matrix * | B, | ||
magma_storage_t | old_format, | ||
magma_storage_t | new_format, | ||
magma_queue_t | queue | ||
) |
Converter between different sparse storage formats.
[in] | A | magma_d_matrix sparse matrix A |
[out] | B | magma_d_matrix* copy of A in new format |
[in] | old_format | magma_storage_t original storage format |
[in] | new_format | magma_storage_t new storage format |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmcsrcompressor | ( | magma_d_matrix * | A, |
magma_queue_t | queue | ||
) |
Removes zeros in a CSR matrix.
[in,out] | A | magma_d_matrix* input/output matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dcsrset | ( | magma_int_t | m, |
magma_int_t | n, | ||
magma_index_t * | row, | ||
magma_index_t * | col, | ||
double * | val, | ||
magma_d_matrix * | A, | ||
magma_queue_t | queue | ||
) |
Passes a CSR matrix to MAGMA.
[in] | m | magma_int_t number of rows |
[in] | n | magma_int_t number of columns |
[in] | row | magma_index_t* row pointer |
[in] | col | magma_index_t* column indices |
[in] | val | double* array containing matrix entries |
[out] | A | magma_d_matrix* matrix in magma sparse matrix format |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dcsrget | ( | magma_d_matrix | A, |
magma_int_t * | m, | ||
magma_int_t * | n, | ||
magma_index_t ** | row, | ||
magma_index_t ** | col, | ||
double ** | val, | ||
magma_queue_t | queue | ||
) |
Passes a MAGMA matrix to CSR structure.
[in] | A | magma_d_matrix magma sparse matrix in CSR format |
[out] | m | magma_int_t number of rows |
[out] | n | magma_int_t number of columns |
[out] | row | magma_index_t* row pointer |
[out] | col | magma_index_t* column indices |
[out] | val | double* array containing matrix entries |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dcsrset_gpu | ( | magma_int_t | m, |
magma_int_t | n, | ||
magmaIndex_ptr | row, | ||
magmaIndex_ptr | col, | ||
magmaDouble_ptr | val, | ||
magma_d_matrix * | A, | ||
magma_queue_t | queue | ||
) |
Passes a CSR matrix to MAGMA (located on DEV).
[in] | m | magma_int_t number of rows |
[in] | n | magma_int_t number of columns |
[in] | row | magmaIndex_ptr row pointer |
[in] | col | magmaIndex_ptr column indices |
[in] | val | magmaDouble_ptr array containing matrix entries |
[out] | A | magma_d_matrix* matrix in magma sparse matrix format |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dcsrget_gpu | ( | magma_d_matrix | A, |
magma_int_t * | m, | ||
magma_int_t * | n, | ||
magmaIndex_ptr * | row, | ||
magmaIndex_ptr * | col, | ||
magmaDouble_ptr * | val, | ||
magma_queue_t | queue | ||
) |
Passes a MAGMA matrix to CSR structure (located on DEV).
[in] | A | magma_d_matrix magma sparse matrix in CSR format |
[out] | m | magma_int_t number of rows |
[out] | n | magma_int_t number of columns |
[out] | row | magmaIndex_ptr row pointer |
[out] | col | magmaIndex_ptr column indices |
[out] | val | magmaDouble_ptr array containing matrix entries |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmdiff | ( | magma_d_matrix | A, |
magma_d_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 )
[in] | A | magma_d_matrix sparse matrix in CSR |
[in] | B | magma_d_matrix sparse matrix in CSR |
[out] | res | real_Double_t* residual |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmgenerator | ( | magma_int_t | n, |
magma_int_t | offdiags, | ||
magma_index_t * | diag_offset, | ||
double * | diag_vals, | ||
magma_d_matrix * | A, | ||
magma_queue_t | queue | ||
) |
Generate a symmetric n x n CSR matrix for a stencil.
[in] | n | magma_int_t number of rows |
[in] | offdiags | magma_int_t number of offdiagonals |
[in] | diag_offset | magma_int_t* array containing the offsets (length offsets+1) |
[in] | diag_vals | double* array containing the values (length offsets+1) |
[out] | A | magma_d_matrix* matrix to generate |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dm_27stencil | ( | magma_int_t | n, |
magma_d_matrix * | A, | ||
magma_queue_t | queue | ||
) |
Generate a 27-point stencil for a 3D FD discretization.
[in] | n | magma_int_t number of rows |
[out] | A | magma_d_matrix* matrix to generate |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dm_5stencil | ( | magma_int_t | n, |
magma_d_matrix * | A, | ||
magma_queue_t | queue | ||
) |
Generate a 5-point stencil for a 2D FD discretization.
[in] | n | magma_int_t number of rows |
[out] | A | magma_d_matrix* matrix to generate |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dsymbilu | ( | magma_d_matrix * | A, |
magma_int_t | levels, | ||
magma_d_matrix * | L, | ||
magma_d_matrix * | U, | ||
magma_queue_t | queue | ||
) |
This routine performs a symbolic ILU factorization.
The algorithm is taken from an implementation written by Edmond Chow.
[in,out] | A | magma_d_matrix* matrix in magma sparse matrix format containing the original matrix on input, and L,U on output |
[in] | levels | magma_magma_int_t_t fill in level |
[out] | L | magma_d_matrix* output lower triangular matrix in magma sparse matrix format empty on function call |
[out] | U | magma_d_matrix* output upper triangular matrix in magma sparse matrix format empty on function call |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t read_d_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, | ||
double ** | 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.
[out] | type | magma_storage_t* storage type of matrix |
[out] | location | magma_location_t* location of matrix |
[out] | n_row | magma_int_t* number of rows in matrix |
[out] | n_col | magma_int_t* number of columns in matrix |
[out] | nnz | magma_int_t* number of nonzeros in matrix |
[out] | val | double** value array of CSR output |
[out] | row | magma_index_t** row pointer of CSR output |
[out] | col | magma_index_t** column indices of CSR output |
[in] | filename | const char* filname of the mtx matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dwrite_csr_mtx | ( | magma_d_matrix | A, |
magma_order_t | MajorType, | ||
const char * | filename, | ||
magma_queue_t | queue | ||
) |
Writes a CSR matrix to a file using Matrix Market format.
[in] | A | magma_d_matrix matrix to write out |
[in] | MajorType | magma_index_t Row or Column sort default: 0 = RowMajor, 1 = ColMajor TODO: use named constants (e.g., MagmaRowMajor), not numbers. |
[in] | filename | const char* output-filname of the mtx matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dprint_csr_mtx | ( | magma_int_t | n_row, |
magma_int_t | n_col, | ||
magma_int_t | nnz, | ||
double ** | 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.
[in] | n_row | magma_int_t* number of rows in matrix |
[in] | n_col | magma_int_t* number of columns in matrix |
[in] | nnz | magma_int_t* number of nonzeros in matrix |
[in] | val | double** value array of CSR |
[in] | row | magma_index_t** row pointer of CSR |
[in] | col | magma_index_t** column indices of CSR |
[in] | MajorType | magma_index_t Row or Column sort default: 0 = RowMajor, 1 = ColMajor |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dprint_csr | ( | magma_int_t | n_row, |
magma_int_t | n_col, | ||
magma_int_t | nnz, | ||
double ** | val, | ||
magma_index_t ** | row, | ||
magma_index_t ** | col, | ||
magma_queue_t | queue | ||
) |
Prints a CSR matrix in CSR format.
[in] | n_row | magma_int_t* number of rows in matrix |
[in] | n_col | magma_int_t* number of columns in matrix |
[in] | nnz | magma_int_t* number of nonzeros in matrix |
[in] | val | double** value array of CSR |
[in] | row | magma_index_t** row pointer of CSR |
[in] | col | magma_index_t** column indices of CSR |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dprint_matrix | ( | magma_d_matrix | A, |
magma_queue_t | queue | ||
) |
Prints a sparse matrix in CSR format.
[in] | A | magma_d_matrix sparse matrix in Magma_CSR format |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_d_csr_mtx | ( | magma_d_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.
[out] | A | magma_d_matrix* matrix in magma sparse matrix format |
[in] | filename | const char* filname of the mtx matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_d_csr_mtxsymm | ( | magma_d_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!
[out] | A | magma_d_matrix* matrix in magma sparse matrix format |
[in] | filename | const char* filname of the mtx matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmlumerge | ( | magma_d_matrix | L, |
magma_d_matrix | U, | ||
magma_d_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.
[in] | L | magma_d_matrix input strictly lower triangular matrix L |
[in] | U | magma_d_matrix input upper triangular matrix U |
[out] | A | magma_d_matrix* output matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmscale | ( | magma_d_matrix * | A, |
magma_scale_t | scaling, | ||
magma_queue_t | queue | ||
) |
Scales a matrix.
[in,out] | A | magma_d_matrix* input/output matrix |
[in] | scaling | magma_scale_t scaling type (unit rownorm / unit diagonal) |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmdiagadd | ( | magma_d_matrix * | A, |
double | add, | ||
magma_queue_t | queue | ||
) |
Adds a multiple of the Identity matrix to a matrix: A = A+add * I.
[in,out] | A | magma_d_matrix* input/output matrix |
[in] | add | double scaling for the identity matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmshrink | ( | magma_d_matrix | A, |
magma_d_matrix * | B, | ||
magma_queue_t | queue | ||
) |
Shrinks a non-square matrix (m < n) to the smaller dimension.
[in] | A | magma_d_matrix sparse matrix A |
[out] | B | magma_d_matrix* sparse matrix A |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmslice | ( | magma_int_t | num_slices, |
magma_int_t | slice, | ||
magma_d_matrix | A, | ||
magma_d_matrix * | B, | ||
magma_d_matrix * | ALOC, | ||
magma_d_matrix * | ANLOC, | ||
magma_index_t * | comm_i, | ||
double * | 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.
[in] | num_slices | magma_int_t number of slices |
[in] | slice | magma_int_t slice id (0.. num_slices-1) |
[in] | A | magma_d_matrix sparse matrix in CSR |
[out] | B | magma_d_matrix* sparse matrix in CSR |
[out] | ALOC | magma_d_matrix* sparse matrix in CSR |
[out] | ANLOC | magma_d_matrix* sparse matrix in CSR |
[in,out] | comm_i | magma_int_t* communication plan |
[in,out] | comm_v | double* communication plan |
[in] | queue | magma_queue_t Queue to execute in. |
[out] | start | magma_int_t* start of slice (row-index) |
[out] | end | magma_int_t* end of slice (row-index) |
magma_int_t magma_dmsupernodal | ( | magma_int_t * | max_bs, |
magma_d_matrix | A, | ||
magma_d_matrix * | S, | ||
magma_queue_t | queue | ||
) |
Generates a block-diagonal sparsity pattern with block-size bs.
[in,out] | max_bs | magma_int_t* Size of the largest diagonal block. |
[in] | A | magma_d_matrix System matrix. |
[in,out] | S | magma_d_matrix* Generated sparsity pattern matrix. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmvarsizeblockstruct | ( | magma_int_t | n, |
magma_int_t * | bs, | ||
magma_int_t | bsl, | ||
magma_uplo_t | uplotype, | ||
magma_d_matrix * | A, | ||
magma_queue_t | queue | ||
) |
Generates a block-diagonal sparsity pattern with variable block-size.
[in] | n | magma_int_t Size of the matrix. |
[in] | bs | magma_int_t* Vector containing the size of the diagonal blocks. |
[in] | bsl | magma_int_t Size of the vector containing the block sizes. |
[in] | uplotype | magma_uplo_t lower or upper triangular |
[in,out] | A | magma_d_matrix* Generated sparsity pattern matrix. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmtransfer | ( | magma_d_matrix | A, |
magma_d_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.
[in] | A | magma_d_matrix sparse matrix A |
[out] | B | magma_d_matrix* copy of A |
[in] | src | magma_location_t original location A |
[in] | dst | magma_location_t location of the copy of A |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t d_transpose_csr | ( | magma_int_t | n_rows, |
magma_int_t | n_cols, | ||
magma_int_t | nnz, | ||
double * | 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, | ||
double ** | 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.
[in] | n_rows | magma_int_t number of rows in input matrix |
[in] | n_cols | magma_int_t number of columns in input matrix |
[in] | nnz | magma_int_t number of nonzeros in input matrix |
[in] | values | double* value array of input matrix |
[in] | rowptr | magma_index_t* row pointer of input matrix |
[in] | colind | magma_index_t* column indices of input matrix |
[in] | new_n_rows | magma_index_t* number of rows in transposed matrix |
[in] | new_n_cols | magma_index_t* number of columns in transposed matrix |
[in] | new_nnz | magma_index_t* number of nonzeros in transposed matrix |
[in] | new_values | double** value array of transposed matrix |
[in] | new_rowptr | magma_index_t** row pointer of transposed matrix |
[in] | new_colind | magma_index_t** column indices of transposed matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmtranspose | ( | magma_d_matrix | A, |
magma_d_matrix * | B, | ||
magma_queue_t | queue | ||
) |
Interface to cuSPARSE transpose.
[in] | A | magma_d_matrix input matrix (CSR) |
[out] | B | magma_d_matrix* output matrix (CSR) |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_d_cucsrtranspose | ( | magma_d_matrix | A, |
magma_d_matrix * | B, | ||
magma_queue_t | queue | ||
) |
Helper function to transpose CSR matrix.
Using the CUSPARSE CSR2CSC function.
[in] | A | magma_d_matrix input matrix (CSR) |
[out] | B | magma_d_matrix* output matrix (CSR) |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmtransposeconjugate | ( | magma_d_matrix | A, |
magma_d_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.
[in] | A | magma_d_matrix input matrix (CSR) |
[out] | B | magma_d_matrix* output matrix (CSR) |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dfrobenius | ( | magma_d_matrix | A, |
magma_d_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!
[in] | A | magma_d_matrix sparse matrix in CSR |
[in] | B | magma_d_matrix sparse matrix in CSR |
[out] | res | real_Double_t* Frobenius norm of difference |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dnonlinres | ( | magma_d_matrix | A, |
magma_d_matrix | L, | ||
magma_d_matrix | U, | ||
magma_d_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.
[in] | A | magma_d_matrix input sparse matrix in CSR |
[in] | L | magma_d_matrix input sparse matrix in CSR |
[in] | U | magma_d_matrix input sparse matrix in CSR |
[out] | LU | magma_d_matrix* output sparse matrix in A-LU in CSR |
[out] | res | real_Double_t* Frobenius norm of difference |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dilures | ( | magma_d_matrix | A, |
magma_d_matrix | L, | ||
magma_d_matrix | U, | ||
magma_d_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.
[in] | A | magma_d_matrix input sparse matrix in CSR |
[in] | L | magma_d_matrix input sparse matrix in CSR |
[in] | U | magma_d_matrix input sparse matrix in CSR |
[out] | LU | magma_d_matrix* output sparse matrix in A-LU in CSR |
[out] | res | real_Double_t* Frobenius norm of difference |
[out] | nonlinres | real_Double_t* Frobenius norm of difference |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dicres | ( | magma_d_matrix | A, |
magma_d_matrix | C, | ||
magma_d_matrix | CT, | ||
magma_d_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.
[in] | A | magma_d_matrix input sparse matrix in CSR |
[in] | C | magma_d_matrix input sparse matrix in CSR |
[in] | CT | magma_d_matrix input sparse matrix in CSR |
[in] | LU | magma_d_matrix* output sparse matrix in A-LU in CSR |
[out] | res | real_Double_t* IC residual |
[out] | nonlinres | real_Double_t* nonlinear residual |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dinitguess | ( | magma_d_matrix | A, |
magma_d_matrix * | L, | ||
magma_d_matrix * | U, | ||
magma_queue_t | queue | ||
) |
Computes an initial guess for the ParILU/ParIC.
[in] | A | magma_d_matrix sparse matrix in CSR |
[out] | L | magma_d_matrix* sparse matrix in CSR |
[out] | U | magma_d_matrix* sparse matrix in CSR |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dinitrecursiveLU | ( | magma_d_matrix | A, |
magma_d_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.
[in] | A | magma_d_matrix* sparse matrix in CSR |
[out] | B | magma_d_matrix* sparse matrix in CSR |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmLdiagadd | ( | magma_d_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.
[in,out] | L | magma_d_matrix* sparse matrix in CSR |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dsolverinfo | ( | magma_d_solver_par * | solver_par, |
magma_d_preconditioner * | precond_par, | ||
magma_queue_t | queue | ||
) |
Prints information about a previously called solver.
[in] | solver_par | magma_d_solver_par* structure containing all solver information |
[in,out] | precond_par | magma_d_preconditioner* structure containing all preconditioner information |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dsolverinfo_free | ( | magma_d_solver_par * | solver_par, |
magma_d_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.
[in,out] | solver_par | magma_d_solver_par* structure containing all solver information |
[in,out] | precond_par | magma_d_preconditioner* structure containing all preconditioner information |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dsolverinfo_init | ( | magma_d_solver_par * | solver_par, |
magma_d_preconditioner * | precond_par, | ||
magma_queue_t | queue | ||
) |
Initializes all solver and preconditioner parameters.
[in,out] | solver_par | magma_d_solver_par* structure containing all solver information |
[in,out] | precond_par | magma_d_preconditioner* structure containing all preconditioner information |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_deigensolverinfo_init | ( | magma_d_solver_par * | solver_par, |
magma_queue_t | queue | ||
) |
Initializes space for eigensolvers.
[in,out] | solver_par | magma_d_solver_par* structure containing all solver information |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dsort | ( | double * | x, |
magma_int_t | first, | ||
magma_int_t | last, | ||
magma_queue_t | queue | ||
) |
Sorts an array of values in increasing order.
[in,out] | x | double* array to sort |
[in] | first | magma_int_t pointer to first element |
[in] | last | magma_int_t pointer to last element |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmsort | ( | double * | 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.
[in,out] | x | double* array to sort |
[in,out] | col | magma_index_t* Target array, will be modified during operation. |
[in,out] | row | magma_index_t* Target array, will be modified during operation. |
[in] | first | magma_int_t pointer to first element |
[in] | last | magma_int_t pointer to last element |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dindexsort | ( | magma_index_t * | x, |
magma_int_t | first, | ||
magma_int_t | last, | ||
magma_queue_t | queue | ||
) |
Sorts an array of integers in increasing order.
[in,out] | x | magma_index_t* array to sort |
[in] | first | magma_int_t pointer to first element |
[in] | last | magma_int_t pointer to last element |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dindexsortval | ( | magma_index_t * | x, |
double * | y, | ||
magma_int_t | first, | ||
magma_int_t | last, | ||
magma_queue_t | queue | ||
) |
Sorts an array of integers, updates a respective array of values.
[in,out] | x | magma_index_t* array to sort |
[in,out] | y | double* array to sort |
[in] | first | magma_int_t pointer to first element |
[in] | last | magma_int_t pointer to last element |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmorderstatistics | ( | double * | val, |
magma_index_t * | col, | ||
magma_index_t * | row, | ||
magma_int_t | length, | ||
magma_int_t | k, | ||
magma_int_t | r, | ||
double * | 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.
[in,out] | val | double* Target array, will be modified during operation. |
[in,out] | col | magma_index_t* Target array, will be modified during operation. |
[in,out] | row | magma_index_t* Target array, will be modified during operation. |
[in] | length | magma_int_t Length of the target array. |
[in] | k | magma_int_t Element to be identified (largest/smallest). |
[in] | r | magma_int_t rule how to sort: '1' -> largest, '0' -> smallest |
[out] | element | double* location of the respective element |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dorderstatistics | ( | double * | val, |
magma_int_t | length, | ||
magma_int_t | k, | ||
magma_int_t | r, | ||
double * | element, | ||
magma_queue_t | queue | ||
) |
Identifies the kth smallest/largest element in an array.
[in,out] | val | double* Target array, will be modified during operation. |
[in] | length | magma_int_t Length of the target array. |
[in] | k | magma_int_t Element to be identified (largest/smallest). |
[in] | r | magma_int_t rule how to sort: '1' -> largest, '0' -> smallest |
[out] | element | double* location of the respective element |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dparse_opts | ( | int | argc, |
char ** | argv, | ||
magma_dopts * | opts, | ||
int * | matrices, | ||
magma_queue_t | queue | ||
) |
Parses input options for a solver.
[in] | argc | int command line input |
[in] | argv | char** command line input |
[in,out] | opts | magma_dopts * magma solver options |
[out] | matrices | int counter how many linear systems to process |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dvinit | ( | magma_d_matrix * | x, |
magma_location_t | mem_loc, | ||
magma_int_t | num_rows, | ||
magma_int_t | num_cols, | ||
double | values, | ||
magma_queue_t | queue | ||
) |
Allocates memory for magma_d_matrix and initializes it with the passed value.
[out] | x | magma_d_matrix* vector to initialize |
[in] | mem_loc | magma_location_t memory for vector |
[in] | num_rows | magma_int_t desired length of vector |
[in] | num_cols | magma_int_t desired width of vector-block (columns of dense matrix) |
[in] | values | double entries in vector |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dprint_vector | ( | magma_d_matrix | x, |
magma_int_t | offset, | ||
magma_int_t | visulen, | ||
magma_queue_t | queue | ||
) |
Visualizes part of a vector of type magma_d_matrix.
With input vector x , offset, visulen, the entries offset - (offset + visulen) of x are visualized.
[in] | x | magma_d_matrix vector to visualize |
[in] | offset | magma_int_t start inex of visualization |
[in] | visulen | magma_int_t number of entries to visualize |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dvread | ( | magma_d_matrix * | x, |
magma_int_t | length, | ||
char * | filename, | ||
magma_queue_t | queue | ||
) |
Reads in a double vector of length "length".
[out] | x | magma_d_matrix * vector to read in |
[in] | length | magma_int_t length of vector |
[in] | filename | char* file where vector is stored |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dvspread | ( | magma_d_matrix * | x, |
const char * | filename, | ||
magma_queue_t | queue | ||
) |
Reads in a sparse vector-block stored in COO format.
[out] | x | magma_d_matrix * vector to read in |
[in] | filename | char* file where vector is stored |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dwrite_vector | ( | magma_d_matrix | A, |
const char * | filename, | ||
magma_queue_t | queue | ||
) |
Writes a vector to a file.
[in] | A | magma_d_matrix matrix to write out |
[in] | filename | const char* output-filname of the mtx matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dvset | ( | magma_int_t | m, |
magma_int_t | n, | ||
double * | val, | ||
magma_d_matrix * | v, | ||
magma_queue_t | queue | ||
) |
Passes a vector to MAGMA.
[in] | m | magma_int_t number of rows |
[in] | n | magma_int_t number of columns |
[in] | val | double* array containing vector entries |
[out] | v | magma_d_matrix* magma vector |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dvget | ( | magma_d_matrix | v, |
magma_int_t * | m, | ||
magma_int_t * | n, | ||
double ** | val, | ||
magma_queue_t | queue | ||
) |
Passes a MAGMA vector back.
[in] | v | magma_d_matrix magma vector |
[out] | m | magma_int_t number of rows |
[out] | n | magma_int_t number of columns |
[out] | val | double* array containing vector entries |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dvset_dev | ( | magma_int_t | m, |
magma_int_t | n, | ||
magmaDouble_ptr | val, | ||
magma_d_matrix * | v, | ||
magma_queue_t | queue | ||
) |
Passes a vector to MAGMA (located on DEV).
[in] | m | magma_int_t number of rows |
[in] | n | magma_int_t number of columns |
[in] | val | magmaDouble_ptr array containing vector entries |
[out] | v | magma_d_matrix* magma vector |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dvget_dev | ( | magma_d_matrix | v, |
magma_int_t * | m, | ||
magma_int_t * | n, | ||
magmaDouble_ptr * | val, | ||
magma_queue_t | queue | ||
) |
Passes a MAGMA vector back (located on DEV).
[in] | v | magma_d_matrix magma vector |
[out] | m | magma_int_t number of rows |
[out] | n | magma_int_t number of columns |
[out] | val | magmaDouble_ptr array containing vector entries |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dvtranspose | ( | magma_d_matrix | x, |
magma_d_matrix * | y, | ||
magma_queue_t | queue | ||
) |
Transposes a vector from col to row major and vice versa.
[in] | x | magma_d_matrix input vector |
[out] | y | magma_d_matrix* output vector |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmisai_blockstruct_gpu | ( | magma_int_t | n, |
magma_int_t | bs, | ||
magma_int_t | offs, | ||
magma_uplo_t | uplotype, | ||
magma_d_matrix * | A, | ||
magma_queue_t | queue | ||
) |
Generates a block-diagonal sparsity pattern with block-size bs on the GPU.
[in] | n | magma_int_t Size of the matrix. |
[in] | bs | magma_int_t Size of the diagonal blocks. |
[in] | offs | magma_int_t Size of the first diagonal block. |
[in] | uplotype | magma_uplo_t lower or upper triangular |
[in,out] | A | magma_d_matrix* Generated sparsity pattern matrix. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmbackinsert_batched_gpu | ( | magma_uplo_t | uplotype, |
magma_trans_t | transtype, | ||
magma_diag_t | diagtype, | ||
magma_d_matrix * | M, | ||
magma_index_t * | sizes, | ||
magma_index_t * | locations, | ||
double * | trisystems, | ||
double * | rhs, | ||
magma_queue_t | queue | ||
) |
Inserts the values into the preconditioner matrix.
[in] | uplotype | magma_uplo_t lower or upper triangular |
[in] | transtype | magma_trans_t possibility for transposed matrix |
[in] | diagtype | magma_diag_t unit diagonal or not |
[in,out] | M | magma_d_matrix* SPAI preconditioner CSR col-major |
[out] | sizes | magma_int_t* Number of Elements that are replaced. |
[out] | locations | magma_int_t* Array indicating the locations. |
[out] | trisystems | double* trisystems |
[out] | rhs | double* right-hand sides |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_disaigenerator_16_gpu | ( | magma_uplo_t | uplotype, |
magma_trans_t | transtype, | ||
magma_diag_t | diagtype, | ||
magma_d_matrix | L, | ||
magma_d_matrix * | M, | ||
magma_index_t * | sizes, | ||
magma_index_t * | locations, | ||
double * | trisystems, | ||
double * | rhs, | ||
magma_queue_t | queue | ||
) |
This routine is designet to combine all kernels into one.
[in] | uplotype | magma_uplo_t lower or upper triangular |
[in] | transtype | magma_trans_t possibility for transposed matrix |
[in] | diagtype | magma_diag_t unit diagonal or not |
[in] | L | magma_d_matrix triangular factor for which the ISAI matrix is computed. Col-Major CSR storage. |
[in,out] | M | magma_d_matrix* SPAI preconditioner CSR col-major |
[out] | sizes | magma_int_t* Number of Elements that are replaced. |
[out] | locations | magma_int_t* Array indicating the locations. |
[out] | trisystems | double* trisystems |
[out] | rhs | double* right-hand sides |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_disaigenerator_32_gpu | ( | magma_uplo_t | uplotype, |
magma_trans_t | transtype, | ||
magma_diag_t | diagtype, | ||
magma_d_matrix | L, | ||
magma_d_matrix * | M, | ||
magma_index_t * | sizes, | ||
magma_index_t * | locations, | ||
double * | trisystems, | ||
double * | rhs, | ||
magma_queue_t | queue | ||
) |
This routine is designet to combine all kernels into one.
[in] | uplotype | magma_uplo_t lower or upper triangular |
[in] | transtype | magma_trans_t possibility for transposed matrix |
[in] | diagtype | magma_diag_t unit diagonal or not |
[in] | L | magma_d_matrix triangular factor for which the ISAI matrix is computed. Col-Major CSR storage. |
[in,out] | M | magma_d_matrix* SPAI preconditioner CSR col-major |
[out] | sizes | magma_int_t* Number of Elements that are replaced. |
[out] | locations | magma_int_t* Array indicating the locations. |
[out] | trisystems | double* trisystems |
[out] | rhs | double* right-hand sides |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_disaigenerator_8_gpu | ( | magma_uplo_t | uplotype, |
magma_trans_t | transtype, | ||
magma_diag_t | diagtype, | ||
magma_d_matrix | L, | ||
magma_d_matrix * | M, | ||
magma_index_t * | sizes, | ||
magma_index_t * | locations, | ||
double * | trisystems, | ||
double * | rhs, | ||
magma_queue_t | queue | ||
) |
This routine is designet to combine all kernels into one.
[in] | uplotype | magma_uplo_t lower or upper triangular |
[in] | transtype | magma_trans_t possibility for transposed matrix |
[in] | diagtype | magma_diag_t unit diagonal or not |
[in] | L | magma_d_matrix triangular factor for which the ISAI matrix is computed. Col-Major CSR storage. |
[in,out] | M | magma_d_matrix* SPAI preconditioner CSR col-major |
[out] | sizes | magma_int_t* Number of Elements that are replaced. |
[out] | locations | magma_int_t* Array indicating the locations. |
[out] | trisystems | double* trisystems |
[out] | rhs | double* right-hand sides |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_disai_generator_regs | ( | magma_uplo_t | uplotype, |
magma_trans_t | transtype, | ||
magma_diag_t | diagtype, | ||
magma_d_matrix | L, | ||
magma_d_matrix * | M, | ||
magma_index_t * | sizes, | ||
magma_index_t * | locations, | ||
double * | trisystems, | ||
double * | rhs, | ||
magma_queue_t | queue | ||
) |
This routine is designet to combine all kernels into one.
[in] | uplotype | magma_uplo_t lower or upper triangular |
[in] | transtype | magma_trans_t possibility for transposed matrix |
[in] | diagtype | magma_diag_t unit diagonal or not |
[in] | L | magma_d_matrix triangular factor for which the ISAI matrix is computed. Col-Major CSR storage. |
[in,out] | M | magma_d_matrix* SPAI preconditioner CSR col-major |
[out] | sizes | magma_int_t* Number of Elements that are replaced. |
[out] | locations | magma_int_t* Array indicating the locations. |
[out] | trisystems | double* trisystems |
[out] | rhs | double* right-hand sides |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dgeisai_maxblock | ( | magma_d_matrix | L, |
magma_d_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.
[in,out] | L | magma_d_matrix Incomplete factor. |
[in,out] | MT | magma_d_matrix* SPAI preconditioner structure, CSR col-major. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmtrisolve_batched_gpu | ( | magma_uplo_t | uplotype, |
magma_trans_t | transtype, | ||
magma_diag_t | diagtype, | ||
magma_d_matrix | L, | ||
magma_d_matrix | LC, | ||
magma_index_t * | sizes, | ||
magma_index_t * | locations, | ||
double * | trisystems, | ||
double * | rhs, | ||
magma_queue_t | queue | ||
) |
Does all triangular solves.
[in] | uplotype | magma_uplo_t lower or upper triangular |
[in] | transtype | magma_trans_t possibility for transposed matrix |
[in] | diagtype | magma_diag_t unit diagonal or not |
[in] | L | magma_d_matrix Matrix in CSR format |
[in] | LC | magma_d_matrix same matrix, also CSR, but col-major |
[out] | sizes | magma_int_t* Number of Elements that are replaced. |
[out] | locations | magma_int_t* Array indicating the locations. |
[out] | trisystems | double* trisystems |
[out] | rhs | double* right-hand sides |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dlobpcg_res | ( | magma_int_t | num_rows, |
magma_int_t | num_vecs, | ||
magmaDouble_ptr | evalues, | ||
magmaDouble_ptr | X, | ||
magmaDouble_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_daxpy(m, MAGMA_D_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] /
[in] | num_rows | magma_int_t number of rows |
[in] | num_vecs | magma_int_t number of vectors |
[in] | evalues | magmaDouble_ptr array of eigenvalues/approximations |
[in] | X | magmaDouble_ptr block of eigenvector approximations |
[in] | R | magmaDouble_ptr block of residuals |
[in] | res | magmaDouble_ptr array of residuals |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dlobpcg_shift | ( | magma_int_t | num_rows, |
magma_int_t | num_vecs, | ||
magma_int_t | shift, | ||
magmaDouble_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] /
[in] | num_rows | magma_int_t number of rows |
[in] | num_vecs | magma_int_t number of vectors |
[in] | shift | magma_int_t shift number |
[in,out] | x | magmaDouble_ptr input/output vector x |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dcopyscale | ( | magma_int_t | n, |
magma_int_t | k, | ||
magmaDouble_ptr | r, | ||
magmaDouble_ptr | v, | ||
magmaDouble_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) ) .
[in] | n | int length of v_i |
[in] | k | int skp entries v_i^T * r ( without r ) |
[in] | r | magmaDouble_ptr vector of length n |
[in] | v | magmaDouble_ptr vector of length n |
[in] | skp | magmaDouble_ptr array of parameters |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_ddiagcheck | ( | magma_d_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.
[in] | dA | magma_d_matrix matrix in CSR format |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmconjugate | ( | magma_d_matrix * | A, |
magma_queue_t | queue | ||
) |
This function conjugates a matrix.
For a real matrix, no value is changed.
[in,out] | A | magma_d_matrix* input/output matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_dmcsrcompressor_gpu | ( | magma_d_matrix * | A, |
magma_queue_t | queue | ||
) |
Removes zeros in a CSR matrix.
This is a GPU implementation of the CSR compressor.
[in,out] | A | magma_d_matrix* input/output matrix |
[in] | queue | magma_queue_t Queue to execute in. |