![]() |
MAGMA 2.9.0
Matrix Algebra for GPU and Multicore Architectures
|
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. | |
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. | |
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. | |
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. | |
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. | |
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) |
This is an interface that allows to use any iterative solver on the linear system Ax = b. | |
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. | |
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. | |
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. | |
magma_int_t | magma_zwrapper (magma_zopts *zopts, magma_z_matrix A, magma_z_matrix *x, magma_z_matrix b, magma_queue_t queue) |
This is the interface to MAGMA-sparse functionalities. | |
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. | |
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. | |
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. | |
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. | |
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. | |
magma_int_t | magma_zmfree (magma_z_matrix *A, magma_queue_t queue) |
Free the memory of a magma_z_matrix. | |
magma_int_t | magma_zprecondfree (magma_z_preconditioner *precond_par, magma_queue_t queue) |
Free a preconditioner. | |
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. | |
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. | |
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. | |
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. | |
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. | |
magma_int_t | magma_zmatrix_cup (magma_z_matrix A, magma_z_matrix B, magma_z_matrix *U, magma_queue_t queue) |
Generates a matrix \(U = A \cup B\). | |
magma_int_t | magma_zmatrix_cap (magma_z_matrix A, magma_z_matrix B, magma_z_matrix *U, magma_queue_t queue) |
Generates a matrix with entries being in both matrices: \(U = A \cap B\). | |
magma_int_t | magma_zmatrix_negcap (magma_z_matrix A, magma_z_matrix B, magma_z_matrix *U, magma_queue_t queue) |
Generates a list of matrix entries being part of A but not of B. | |
magma_int_t | magma_zmatrix_tril_negcap (magma_z_matrix A, magma_z_matrix B, magma_z_matrix *U, magma_queue_t queue) |
Generates a list of matrix entries being part of tril(A) but not of B. | |
magma_int_t | magma_zmatrix_triu_negcap (magma_z_matrix A, magma_z_matrix B, magma_z_matrix *U, magma_queue_t queue) |
Generates a matrix with entries being part of triu(A) but not of B. | |
magma_int_t | magma_zmatrix_addrowindex (magma_z_matrix *A, magma_queue_t queue) |
Adds to a CSR matrix an array containing the rowindexes. | |
magma_int_t | magma_zcsrcoo_transpose (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue) |
Transposes a matrix that already contains rowidx. | |
magma_int_t | magma_zmatrix_createrowptr (magma_int_t n, magma_index_t *row, magma_queue_t queue) |
This function generates a rowpointer out of a row-wise element count in parallel. | |
magma_int_t | magma_zmatrix_swap (magma_z_matrix *A, magma_z_matrix *B, magma_queue_t queue) |
Swaps two matrices. | |
magma_int_t | magma_zmatrix_tril (magma_z_matrix A, magma_z_matrix *L, magma_queue_t queue) |
Extracts the lower triangular of a matrix: L = tril(A). | |
magma_int_t | magma_zmatrix_triu (magma_z_matrix A, magma_z_matrix *U, magma_queue_t queue) |
Extracts the lower triangular of a matrix: U = triu(A). | |
magma_int_t | magma_zmatrix_abssum (magma_z_matrix A, double *sum, magma_queue_t queue) |
Computes the sum of the absolute values in a matrix. | |
magma_int_t | magma_zcsr_sort (magma_z_matrix *A, magma_queue_t queue) |
SOrts the elements in a CSR matrix for increasing column index. | |
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. | |
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. | |
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. | |
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. | |
magma_int_t | magma_zmcsrcompressor (magma_z_matrix *A, magma_queue_t queue) |
Removes zeros in a CSR matrix. | |
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. | |
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. | |
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). | |
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). | |
magma_int_t | magma_zmdiagdom (magma_z_matrix M, double *min_dd, double *max_dd, double *avg_dd, magma_queue_t queue) |
This routine takes a CSR matrix and computes the average diagonal dominance. | |
magma_int_t | magma_zmbdiagdom (magma_z_matrix M, magma_z_matrix blocksizes, double *min_dd, double *max_dd, double *avg_dd, magma_queue_t queue) |
This routine takes a CSR matrix and computes the average block-diagonal dominance. | |
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. | |
magma_int_t | magma_zmfrobenius (magma_z_matrix A, magma_z_matrix B, magma_z_matrix S, double *norm, magma_queue_t queue) |
Computes the Frobenius norm || A - B ||_S on the sparsity pattern of S. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
magma_int_t | magma_zprint_matrix (magma_z_matrix A, magma_queue_t queue) |
Prints a sparse matrix in CSR format. | |
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. | |
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. | |
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. | |
magma_int_t | magma_zmscale (magma_z_matrix *A, magma_scale_t scaling, magma_queue_t queue) |
Scales a matrix. | |
magma_int_t | magma_zmscale_matrix_rhs (magma_z_matrix *A, magma_z_matrix *b, magma_z_matrix *scaling_factors, magma_scale_t scaling, magma_queue_t queue) |
Scales a matrix and a right hand side vector of a Ax = b system. | |
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. | |
magma_int_t | magma_zmscale_generate (magma_int_t n, magma_scale_t *scaling, magma_side_t *side, magma_z_matrix *A, magma_z_matrix *scaling_factors, magma_queue_t queue) |
Generates n vectors of scaling factors from the A matrix and stores them in the factors matrix as column vectors in column major ordering. | |
magma_int_t | magma_zmscale_apply (magma_int_t n, magma_side_t *side, magma_z_matrix *scaling_factors, magma_z_matrix *A, magma_queue_t queue) |
Applies n diagonal scaling matrices to a matrix A; n=[1,2], factor[i] is applied to side[i] of the matrix. | |
magma_int_t | magma_zdimv (magma_z_matrix *vecA, magma_z_matrix *vecB, magma_queue_t queue) |
Multiplies a diagonal matrix (vecA) and a vector (vecB). | |
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. | |
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: | |
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. | |
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. | |
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. | |
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. | |
magma_int_t | magma_zmtranspose (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue) |
Interface to cuSPARSE transpose. | |
magma_int_t | magma_z_cucsrtranspose (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue) |
Helper function to transpose CSR matrix. | |
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. | |
magma_int_t | magma_zmtranspose_cpu (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue) |
Generates a transpose of A on the CPU. | |
magma_int_t | magma_zmtransposeconj_cpu (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue) |
Generates a transpose conjugate of A on the CPU. | |
magma_int_t | magma_zmtransposestruct_cpu (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue) |
Generates a transpose of the nonzero pattern of A on the CPU. | |
magma_int_t | magma_zmtransposeabs_cpu (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue) |
Generates a transpose with absolute values of A on the CPU. | |
magma_int_t | magma_zparic_sweep (magma_z_matrix A, magma_z_matrix *L, magma_queue_t queue) |
This function does one asynchronous ParILU sweep (symmetric case). | |
magma_int_t | magma_zparic_sweep_sync (magma_z_matrix A, magma_z_matrix *L, magma_queue_t queue) |
This function does one synchronized ParILU sweep (symmetric case). | |
magma_int_t | magma_zparict_candidates (magma_z_matrix L0, magma_z_matrix L, magma_z_matrix LT, magma_z_matrix *L_new, magma_queue_t queue) |
This function identifies the candidates like they appear as ILU1 fill-in. | |
magma_int_t | magma_zparict_sweep_sync (magma_z_matrix *A, magma_z_matrix *L, magma_queue_t queue) |
This function does one synchronized ParILU sweep. | |
magma_int_t | magma_zparilu_sweep (magma_z_matrix A, magma_z_matrix *L, magma_z_matrix *U, magma_queue_t queue) |
This function does one asynchronous ParILU sweep. | |
magma_int_t | magma_zparilu_sweep_sync (magma_z_matrix A, magma_z_matrix *L, magma_z_matrix *U, magma_queue_t queue) |
This function does one synchronized ParILU sweep. | |
magma_int_t | magma_zparilut_sweep (magma_z_matrix *A, magma_z_matrix *L, magma_z_matrix *U, magma_queue_t queue) |
This function does an ParILUT sweep. | |
magma_int_t | magma_zparilut_sweep_sync (magma_z_matrix *A, magma_z_matrix *L, magma_z_matrix *U, magma_queue_t queue) |
This function does an ParILUT sweep. | |
magma_int_t | magma_zparilut_residuals (magma_z_matrix A, magma_z_matrix L, magma_z_matrix U, magma_z_matrix *R, magma_queue_t queue) |
This function computes the ILU residual in the locations included in the sparsity pattern of R. | |
magma_int_t | magma_zparilut_thrsrm (magma_int_t order, magma_z_matrix *A, double *thrs, magma_queue_t queue) |
Removes any element with absolute value smaller equal or larger equal thrs from the matrix and compacts the whole thing. | |
magma_int_t | magma_zparilut_thrsrm_U (magma_int_t order, magma_z_matrix L, magma_z_matrix *A, double *thrs, magma_queue_t queue) |
Removes any element with absolute value smaller equal or larger equal thrs from the matrix and compacts the whole thing. | |
magma_int_t | magma_zparilut_thrsrm_semilinked (magma_z_matrix *U, magma_z_matrix *US, double *thrs, magma_queue_t queue) |
Removes any element with absolute value smaller thrs from the matrix. | |
magma_int_t | magma_zparilut_rmselected (magma_z_matrix R, magma_z_matrix *A, magma_queue_t queue) |
Removes a selected list of elements from the matrix. | |
magma_int_t | magma_zparilut_selectoneperrow (magma_int_t order, magma_z_matrix *A, magma_z_matrix *oneA, magma_queue_t queue) |
This function takes a list of candidates with residuals, and selects the largest in every row. | |
magma_int_t | magma_zparilut_selecttwoperrow (magma_int_t order, magma_z_matrix *A, magma_z_matrix *oneA, magma_queue_t queue) |
This function takes a list of candidates with residuals, and selects the largest in every row. | |
magma_int_t | magma_zparilut_selectoneperrowthrs_lower (magma_z_matrix L, magma_z_matrix U, magma_z_matrix *A, double rtol, magma_z_matrix *oneA, magma_queue_t queue) |
This function takes a list of candidates with residuals, and selects the largest in every row. | |
magma_int_t | magma_zparilut_selectoneperrowthrs_upper (magma_z_matrix L, magma_z_matrix U, magma_z_matrix *A, double rtol, magma_z_matrix *oneA, magma_queue_t queue) |
This function takes a list of candidates with residuals, and selects the largest in every row. | |
magma_int_t | magma_zparilut_preselect (magma_int_t order, magma_z_matrix *A, magma_z_matrix *oneA, magma_queue_t queue) |
This function takes a list of candidates with residuals, and selects the largest in every row. | |
magma_int_t | magma_zparilut_preselect_scale (magma_z_matrix *L, magma_z_matrix *oneL, magma_z_matrix *U, magma_z_matrix *oneU, magma_queue_t queue) |
This function takes a list of candidates with residuals, and selects the largest in every row. | |
magma_int_t | magma_zparilut_transpose (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue) |
Transposes a matrix that already contains rowidx. | |
magma_int_t | magma_zparilut_transpose_select_one (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue) |
This is a special routine with very limited scope. | |
magma_int_t | magma_zparilut_create_collinkedlist (magma_z_matrix A, magma_z_matrix *B, magma_queue_t queue) |
For the matrix U in CSR (row-major) this creates B containing a row-ptr to the columns and a linked list for the elements. | |
magma_int_t | magma_zparilut_sweep_semilinked (magma_z_matrix *A, magma_z_matrix *L, magma_z_matrix *US, magma_queue_t queue) |
This function does an ParILU sweep. | |
magma_int_t | magma_zparilut_sweep_list (magma_z_matrix *A, magma_z_matrix *L, magma_z_matrix *U, magma_queue_t queue) |
This function does an ParILU sweep. | |
magma_int_t | magma_zparilut_residuals_semilinked (magma_z_matrix A, magma_z_matrix L, magma_z_matrix US, magma_z_matrix *L_new, magma_queue_t queue) |
This function computes the residuals. | |
magma_int_t | magma_zparilut_residuals_transpose (magma_z_matrix A, magma_z_matrix L, magma_z_matrix U, magma_z_matrix *U_new, magma_queue_t queue) |
This function computes the residuals. | |
magma_int_t | magma_zparilut_residuals_list (magma_z_matrix A, magma_z_matrix L, magma_z_matrix U, magma_z_matrix *L_new, magma_queue_t queue) |
This function computes the residuals. | |
magma_int_t | magma_zparilut_sweep_linkedlist (magma_z_matrix *A, magma_z_matrix *L, magma_z_matrix *U, magma_queue_t queue) |
This function does an ParILU sweep. | |
magma_int_t | magma_zparilut_residuals_linkedlist (magma_z_matrix A, magma_z_matrix L, magma_z_matrix U, magma_z_matrix *L_new, magma_queue_t queue) |
This function computes the residuals. | |
magma_int_t | magma_zparilut_colmajor (magma_z_matrix A, magma_z_matrix *AC, magma_queue_t queue) |
This function creates a col-pointer and a linked list along the columns for a row-major CSR matrix. | |
magma_int_t | magma_zparilut_reorder (magma_z_matrix *LU, magma_queue_t queue) |
This routine reorders the matrix (inplace) for easier access. | |
magma_int_t | magma_zparilut_colmajorup (magma_z_matrix A, magma_z_matrix *AC, magma_queue_t queue) |
This function creates a col-pointer and a linked list along the columns for a row-major CSR matrix. | |
magma_int_t | magma_zparilut_insert (magma_int_t *num_rmL, magma_int_t *num_rmU, magma_index_t *rm_locL, magma_index_t *rm_locU, magma_z_matrix *L_new, magma_z_matrix *U_new, magma_z_matrix *L, magma_z_matrix *U, magma_z_matrix *UR, magma_queue_t queue) |
Inserts for the iterative dynamic ILU an new element in the (empty) place. | |
magma_int_t | magma_zparilut_candidates (magma_z_matrix L0, magma_z_matrix U0, magma_z_matrix L, magma_z_matrix U, magma_z_matrix *L_new, magma_z_matrix *U_new, magma_queue_t queue) |
This function identifies the candidates like they appear as ILU1 fill-in. | |
magma_int_t | magma_zparilut_candidates_semilinked (magma_z_matrix L0, magma_z_matrix U0, magma_z_matrix L, magma_z_matrix U, magma_z_matrix UT, magma_z_matrix *L_new, magma_z_matrix *U_new, magma_queue_t queue) |
This function identifies the candidates like they appear as ILU1 fill-in. | |
magma_int_t | magma_zparilut_rm_thrs (double *thrs, magma_int_t *num_rm, magma_z_matrix *LU, magma_z_matrix *LU_new, magma_index_t *rm_loc, magma_queue_t queue) |
This routine removes matrix entries from the structure that are smaller than the threshold. | |
magma_int_t | magma_zparilut_count (magma_z_matrix L, magma_int_t *num, magma_queue_t queue) |
This is a helper routine counting elements in a matrix in unordered Magma_CSRLIST format. | |
magma_int_t | magma_zparilut_select_candidates_L (magma_int_t *num_rm, magma_index_t *rm_loc, magma_z_matrix *L_new, magma_queue_t queue) |
Screens the new candidates for multiple elements in the same row. | |
magma_int_t | magma_zparilut_select_candidates_U (magma_int_t *num_rm, magma_index_t *rm_loc, magma_z_matrix *L_new, magma_queue_t queue) |
Screens the new candidates for multiple elements in the same row. | |
magma_int_t | magma_zparilut_set_approx_thrs (magma_int_t num_rm, magma_z_matrix *LU, magma_int_t order, double *thrs, magma_queue_t queue) |
This routine approximates the threshold for removing num_rm elements. | |
magma_int_t | magma_zparilut_set_thrs_randomselect (magma_int_t num_rm, magma_z_matrix *LU, magma_int_t order, double *thrs, magma_queue_t queue) |
This routine approximates the threshold for removing num_rm elements. | |
magma_int_t | magma_zparilut_set_thrs_L_scaled (magma_int_t num_rm, magma_z_matrix *L, magma_z_matrix *U, magma_int_t order, double *thrs, magma_queue_t queue) |
This routine approximates the threshold for removing num_rm elements. | |
magma_int_t | magma_zparilut_set_thrs_randomselect_approx2 (magma_int_t num_rm, magma_z_matrix *LU, magma_int_t order, double *thrs, magma_queue_t queue) |
This routine approximates the threshold for removing num_rm elements. | |
magma_int_t | magma_zparilut_set_thrs_randomselect_approx (magma_int_t num_rm, magma_z_matrix *LU, magma_int_t order, double *thrs, magma_queue_t queue) |
This routine approximates the threshold for removing num_rm elements. | |
magma_int_t | magma_zparilut_set_thrs_randomselect_factors (magma_int_t num_rm, magma_z_matrix *L, magma_z_matrix *U, magma_int_t order, double *thrs, magma_queue_t queue) |
This routine approximates the threshold for removing num_rm elements. | |
magma_int_t | magma_zparilut_set_exact_thrs (magma_int_t num_rm, magma_z_matrix *LU, magma_int_t order, magmaDoubleComplex *thrs, magma_queue_t queue) |
This routine provides the exact threshold for removing num_rm elements. | |
magma_int_t | magma_zparilut_set_approx_thrs_inc (magma_int_t num_rm, magma_z_matrix *LU, magma_int_t order, magmaDoubleComplex *thrs, magma_queue_t queue) |
This routine provides the exact threshold for removing num_rm elements. | |
magma_int_t | magma_zparilut_align_residuals (magma_z_matrix L, magma_z_matrix U, magma_z_matrix *Lnew, magma_z_matrix *Unew, magma_queue_t queue) |
This function scales the residuals of a lower triangular factor L with the diagonal of U. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
magma_int_t | magma_zselect (magmaDoubleComplex *a, magma_int_t size, magma_int_t k, magma_queue_t queue) |
An efficient implementation of Blum, Floyd, Pratt, Rivest, and Tarjan's worst-case linear selection algorithm. | |
magma_int_t | magma_zselectrandom (magmaDoubleComplex *a, magma_int_t size, magma_int_t k, magma_queue_t queue) |
An efficient implementation of Blum, Floyd, Pratt, Rivest, and Tarjan's worst-case linear selection algorithm. | |
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. | |
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. | |
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. | |
magma_int_t | magma_zeigensolverinfo_init (magma_z_solver_par *solver_par, magma_queue_t queue) |
Initializes space for eigensolvers. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
magma_int_t | magma_zorderstatistics_inc (magmaDoubleComplex *val, magma_int_t length, magma_int_t k, magma_int_t inc, magma_int_t r, magmaDoubleComplex *element, magma_queue_t queue) |
Approximates the k-th smallest element in an array by using order-statistics with step-size inc. | |
magma_int_t | magma_zbitonic_sort (magma_int_t start, magma_int_t length, magmaDoubleComplex *seq, magma_int_t flag, magma_queue_t queue) |
Approximates the k-th smallest element in an array by using order-statistics with step-size inc. | |
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. | |
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. | |
magma_int_t | magma_zvinit_rand (magma_z_matrix *x, magma_location_t mem_loc, magma_int_t num_rows, magma_int_t num_cols, magma_queue_t queue) |
Allocates memory for magma_z_matrix and initializes it with random values. | |
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. | |
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". | |
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. | |
magma_int_t | magma_zwrite_vector (magma_z_matrix A, const char *filename, magma_queue_t queue) |
Writes a vector to a file. | |
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. | |
magma_int_t | magma_zvcopy (magma_z_matrix v, magma_int_t *m, magma_int_t *n, magmaDoubleComplex *val, magma_queue_t queue) |
Passes a MAGMA vector back. | |
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). | |
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. | |
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). | |
magma_int_t | magma_zvcopy_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). | |
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. | |
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. | |
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 | |
magma_int_t | magma_zmatrix_cup_gpu (magma_z_matrix A, magma_z_matrix B, magma_z_matrix *U, magma_queue_t queue) |
Generates a matrix \(U = A \cup B\). | |
magma_int_t | magma_zcsr_sort_gpu (magma_z_matrix *A, magma_queue_t queue) |
Generates a matrix \(U = A \cup B\). | |
magma_int_t | magma_zmconjugate (magma_z_matrix *A, magma_queue_t queue) |
This function conjugates a matrix. | |
magma_int_t | magma_zmcsrcompressor_gpu (magma_z_matrix *A, magma_queue_t queue) |
Removes zeros in a CSR matrix. | |
magma_int_t | magma_zpreselect_gpu (magma_int_t order, magma_z_matrix *A, magma_z_matrix *oneA, magma_queue_t queue) |
This function takes a list of candidates with residuals, and selects the largest in every row. | |
magma_int_t | magma_zsampleselect (magma_int_t total_size, magma_int_t subset_size, magmaDoubleComplex *val, double *thrs, magma_ptr *tmp_ptr, magma_int_t *tmp_size, magma_queue_t queue) |
This routine selects a threshold separating the subset_size smallest magnitude elements from the rest. | |
magma_int_t | magma_zsampleselect_approx (magma_int_t total_size, magma_int_t subset_size, magmaDoubleComplex *val, double *thrs, magma_ptr *tmp_ptr, magma_int_t *tmp_size, magma_queue_t queue) |
This routine selects an approximate threshold separating the subset_size smallest magnitude elements from the rest. | |
magma_int_t | magma_zsampleselect_nodp (magma_int_t total_size, magma_int_t subset_size, magmaDoubleComplex *val, double *thrs, magma_ptr *tmp_ptr, magma_int_t *tmp_size, magma_queue_t queue) |
This routine selects a threshold separating the subset_size smallest magnitude elements from the rest. | |
magma_int_t | magma_zsampleselect_approx_nodp (magma_int_t total_size, magma_int_t subset_size, magmaDoubleComplex *val, double *thrs, magma_ptr *tmp_ptr, magma_int_t *tmp_size, magma_queue_t queue) |
This routine selects an approximate threshold separating the subset_size smallest magnitude elements from the rest. | |
magma_int_t | magma_zthrsholdselect (magma_int_t sampling, magma_int_t total_size, magma_int_t subset_size, magmaDoubleComplex *val, double *thrs, magma_queue_t queue) |
This routine selects a threshold separating the subset_size smallest magnitude elements from the rest. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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_queue_t queue) |
This routine is designet to combine all kernels into one. | |
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. | |
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. | |
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. | |
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. | |
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. | |
magma_int_t | magma_zparilut_candidates_gpu (magma_z_matrix L0, magma_z_matrix U0, magma_z_matrix L, magma_z_matrix U, magma_z_matrix *L_new, magma_z_matrix *U_new, magma_queue_t queue) |
This function identifies the locations with a potential nonzero ILU residual R = A - L*U where L and U are the current incomplete factors. | |
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. | |
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.
[in] | A | magma_z_matrix sparse matrix A |
[in] | b | magma_z_matrix input vector b |
[in] | x | magma_z_matrix* output vector x |
[in,out] | precond | magma_z_preconditioner preconditioner |
[in] | queue | magma_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.
[in] | A | magma_z_matrix sparse matrix M |
[in] | b | magma_z_matrix input vector y |
[in] | solver | magma_z_solver_par solver structure using the preconditioner |
[in,out] | precond | magma_z_preconditioner preconditioner |
[in] | queue | magma_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.
[in] | A | magma_z_matrix sparse matrix A |
[in] | b | magma_z_matrix input vector b |
[in,out] | x | magma_z_matrix* output vector x |
[in] | precond | magma_z_preconditioner preconditioner |
[in] | queue | magma_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.
[in] | trans | magma_trans_t mode of the preconditioner: MagmaTrans or MagmaNoTrans |
[in] | A | magma_z_matrix sparse matrix A |
[in] | b | magma_z_matrix input vector b |
[in,out] | x | magma_z_matrix* output vector x |
[in] | precond | magma_z_preconditioner preconditioner |
[in] | queue | magma_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.
[in] | trans | magma_trans_t mode of the preconditioner: MagmaTrans or MagmaNoTrans |
[in] | A | magma_z_matrix sparse matrix A |
[in] | b | magma_z_matrix input vector b |
[in,out] | x | magma_z_matrix* output vector x |
[in] | precond | magma_z_preconditioner preconditioner |
[in] | queue | magma_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 ) |
This is an interface that allows to use any iterative solver on the linear system Ax = b.
All linear algebra objects are expected to be on the device, the linear algebra objects are MAGMA-sparse specific structures (dense matrix b, dense matrix x, sparse/dense matrix A). The additional parameter zopts contains information about the solver and the preconditioner. the type of solver the relative / absolute stopping criterion the maximum number of iterations the preconditioner type ... Please see magmasparse_types.h for details about the fields and magma_zutil_sparse.cpp for the possible options.
[in] | A | magma_z_matrix sparse matrix A |
[in] | b | magma_z_matrix input vector b |
[in] | x | magma_z_matrix* output vector x |
[in] | zopts | magma_zopts options for solver and preconditioner |
[in] | queue | magma_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.
[in] | b | magma_z_matrix RHS |
[in,out] | x | magma_z_matrix* vector to precondition |
[in,out] | precond | magma_z_preconditioner* preconditioner parameters |
[in] | queue | magma_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.
[in] | b | magma_z_matrix RHS |
[in,out] | x | magma_z_matrix* vector to precondition |
[in,out] | precond | magma_z_preconditioner* preconditioner parameters |
[in] | queue | magma_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.
L | magma_z_matrix input strictly lower triangular matrix L |
U | magma_z_matrix input upper triangular matrix U |
A | magma_z_matrix* output matrix |
magma_int_t magma_zwrapper | ( | magma_zopts * | zopts, |
magma_z_matrix | A, | ||
magma_z_matrix * | x, | ||
magma_z_matrix | b, | ||
magma_queue_t | queue ) |
This is the interface to MAGMA-sparse functionalities.
The zopts structure contains all information about which functionality is requested, where it is computed etc.
[in] | zopts | magma_zopts Structure containing all information which node-level operation is requested. |
[in] | A | magma_z_matrix Sparse matrix A in CSR format. |
[in] | x | magma_z_matrix* Output vector x. |
[in] | b | magma_z_matrix Input vector b. |
[in] | queue | magma_queue_t Queue to execute in. |
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.
[in] | A | magma_z_matrix input matrix A |
[in] | b | magma_z_matrix RHS b |
[in] | x | magma_z_matrix solution approximation |
[out] | res | magmaDoubleComplex* return residual |
[in] | queue | magma_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.
[in] | start | magma_int_t start of slice (row-index) |
[in] | end | magma_int_t end of slice (row-index) |
[in] | A | magma_z_matrix input matrix A |
[in] | b | magma_z_matrix RHS b |
[in] | x | magma_z_matrix solution approximation |
[out] | res | magmaDoubleComplex* return residual |
[in] | queue | magma_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
[in] | A | magma_z_matrix input matrix A |
[in] | b | magma_z_matrix RHS b |
[in] | x | magma_z_matrix solution approximation |
[in,out] | r | magma_z_matrix* residual vector |
[out] | res | magmaDoubleComplex* return residual |
[in] | queue | magma_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.
[in] | offset | magma_int_t size of the first block |
[in] | bsize | magma_int_t size of the diagonal blocks |
[in] | A | magma_z_matrix CSR input matrix |
[out] | D | magma_z_matrix* CSR matrix containing diagonal blocks |
[out] | R | magma_z_matrix* CSR matrix containing rest |
[in] | queue | magma_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.
[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_zmfree | ( | magma_z_matrix * | A, |
magma_queue_t | queue ) |
Free the memory of a magma_z_matrix.
Note, this routine performs a magma_queue_sync on the queue passed to it prior to freeing any memory.
[in,out] | A | magma_z_matrix* matrix to free |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zprecondfree | ( | magma_z_preconditioner * | precond_par, |
magma_queue_t | queue ) |
Free a preconditioner.
Note, this routine performs a magma_queue_sync on the queue passed to it prior to freeing any memory.
[in,out] | precond_par | magma_z_preconditioner* structure containing all preconditioner information |
[in] | queue | magma_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.
[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_z_matrix Matrix in CSR format |
[in] | LC | magma_z_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 | magmaDoubleComplex* trisystems |
[in,out] | rhs | magmaDoubleComplex* right-hand sides |
[in] | queue | magma_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.
[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_z_matrix Matrix in CSR format |
[in] | LC | magma_z_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 | magmaDoubleComplex* trisystems |
[out] | rhs | magmaDoubleComplex* right-hand sides |
[in] | queue | magma_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.
[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_z_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 | magmaDoubleComplex* trisystems |
[out] | rhs | magmaDoubleComplex* right-hand sides |
[in] | queue | magma_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.
[in] | A | magma_z_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_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.
[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_z_matrix* Generated sparsity pattern matrix. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmatrix_cup | ( | magma_z_matrix | A, |
magma_z_matrix | B, | ||
magma_z_matrix * | U, | ||
magma_queue_t | queue ) |
Generates a matrix \(U = A \cup B\).
If both matrices have a nonzero value in the same location, the value of A is used.
[in] | A | magma_z_matrix Input matrix 1. |
[in] | B | magma_z_matrix Input matrix 2. |
[out] | U | magma_z_matrix* Not a real matrix, but the list of all matrix entries included in either A or B. No duplicates. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmatrix_cap | ( | magma_z_matrix | A, |
magma_z_matrix | B, | ||
magma_z_matrix * | U, | ||
magma_queue_t | queue ) |
Generates a matrix with entries being in both matrices: \(U = A \cap B\).
The values in U are all ones.
[in] | A | magma_z_matrix Input matrix 1. |
[in] | B | magma_z_matrix Input matrix 2. |
[out] | U | magma_z_matrix* Not a real matrix, but the list of all matrix entries included in both A and B. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmatrix_negcap | ( | magma_z_matrix | A, |
magma_z_matrix | B, | ||
magma_z_matrix * | U, | ||
magma_queue_t | queue ) |
Generates a list of matrix entries being part of A but not of B.
U = A \ B The values of A are preserved.
[in] | A | magma_z_matrix Element part of this. |
[in,out] | B | magma_z_matrix Not part of this. |
[out] | U | magma_z_matrix* Not a real matrix, but the list of all matrix entries included in A not in B. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmatrix_tril_negcap | ( | magma_z_matrix | A, |
magma_z_matrix | B, | ||
magma_z_matrix * | U, | ||
magma_queue_t | queue ) |
Generates a list of matrix entries being part of tril(A) but not of B.
U = tril(A) \ B The values of A are preserved.
[in] | A | magma_z_matrix Element part of this. |
[in,out] | B | magma_z_matrix Not part of this. |
[out] | U | magma_z_matrix* Not a real matrix, but the list of all matrix entries included in A not in B. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmatrix_triu_negcap | ( | magma_z_matrix | A, |
magma_z_matrix | B, | ||
magma_z_matrix * | U, | ||
magma_queue_t | queue ) |
Generates a matrix with entries being part of triu(A) but not of B.
U = triu(A) \ B The values of A are preserved.
[in] | A | magma_z_matrix Element part of this. |
[in] | B | magma_z_matrix Not part of this. |
[out] | U | magma_z_matrix* |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmatrix_addrowindex | ( | magma_z_matrix * | A, |
magma_queue_t | queue ) |
Adds to a CSR matrix an array containing the rowindexes.
[in,out] | A | magma_z_matrix* Matrix where rowindexes should be added. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zcsrcoo_transpose | ( | magma_z_matrix | A, |
magma_z_matrix * | B, | ||
magma_queue_t | queue ) |
Transposes a matrix that already contains rowidx.
The idea is to use a linked list.
[in] | A | magma_z_matrix Matrix to transpose. |
[out] | B | magma_z_matrix* Transposed matrix. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmatrix_createrowptr | ( | magma_int_t | n, |
magma_index_t * | row, | ||
magma_queue_t | queue ) |
This function generates a rowpointer out of a row-wise element count in parallel.
[in] | n | magma_indnt_t row-count. |
[in,out] | row | magma_index_t* Input: Vector of size n+1 containing the row-counts (offset by one). Output: Rowpointer. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmatrix_swap | ( | magma_z_matrix * | A, |
magma_z_matrix * | B, | ||
magma_queue_t | queue ) |
Swaps two matrices.
Useful if a loop modifies the name of a matrix.
[in,out] | A | magma_z_matrix* Matrix to be swapped with B. |
[in,out] | B | magma_z_matrix* Matrix to be swapped with A. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmatrix_tril | ( | magma_z_matrix | A, |
magma_z_matrix * | L, | ||
magma_queue_t | queue ) |
Extracts the lower triangular of a matrix: L = tril(A).
The values of A are preserved.
[in] | A | magma_z_matrix Element part of this. |
[out] | L | magma_z_matrix* Lower triangular part of A. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmatrix_triu | ( | magma_z_matrix | A, |
magma_z_matrix * | U, | ||
magma_queue_t | queue ) |
Extracts the lower triangular of a matrix: U = triu(A).
The values of A are preserved.
[in] | A | magma_z_matrix Element part of this. |
[out] | U | magma_z_matrix* Lower triangular part of A. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmatrix_abssum | ( | magma_z_matrix | A, |
double * | sum, | ||
magma_queue_t | queue ) |
Computes the sum of the absolute values in a matrix.
[in] | A | magma_z_matrix Element list/matrix. |
[out] | sum | double* Sum of the absolute values. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zcsr_sort | ( | magma_z_matrix * | A, |
magma_queue_t | queue ) |
SOrts the elements in a CSR matrix for increasing column index.
[in,out] | A | magma_z_matrix* CSR matrix, sorted on output. |
[in] | queue | magma_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.
[in,out] | A | magma_z_matrix* sparse matrix |
[in] | queue | magma_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.
[in,out] | A | magma_z_matrix* sparse matrix |
[in] | queue | magma_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.
[in] | val | magmaDoubleComplex** 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 | magmaDoubleComplex** 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_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.
[in] | A | magma_z_matrix sparse matrix A |
[out] | B | magma_z_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_zmcsrcompressor | ( | magma_z_matrix * | A, |
magma_queue_t | queue ) |
Removes zeros in a CSR matrix.
[in,out] | A | magma_z_matrix* input/output matrix |
[in] | queue | magma_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.
[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 | magmaDoubleComplex* array containing matrix entries |
[out] | A | magma_z_matrix* matrix in magma sparse matrix format |
[in] | queue | magma_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.
[in] | A | magma_z_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 | magmaDoubleComplex* array containing matrix entries |
[in] | queue | magma_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).
[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 | magmaDoubleComplex_ptr array containing matrix entries |
[out] | A | magma_z_matrix* matrix in magma sparse matrix format |
[in] | queue | magma_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).
[in] | A | magma_z_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 | magmaDoubleComplex_ptr array containing matrix entries |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmdiagdom | ( | magma_z_matrix | M, |
double * | min_dd, | ||
double * | max_dd, | ||
double * | avg_dd, | ||
magma_queue_t | queue ) |
This routine takes a CSR matrix and computes the average diagonal dominance.
For each row i, it computes the abs(d_ii)/sum_j(abs(a_ij)). It returns max, min, and average.
[in] | M | magma_z_matrix System matrix. |
[out] | min_dd | double Smallest diagonal dominance. |
[out] | max_dd | double Largest diagonal dominance. |
[out] | avg_dd | double Average diagonal dominance. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmbdiagdom | ( | magma_z_matrix | M, |
magma_z_matrix | blocksizes, | ||
double * | min_dd, | ||
double * | max_dd, | ||
double * | avg_dd, | ||
magma_queue_t | queue ) |
This routine takes a CSR matrix and computes the average block-diagonal dominance.
For each row i, it computes the abs( D_(i,:) ) / abs( A(i,:) \ D_(i,:) ). It returns max, min, and average. The input vector bsz contains the blocksizes.
[in] | M | magma_z_matrix System matrix. |
[in] | blocksizes | magma_z_matrix Vector containing blocksizes (as DoubleComplex). |
[out] | min_dd | double Smallest diagonal dominance. |
[out] | max_dd | double Largest diagonal dominance. |
[out] | avg_dd | double Average diagonal dominance. |
[in] | queue | magma_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 )
[in] | A | magma_z_matrix sparse matrix in CSR |
[in] | B | magma_z_matrix sparse matrix in CSR |
[out] | res | real_Double_t* residual |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmfrobenius | ( | magma_z_matrix | A, |
magma_z_matrix | B, | ||
magma_z_matrix | S, | ||
double * | norm, | ||
magma_queue_t | queue ) |
Computes the Frobenius norm || A - B ||_S on the sparsity pattern of S.
[in] | A | magma_z_matrix input sparse matrix in CSR |
[in] | B | magma_z_matrix input sparse matrix in CSR |
[in] | S | magma_z_matrix input sparsity pattern in CSR |
[out] | norm | double* Frobenius norm of difference on sparsity pattern S |
[in] | queue | magma_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.
[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 | magmaDoubleComplex* array containing the values (length offsets+1) |
[out] | A | magma_z_matrix* matrix to generate |
[in] | queue | magma_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.
[in] | n | magma_int_t number of rows |
[out] | A | magma_z_matrix* matrix to generate |
[in] | queue | magma_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.
[in] | n | magma_int_t number of rows |
[out] | A | magma_z_matrix* matrix to generate |
[in] | queue | magma_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.
[in,out] | A | magma_z_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_z_matrix* output lower triangular matrix in magma sparse matrix format empty on function call |
[out] | U | magma_z_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_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.
[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 | magmaDoubleComplex** 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_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.
[in] | A | magma_z_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_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.
[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 | magmaDoubleComplex** 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_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.
[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 | magmaDoubleComplex** 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_zprint_matrix | ( | magma_z_matrix | A, |
magma_queue_t | queue ) |
Prints a sparse matrix in CSR format.
[in] | A | magma_z_matrix sparse matrix in Magma_CSR format |
[in] | queue | magma_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.
[out] | A | magma_z_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_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!
[out] | A | magma_z_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_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.
[in] | L | magma_z_matrix input strictly lower triangular matrix L |
[in] | U | magma_z_matrix input upper triangular matrix U |
[out] | A | magma_z_matrix* output matrix |
[in] | queue | magma_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.
[in,out] | A | magma_z_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_zmscale_matrix_rhs | ( | magma_z_matrix * | A, |
magma_z_matrix * | b, | ||
magma_z_matrix * | scaling_factors, | ||
magma_scale_t | scaling, | ||
magma_queue_t | queue ) |
Scales a matrix and a right hand side vector of a Ax = b system.
[in,out] | A | magma_z_matrix* input/output matrix |
[in,out] | b | magma_z_matrix* input/output right hand side vector |
[out] | scaling_factors | magma_z_matrix* output scaling factors vector |
[in] | scaling | magma_scale_t scaling type (unit rownorm / unit diagonal) |
[in] | queue | magma_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.
[in,out] | A | magma_z_matrix* input/output matrix |
[in] | add | magmaDoubleComplex scaling for the identity matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmscale_generate | ( | magma_int_t | n, |
magma_scale_t * | scaling, | ||
magma_side_t * | side, | ||
magma_z_matrix * | A, | ||
magma_z_matrix * | scaling_factors, | ||
magma_queue_t | queue ) |
Generates n vectors of scaling factors from the A matrix and stores them in the factors matrix as column vectors in column major ordering.
[in] | n | magma_int_t number of diagonal scaling matrices |
[in] | scaling | magma_scale_t* array of scaling specifiers |
[in] | side | magma_side_t* array of side specifiers |
[in] | A | magma_z_matrix* input matrix |
[out] | scaling_factors | magma_z_matrix* array of diagonal matrices |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmscale_apply | ( | magma_int_t | n, |
magma_side_t * | side, | ||
magma_z_matrix * | scaling_factors, | ||
magma_z_matrix * | A, | ||
magma_queue_t | queue ) |
Applies n diagonal scaling matrices to a matrix A; n=[1,2], factor[i] is applied to side[i] of the matrix.
[in] | n | magma_int_t number of diagonal scaling matrices |
[in] | side | magma_side_t* array of side specifiers |
[in] | scaling_factors | magma_z_matrix* array of diagonal matrices |
[in,out] | A | magma_z_matrix* input/output matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zdimv | ( | magma_z_matrix * | vecA, |
magma_z_matrix * | vecB, | ||
magma_queue_t | queue ) |
Multiplies a diagonal matrix (vecA) and a vector (vecB).
[in] | vecA | magma_z_matrix* input matrix |
[in,out] | vecB | magma_z_matrix* input/output matrix |
[in] | queue | magma_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.
[in] | A | magma_z_matrix sparse matrix A |
[out] | B | magma_z_matrix* sparse matrix A |
[in] | queue | magma_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.
[in] | num_slices | magma_int_t number of slices |
[in] | slice | magma_int_t slice id (0.. num_slices-1) |
[in] | A | magma_z_matrix sparse matrix in CSR |
[out] | B | magma_z_matrix* sparse matrix in CSR |
[out] | ALOC | magma_z_matrix* sparse matrix in CSR |
[out] | ANLOC | magma_z_matrix* sparse matrix in CSR |
[in,out] | comm_i | magma_int_t* communication plan |
[in,out] | comm_v | magmaDoubleComplex* 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_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.
[in,out] | max_bs | magma_int_t* Size of the largest diagonal block. |
[in] | A | magma_z_matrix System matrix. |
[in,out] | S | magma_z_matrix* Generated sparsity pattern matrix. |
[in] | queue | magma_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.
[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_z_matrix* Generated sparsity pattern matrix. |
[in] | queue | magma_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.
[in] | A | magma_z_matrix sparse matrix A |
[out] | B | magma_z_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 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.
[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 | magmaDoubleComplex* 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 | magmaDoubleComplex** 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_zmtranspose | ( | magma_z_matrix | A, |
magma_z_matrix * | B, | ||
magma_queue_t | queue ) |
Interface to cuSPARSE transpose.
[in] | A | magma_z_matrix input matrix (CSR) |
[out] | B | magma_z_matrix* output matrix (CSR) |
[in] | queue | magma_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.
[in] | A | magma_z_matrix input matrix (CSR) |
[out] | B | magma_z_matrix* output matrix (CSR) |
[in] | queue | magma_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.
[in] | A | magma_z_matrix input matrix (CSR) |
[out] | B | magma_z_matrix* output matrix (CSR) |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmtranspose_cpu | ( | magma_z_matrix | A, |
magma_z_matrix * | B, | ||
magma_queue_t | queue ) |
Generates a transpose of A on the CPU.
[in] | A | magma_z_matrix input matrix (CSR) |
[out] | B | magma_z_matrix* output matrix (CSR) |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmtransposeconj_cpu | ( | magma_z_matrix | A, |
magma_z_matrix * | B, | ||
magma_queue_t | queue ) |
Generates a transpose conjugate of A on the CPU.
[in] | A | magma_z_matrix input matrix (CSR) |
[out] | B | magma_z_matrix* output matrix (CSR) |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmtransposestruct_cpu | ( | magma_z_matrix | A, |
magma_z_matrix * | B, | ||
magma_queue_t | queue ) |
Generates a transpose of the nonzero pattern of A on the CPU.
[in] | A | magma_z_matrix input matrix (CSR) |
[out] | B | magma_z_matrix* output matrix (CSR) |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmtransposeabs_cpu | ( | magma_z_matrix | A, |
magma_z_matrix * | B, | ||
magma_queue_t | queue ) |
Generates a transpose with absolute values of A on the CPU.
[in] | A | magma_z_matrix input matrix (CSR) |
[out] | B | magma_z_matrix* output matrix (CSR) |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparic_sweep | ( | magma_z_matrix | A, |
magma_z_matrix * | L, | ||
magma_queue_t | queue ) |
This function does one asynchronous ParILU sweep (symmetric case).
Input and output array is identical.
[in] | A | magma_z_matrix System matrix in COO. |
[in] | L | magma_z_matrix* Current approximation for the lower triangular factor The format is sorted CSR. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparic_sweep_sync | ( | magma_z_matrix | A, |
magma_z_matrix * | L, | ||
magma_queue_t | queue ) |
This function does one synchronized ParILU sweep (symmetric case).
Input and output are different arrays.
[in] | A | magma_z_matrix System matrix in COO. |
[in] | L | magma_z_matrix* Current approximation for the lower triangular factor The format is sorted CSR. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparict_candidates | ( | magma_z_matrix | L0, |
magma_z_matrix | L, | ||
magma_z_matrix | LT, | ||
magma_z_matrix * | L_new, | ||
magma_queue_t | queue ) |
This function identifies the candidates like they appear as ILU1 fill-in.
In this version, the matrices are assumed unordered, the linked list is traversed to acces the entries of a row.
[in] | L0 | magma_z_matrix tril( ILU(0) ) pattern of original system matrix. |
[in] | L | magma_z_matrix Current lower triangular factor. |
[in] | LT | magma_z_matrix Transose of the lower triangular factor. |
[in,out] | L_new | magma_z_matrix* List of candidates for L in COO format. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparict_sweep_sync | ( | magma_z_matrix * | A, |
magma_z_matrix * | L, | ||
magma_queue_t | queue ) |
This function does one synchronized ParILU sweep.
Input and output are different arrays.
[in] | A | magma_z_matrix* System matrix. |
[in] | L | magma_z_matrix* Current approximation for the lower triangular factor The format is sorted CSR. |
[in] | U | magma_z_matrix* Current approximation for the upper triangular factor The format is sorted CSC. |
[out] | L_new | magma_z_matrix* Current approximation for the lower triangular factor The format is unsorted CSR. |
[out] | U_new | magma_z_matrix* Current approximation for the upper triangular factor The format is unsorted CSC. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilu_sweep | ( | magma_z_matrix | A, |
magma_z_matrix * | L, | ||
magma_z_matrix * | U, | ||
magma_queue_t | queue ) |
This function does one asynchronous ParILU sweep.
Input and output array are identical.
[in] | A | magma_z_matrix System matrix in COO. |
[in] | L | magma_z_matrix* Current approximation for the lower triangular factor The format is sorted CSR. |
[in] | U | magma_z_matrix* Current approximation for the upper triangular factor The format is sorted CSC (U^T in CSR). |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilu_sweep_sync | ( | magma_z_matrix | A, |
magma_z_matrix * | L, | ||
magma_z_matrix * | U, | ||
magma_queue_t | queue ) |
This function does one synchronized ParILU sweep.
Input and output are different arrays.
[in] | A | magma_z_matrix System matrix in COO. |
[in] | L | magma_z_matrix* Current approximation for the lower triangular factor The format is sorted CSR. |
[in] | U | magma_z_matrix* Current approximation for the upper triangular factor The format is sorted CSC (U^T in CSR). |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_sweep | ( | magma_z_matrix * | A, |
magma_z_matrix * | L, | ||
magma_z_matrix * | U, | ||
magma_queue_t | queue ) |
This function does an ParILUT sweep.
The difference to the ParILU sweep is that the nonzero pattern of A and the incomplete factors L and U can be different. The pattern determing which elements are iterated are hence the pattern of L and U, not A.
This is the CPU version of the asynchronous ParILUT sweep.
[in] | A | magma_z_matrix* System matrix. The format is sorted CSR. |
[in,out] | L | magma_z_matrix* Current approximation for the lower triangular factor The format is MAGMA_CSRCOO. This is sorted CSR plus the rowindexes being stored. |
[in,out] | U | magma_z_matrix* Current approximation for the lower triangular factor The format is MAGMA_CSRCOO. This is sorted CSR plus the rowindexes being stored. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_sweep_sync | ( | magma_z_matrix * | A, |
magma_z_matrix * | L, | ||
magma_z_matrix * | U, | ||
magma_queue_t | queue ) |
This function does an ParILUT sweep.
The difference to the ParILU sweep is that the nonzero pattern of A and the incomplete factors L and U can be different. The pattern determing which elements are iterated are hence the pattern of L and U, not A.
This is the CPU version of the synchronous ParILUT sweep.
[in] | A | magma_z_matrix* System matrix. The format is sorted CSR. |
[in,out] | L | magma_z_matrix* Current approximation for the lower triangular factor The format is MAGMA_CSRCOO. This is sorted CSR plus the rowindexes being stored. |
[in,out] | U | magma_z_matrix* Current approximation for the lower triangular factor The format is MAGMA_CSRCOO. This is sorted CSR plus the rowindexes being stored. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_residuals | ( | magma_z_matrix | A, |
magma_z_matrix | L, | ||
magma_z_matrix | U, | ||
magma_z_matrix * | R, | ||
magma_queue_t | queue ) |
This function computes the ILU residual in the locations included in the sparsity pattern of R.
[in] | A | magma_z_matrix System matrix A. |
[in] | L | magma_z_matrix Current approximation for the lower triangular factor. The format is sorted CSR. |
[in] | U | magma_z_matrix Current approximation for the upper triangular factor. The format is sorted CSR. |
[in,out] | R | magma_z_matrix* Sparsity pattern on which the ILU residual is computed. R is in COO format. On output, R contains the ILU residual. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_thrsrm | ( | magma_int_t | order, |
magma_z_matrix * | A, | ||
double * | thrs, | ||
magma_queue_t | queue ) |
Removes any element with absolute value smaller equal or larger equal thrs from the matrix and compacts the whole thing.
[in] | order | magma_int_t order == 1: all elements smaller are discarded order == 0: all elements larger are discarded |
[in,out] | A | magma_z_matrix* Matrix where elements are removed. |
[in] | thrs | double* Threshold: all elements smaller are discarded |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_thrsrm_U | ( | magma_int_t | order, |
magma_z_matrix | L, | ||
magma_z_matrix * | A, | ||
double * | thrs, | ||
magma_queue_t | queue ) |
Removes any element with absolute value smaller equal or larger equal thrs from the matrix and compacts the whole thing.
[in] | order | magma_int_t order == 1: all elements smaller are discarded order == 0: all elements larger are discarded |
[in,out] | A | magma_z_matrix* Matrix where elements are removed. |
[in] | thrs | double* Threshold: all elements smaller are discarded |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_thrsrm_semilinked | ( | magma_z_matrix * | U, |
magma_z_matrix * | US, | ||
double * | thrs, | ||
magma_queue_t | queue ) |
Removes any element with absolute value smaller thrs from the matrix.
It only uses the linked list and skips the `‘removed’' elements
[in,out] | A | magma_z_matrix* Matrix where elements are removed. |
[in] | thrs | double* Threshold: all elements smaller are discarded |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_rmselected | ( | magma_z_matrix | R, |
magma_z_matrix * | A, | ||
magma_queue_t | queue ) |
Removes a selected list of elements from the matrix.
[in] | R | magma_z_matrix Matrix containing elements to be removed. |
[in,out] | A | magma_z_matrix* Matrix where elements are removed. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_selectoneperrow | ( | magma_int_t | order, |
magma_z_matrix * | A, | ||
magma_z_matrix * | oneA, | ||
magma_queue_t | queue ) |
This function takes a list of candidates with residuals, and selects the largest in every row.
The output matrix only contains these largest elements (respectively a zero element if there is no candidate for a certain row).
[in] | order | magma_int_t order==1 -> largest order==0 -> smallest |
[in] | A | magma_z_matrix* Matrix where elements are removed. |
[out] | oneA | magma_z_matrix* Matrix where elements are removed. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_selecttwoperrow | ( | magma_int_t | order, |
magma_z_matrix * | A, | ||
magma_z_matrix * | oneA, | ||
magma_queue_t | queue ) |
This function takes a list of candidates with residuals, and selects the largest in every row.
The output matrix only contains these largest elements (respectively a zero element if there is no candidate for a certain row).
[in] | order | magma_int_t order==1 -> largest order==0 -> smallest |
[in] | A | magma_z_matrix* Matrix where elements are removed. |
[out] | oneA | magma_z_matrix* Matrix where elements are removed. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_selectoneperrowthrs_lower | ( | magma_z_matrix | L, |
magma_z_matrix | U, | ||
magma_z_matrix * | A, | ||
double | rtol, | ||
magma_z_matrix * | oneA, | ||
magma_queue_t | queue ) |
This function takes a list of candidates with residuals, and selects the largest in every row.
The output matrix only contains these largest elements (respectively a zero element if there is no candidate for a certain row).
[in] | L | magma_z_matrix Current lower triangular factor. |
[in] | U | magma_z_matrix Current upper triangular factor. |
[in] | A | magma_z_matrix* All residuals in L. |
[in] | rtol | threshold rtol |
[out] | oneA | magma_z_matrix* at most one per row, if larger thrs. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_selectoneperrowthrs_upper | ( | magma_z_matrix | L, |
magma_z_matrix | U, | ||
magma_z_matrix * | A, | ||
double | rtol, | ||
magma_z_matrix * | oneA, | ||
magma_queue_t | queue ) |
This function takes a list of candidates with residuals, and selects the largest in every row.
The output matrix only contains these largest elements (respectively a zero element if there is no candidate for a certain row).
[in] | L | magma_z_matrix Current lower triangular factor. |
[in] | U | magma_z_matrix Current upper triangular factor. |
[in] | A | magma_z_matrix* All residuals in L. |
[in] | rtol | threshold rtol |
[out] | oneA | magma_z_matrix* at most one per row, if larger thrs. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_preselect | ( | magma_int_t | order, |
magma_z_matrix * | A, | ||
magma_z_matrix * | oneA, | ||
magma_queue_t | queue ) |
This function takes a list of candidates with residuals, and selects the largest in every row.
The output matrix only contains these largest elements (respectively a zero element if there is no candidate for a certain row).
[in] | order | magma_int_t order==0 lower triangular order==1 upper triangular |
[in] | A | magma_z_matrix* Matrix where elements are removed. |
[out] | oneA | magma_z_matrix* Matrix where elements are removed. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_preselect_scale | ( | magma_z_matrix * | L, |
magma_z_matrix * | oneL, | ||
magma_z_matrix * | U, | ||
magma_z_matrix * | oneU, | ||
magma_queue_t | queue ) |
This function takes a list of candidates with residuals, and selects the largest in every row.
The output matrix only contains these largest elements (respectively a zero element if there is no candidate for a certain row).
[in] | L | magma_z_matrix* Matrix where elements are removed. |
[in] | U | magma_z_matrix* Matrix where elements are removed. |
[out] | oneL | magma_z_matrix* Matrix where elements are removed. |
[out] | oneU | magma_z_matrix* Matrix where elements are removed. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_transpose | ( | magma_z_matrix | A, |
magma_z_matrix * | B, | ||
magma_queue_t | queue ) |
Transposes a matrix that already contains rowidx.
The idea is to use a linked list.
[in] | A | magma_z_matrix Matrix to transpose. |
[out] | B | magma_z_matrix* Transposed matrix. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_transpose_select_one | ( | magma_z_matrix | A, |
magma_z_matrix * | B, | ||
magma_queue_t | queue ) |
This is a special routine with very limited scope.
For a set of fill-in candidates in row-major format, it transposes the a submatrix, i.e. the submatrix consisting of the largest element in every column. This function is only useful for delta<=1.
[in] | A | magma_z_matrix Matrix to transpose. |
[out] | B | magma_z_matrix* Transposed matrix containing only largest elements in each col. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_create_collinkedlist | ( | magma_z_matrix | A, |
magma_z_matrix * | B, | ||
magma_queue_t | queue ) |
For the matrix U in CSR (row-major) this creates B containing a row-ptr to the columns and a linked list for the elements.
[in] | A | magma_z_matrix Matrix to transpose. |
[out] | B | magma_z_matrix* Transposed matrix. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_sweep_semilinked | ( | magma_z_matrix * | A, |
magma_z_matrix * | L, | ||
magma_z_matrix * | US, | ||
magma_queue_t | queue ) |
This function does an ParILU sweep.
[in,out] | A | magma_z_matrix* Current ILU approximation The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in,out] | L | magma_z_matrix* Current approximation for the lower triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in,out] | U | magma_z_matrix* Current approximation for the upper triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_sweep_list | ( | magma_z_matrix * | A, |
magma_z_matrix * | L, | ||
magma_z_matrix * | U, | ||
magma_queue_t | queue ) |
This function does an ParILU sweep.
[in,out] | A | magma_z_matrix* Current ILU approximation The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in,out] | L | magma_z_matrix* Current approximation for the lower triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in,out] | U | magma_z_matrix* Current approximation for the upper triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_residuals_semilinked | ( | magma_z_matrix | A, |
magma_z_matrix | L, | ||
magma_z_matrix | US, | ||
magma_z_matrix * | L_new, | ||
magma_queue_t | queue ) |
This function computes the residuals.
[in,out] | L | magma_z_matrix Current approximation for the lower triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in,out] | U | magma_z_matrix* Current approximation for the upper triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_residuals_transpose | ( | magma_z_matrix | A, |
magma_z_matrix | L, | ||
magma_z_matrix | U, | ||
magma_z_matrix * | U_new, | ||
magma_queue_t | queue ) |
This function computes the residuals.
[in,out] | L | magma_z_matrix Current approximation for the lower triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in,out] | U | magma_z_matrix* Current approximation for the upper triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_residuals_list | ( | magma_z_matrix | A, |
magma_z_matrix | L, | ||
magma_z_matrix | U, | ||
magma_z_matrix * | L_new, | ||
magma_queue_t | queue ) |
This function computes the residuals.
[in,out] | L | magma_z_matrix Current approximation for the lower triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in,out] | U | magma_z_matrix* Current approximation for the upper triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_sweep_linkedlist | ( | magma_z_matrix * | A, |
magma_z_matrix * | L, | ||
magma_z_matrix * | U, | ||
magma_queue_t | queue ) |
This function does an ParILU sweep.
[in,out] | A | magma_z_matrix* Current ILU approximation The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in,out] | L | magma_z_matrix* Current approximation for the lower triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in,out] | U | magma_z_matrix* Current approximation for the upper triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_residuals_linkedlist | ( | magma_z_matrix | A, |
magma_z_matrix | L, | ||
magma_z_matrix | U, | ||
magma_z_matrix * | L_new, | ||
magma_queue_t | queue ) |
This function computes the residuals.
[in,out] | L | magma_z_matrix Current approximation for the lower triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in,out] | U | magma_z_matrix* Current approximation for the upper triangular factor The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_colmajor | ( | magma_z_matrix | A, |
magma_z_matrix * | AC, | ||
magma_queue_t | queue ) |
This function creates a col-pointer and a linked list along the columns for a row-major CSR matrix.
[in] | A | magma_z_matrix The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in,out] | AC | magma_z_matrix* The matrix A but with row-pointer being for col-major, same with linked list. The values, col and row indices are unchanged. The respective pointers point to the entities of A. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_reorder | ( | magma_z_matrix * | LU, |
magma_queue_t | queue ) |
This routine reorders the matrix (inplace) for easier access.
[in] | LU | magma_z_matrix* Current ILU approximation. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_colmajorup | ( | magma_z_matrix | A, |
magma_z_matrix * | AC, | ||
magma_queue_t | queue ) |
This function creates a col-pointer and a linked list along the columns for a row-major CSR matrix.
[in] | A | magma_z_matrix The format is unsorted CSR, the list array is used as linked list pointing to the respectively next entry. |
[in,out] | AC | magma_z_matrix* The matrix A but with row-pointer being for col-major, same with linked list. The values, col and row indices are unchanged. The respective pointers point to the entities of A. Already allocated. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_insert | ( | magma_int_t * | num_rmL, |
magma_int_t * | num_rmU, | ||
magma_index_t * | rm_locL, | ||
magma_index_t * | rm_locU, | ||
magma_z_matrix * | L_new, | ||
magma_z_matrix * | U_new, | ||
magma_z_matrix * | L, | ||
magma_z_matrix * | U, | ||
magma_z_matrix * | UR, | ||
magma_queue_t | queue ) |
Inserts for the iterative dynamic ILU an new element in the (empty) place.
[in] | num_rmL | magma_int_t Number of Elements that are replaced in L. |
[in] | num_rmU | magma_int_t Number of Elements that are replaced in U. |
[in] | rm_locL | magma_index_t* List containing the locations of the deleted elements. |
[in] | rm_locU | magma_index_t* List containing the locations of the deleted elements. |
[in] | L_new | magma_z_matrix Elements that will be inserted in L stored in COO format (unsorted). |
[in] | U_new | magma_z_matrix Elements that will be inserted in U stored in COO format (unsorted). |
[in,out] | L | magma_z_matrix* matrix where new elements are inserted. The format is unsorted CSR, list is used as linked list pointing to the respectively next entry. |
[in,out] | U | magma_z_matrix* matrix where new elements are inserted. Row-major. The format is unsorted CSR, list is used as linked list pointing to the respectively next entry. |
[in,out] | UR | magma_z_matrix* Same matrix as U, but column-major. The format is unsorted CSR, list is used as linked list pointing to the respectively next entry. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_candidates | ( | magma_z_matrix | L0, |
magma_z_matrix | U0, | ||
magma_z_matrix | L, | ||
magma_z_matrix | U, | ||
magma_z_matrix * | L_new, | ||
magma_z_matrix * | U_new, | ||
magma_queue_t | queue ) |
This function identifies the candidates like they appear as ILU1 fill-in.
In this version, the matrices are assumed unordered, the linked list is traversed to acces the entries of a row.
[in] | L0 | magma_z_matrix tril( ILU(0) ) pattern of original system matrix. |
[in] | U0 | magma_z_matrix triu( ILU(0) ) pattern of original system matrix. |
[in] | L | magma_z_matrix Current lower triangular factor. |
[in] | U | magma_z_matrix Current upper triangular factor. |
[in,out] | LU_new | magma_z_matrix* List of candidates for L in COO format. |
[in,out] | LU_new | magma_z_matrix* List of candidates for U in COO format. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_candidates_semilinked | ( | magma_z_matrix | L0, |
magma_z_matrix | U0, | ||
magma_z_matrix | L, | ||
magma_z_matrix | U, | ||
magma_z_matrix | UT, | ||
magma_z_matrix * | L_new, | ||
magma_z_matrix * | U_new, | ||
magma_queue_t | queue ) |
This function identifies the candidates like they appear as ILU1 fill-in.
In this version, the matrices are assumed unordered, the linked list is traversed to acces the entries of a row.
[in] | L0 | magma_z_matrix tril( ILU(0) ) pattern of original system matrix. |
[in] | U0 | magma_z_matrix triu( ILU(0) ) pattern of original system matrix. |
[in] | L | magma_z_matrix Current lower triangular factor. |
[in] | U | magma_z_matrix Current upper triangular factor transposed. |
[in] | UR | magma_z_matrix Current upper triangular factor - col-pointer and col-list. |
[in,out] | LU_new | magma_z_matrix* List of candidates for L in COO format. |
[in,out] | LU_new | magma_z_matrix* List of candidates for U in COO format. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_rm_thrs | ( | double * | thrs, |
magma_int_t * | num_rm, | ||
magma_z_matrix * | LU, | ||
magma_z_matrix * | LU_new, | ||
magma_index_t * | rm_loc, | ||
magma_queue_t | queue ) |
This routine removes matrix entries from the structure that are smaller than the threshold.
It only counts the elements deleted, does not save the locations.
[out] | thrs | magmaDoubleComplex* Thrshold for removing elements. |
[out] | num_rm | magma_int_t* Number of Elements that have been removed. |
[in,out] | LU | magma_z_matrix* Current ILU approximation where the identified smallest components are deleted. |
[in,out] | LUC | magma_z_matrix* Corresponding col-list. |
[in,out] | LU_new | magma_z_matrix* List of candidates in COO format. |
[out] | rm_loc | magma_index_t* List containing the locations of the elements deleted. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_count | ( | magma_z_matrix | L, |
magma_int_t * | num, | ||
magma_queue_t | queue ) |
This is a helper routine counting elements in a matrix in unordered Magma_CSRLIST format.
[in] | L | magma_z_matrix* Matrix in Magm_CSRLIST format |
[out] | num | magma_index_t* Number of elements counted. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_select_candidates_L | ( | magma_int_t * | num_rm, |
magma_index_t * | rm_loc, | ||
magma_z_matrix * | L_new, | ||
magma_queue_t | queue ) |
Screens the new candidates for multiple elements in the same row.
We allow for at most one new element per row. This changes the algorithm, but pays off in performance.
[in] | num_rmL | magma_int_t Number of Elements that are replaced. |
[in] | num_rmU | magma_int_t Number of Elements that are replaced. |
[in] | rm_loc | magma_int_t* Number of Elements that are replaced by distinct threads. |
[in] | L_new | magma_z_matrix* Elements that will be inserted stored in COO format (unsorted). |
[in] | U_new | magma_z_matrix* Elements that will be inserted stored in COO format (unsorted). |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_select_candidates_U | ( | magma_int_t * | num_rm, |
magma_index_t * | rm_loc, | ||
magma_z_matrix * | L_new, | ||
magma_queue_t | queue ) |
Screens the new candidates for multiple elements in the same row.
We allow for at most one new element per row. This changes the algorithm, but pays off in performance.
[in] | num_rmL | magma_int_t Number of Elements that are replaced. |
[in] | num_rmU | magma_int_t Number of Elements that are replaced. |
[in] | rm_loc | magma_int_t* Number of Elements that are replaced by distinct threads. |
[in] | L_new | magma_z_matrix* Elements that will be inserted stored in COO format (unsorted). |
[in] | U_new | magma_z_matrix* Elements that will be inserted stored in COO format (unsorted). |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_set_approx_thrs | ( | magma_int_t | num_rm, |
magma_z_matrix * | LU, | ||
magma_int_t | order, | ||
double * | thrs, | ||
magma_queue_t | queue ) |
This routine approximates the threshold for removing num_rm elements.
[in] | num_rm | magma_int_t Number of Elements that are replaced. |
[in] | LU | magma_z_matrix* Current ILU approximation. |
[in] | order | magma_int_t Sort goal function: 0 = smallest, 1 = largest. |
[out] | thrs | magmaDoubleComplex* Size of the num_rm-th smallest element. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_set_thrs_randomselect | ( | magma_int_t | num_rm, |
magma_z_matrix * | LU, | ||
magma_int_t | order, | ||
double * | thrs, | ||
magma_queue_t | queue ) |
This routine approximates the threshold for removing num_rm elements.
[in] | num_rm | magma_int_t Number of Elements that are replaced. |
[in] | LU | magma_z_matrix* Current ILU approximation. |
[in] | order | magma_int_t Sort goal function: 0 = smallest, 1 = largest. |
[out] | thrs | double* Size of the num_rm-th smallest element. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_set_thrs_L_scaled | ( | magma_int_t | num_rm, |
magma_z_matrix * | L, | ||
magma_z_matrix * | U, | ||
magma_int_t | order, | ||
double * | thrs, | ||
magma_queue_t | queue ) |
This routine approximates the threshold for removing num_rm elements.
It takes into account the scaling with the diagonal.
[in] | num_rm | magma_int_t Number of Elements that are replaced. |
[in] | L | magma_z_matrix* Current L approximation. |
[in] | U | magma_z_matrix* Current U approximation. |
[in] | order | magma_int_t Sort goal function: 0 = smallest, 1 = largest. |
[out] | thrs | double* Size of the num_rm-th smallest element. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_set_thrs_randomselect_approx2 | ( | magma_int_t | num_rm, |
magma_z_matrix * | LU, | ||
magma_int_t | order, | ||
double * | thrs, | ||
magma_queue_t | queue ) |
This routine approximates the threshold for removing num_rm elements.
[in] | num_rm | magma_int_t Number of Elements that are replaced. |
[in] | LU | magma_z_matrix* Current ILU approximation. |
[in] | order | magma_int_t Sort goal function: 0 = smallest, 1 = largest. |
[out] | thrs | double* Size of the num_rm-th smallest element. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_set_thrs_randomselect_approx | ( | magma_int_t | num_rm, |
magma_z_matrix * | LU, | ||
magma_int_t | order, | ||
double * | thrs, | ||
magma_queue_t | queue ) |
This routine approximates the threshold for removing num_rm elements.
[in] | num_rm | magma_int_t Number of Elements that are replaced. |
[in] | LU | magma_z_matrix* Current ILU approximation. |
[in] | order | magma_int_t Sort goal function: 0 = smallest, 1 = largest. |
[out] | thrs | double* Size of the num_rm-th smallest element. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_set_thrs_randomselect_factors | ( | magma_int_t | num_rm, |
magma_z_matrix * | L, | ||
magma_z_matrix * | U, | ||
magma_int_t | order, | ||
double * | thrs, | ||
magma_queue_t | queue ) |
This routine approximates the threshold for removing num_rm elements.
[in] | num_rm | magma_int_t Number of Elements that are replaced. |
[in] | LU | magma_z_matrix* Current ILU approximation. |
[in] | order | magma_int_t Sort goal function: 0 = smallest, 1 = largest. |
[out] | thrs | double* Size of the num_rm-th smallest element. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_set_exact_thrs | ( | magma_int_t | num_rm, |
magma_z_matrix * | LU, | ||
magma_int_t | order, | ||
magmaDoubleComplex * | thrs, | ||
magma_queue_t | queue ) |
This routine provides the exact threshold for removing num_rm elements.
[in] | num_rm | magma_int_t Number of Elements that are replaced. |
[in] | LU | magma_z_matrix* Current ILU approximation. |
[in] | order | magma_int_t Sort goal function: 0 = smallest, 1 = largest. |
[out] | thrs | magmaDoubleComplex* Size of the num_rm-th smallest element. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_set_approx_thrs_inc | ( | magma_int_t | num_rm, |
magma_z_matrix * | LU, | ||
magma_int_t | order, | ||
magmaDoubleComplex * | thrs, | ||
magma_queue_t | queue ) |
This routine provides the exact threshold for removing num_rm elements.
[in] | num_rm | magma_int_t Number of Elements that are replaced. |
[in] | LU | magma_z_matrix* Current ILU approximation. |
[in] | order | magma_int_t Sort goal function: 0 = smallest, 1 = largest. |
[out] | thrs | magmaDoubleComplex* Size of the num_rm-th smallest element. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_align_residuals | ( | magma_z_matrix | L, |
magma_z_matrix | U, | ||
magma_z_matrix * | Lnew, | ||
magma_z_matrix * | Unew, | ||
magma_queue_t | queue ) |
This function scales the residuals of a lower triangular factor L with the diagonal of U.
The intention is to generate a good initial guess for inserting the elements.
[in] | L | magma_z_matrix Current approximation for the lower triangular factor The format is sorted CSR. |
[in] | U | magma_z_matrix Current approximation for the upper triangular factor The format is sorted CSC. |
[in] | hL | magma_z_matrix* Current approximation for the lower triangular factor The format is sorted CSR. |
[in] | hU | magma_z_matrix* Current approximation for the upper triangular factor The format is sorted CSC. |
[in] | queue | magma_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!
[in] | A | magma_z_matrix sparse matrix in CSR |
[in] | B | magma_z_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_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.
[in] | A | magma_z_matrix input sparse matrix in CSR |
[in] | L | magma_z_matrix input sparse matrix in CSR |
[in] | U | magma_z_matrix input sparse matrix in CSR |
[out] | LU | magma_z_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_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.
[in] | A | magma_z_matrix input sparse matrix in CSR |
[in] | L | magma_z_matrix input sparse matrix in CSR |
[in] | U | magma_z_matrix input sparse matrix in CSR |
[out] | LU | magma_z_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_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.
[in] | A | magma_z_matrix input sparse matrix in CSR |
[in] | C | magma_z_matrix input sparse matrix in CSR |
[in] | CT | magma_z_matrix input sparse matrix in CSR |
[in] | LU | magma_z_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_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.
[in] | A | magma_z_matrix sparse matrix in CSR |
[out] | L | magma_z_matrix* sparse matrix in CSR |
[out] | U | magma_z_matrix* sparse matrix in CSR |
[in] | queue | magma_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.
[in] | A | magma_z_matrix* sparse matrix in CSR |
[out] | B | magma_z_matrix* sparse matrix in CSR |
[in] | queue | magma_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.
[in,out] | L | magma_z_matrix* sparse matrix in CSR |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zselect | ( | magmaDoubleComplex * | a, |
magma_int_t | size, | ||
magma_int_t | k, | ||
magma_queue_t | queue ) |
An efficient implementation of Blum, Floyd, Pratt, Rivest, and Tarjan's worst-case linear selection algorithm.
Derrick Coetzee, webma.nosp@m.ster.nosp@m.@moon.nosp@m.flar.nosp@m.e.com January 22, 2004 http://moonflare.com/code/select/select.pdf
[in,out] | a | magmaDoubleComplex* array to select from |
[in] | size | magma_int_t size of array |
[in] | k | magma_int_t k-th smallest element |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zselectrandom | ( | magmaDoubleComplex * | a, |
magma_int_t | size, | ||
magma_int_t | k, | ||
magma_queue_t | queue ) |
An efficient implementation of Blum, Floyd, Pratt, Rivest, and Tarjan's worst-case linear selection algorithm.
Derrick Coetzee, webma.nosp@m.ster.nosp@m.@moon.nosp@m.flar.nosp@m.e.com January 22, 2004 http://moonflare.com/code/select/select.pdf
[in,out] | a | magmaDoubleComplex* array to select from |
[in] | size | magma_int_t size of array |
[in] | k | magma_int_t k-th smallest element |
[in] | queue | magma_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.
[in] | solver_par | magma_z_solver_par* structure containing all solver information |
[in,out] | precond_par | magma_z_preconditioner* structure containing all preconditioner information |
[in] | queue | magma_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.
[in,out] | solver_par | magma_z_solver_par* structure containing all solver information |
[in,out] | precond_par | magma_z_preconditioner* structure containing all preconditioner information |
[in] | queue | magma_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.
[in,out] | solver_par | magma_z_solver_par* structure containing all solver information |
[in,out] | precond_par | magma_z_preconditioner* structure containing all preconditioner information |
[in] | queue | magma_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.
[in,out] | solver_par | magma_z_solver_par* structure containing all solver information |
[in] | queue | magma_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.
[in,out] | x | magmaDoubleComplex* 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_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.
[in,out] | x | magmaDoubleComplex* 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_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.
[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_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.
[in,out] | x | magma_index_t* array to sort |
[in,out] | y | magmaDoubleComplex* 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_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.
[in,out] | val | magmaDoubleComplex* 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 | magmaDoubleComplex* location of the respective element |
[in] | queue | magma_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.
[in,out] | val | magmaDoubleComplex* 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 | magmaDoubleComplex* location of the respective element |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zorderstatistics_inc | ( | magmaDoubleComplex * | val, |
magma_int_t | length, | ||
magma_int_t | k, | ||
magma_int_t | inc, | ||
magma_int_t | r, | ||
magmaDoubleComplex * | element, | ||
magma_queue_t | queue ) |
Approximates the k-th smallest element in an array by using order-statistics with step-size inc.
[in,out] | val | magmaDoubleComplex* 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] | inc | magma_int_t Stepsize in the approximation. |
[in] | r | magma_int_t rule how to sort: '1' -> largest, '0' -> smallest |
[out] | element | magmaDoubleComplex* location of the respective element |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zbitonic_sort | ( | magma_int_t | start, |
magma_int_t | length, | ||
magmaDoubleComplex * | seq, | ||
magma_int_t | flag, | ||
magma_queue_t | queue ) |
Approximates the k-th smallest element in an array by using order-statistics with step-size inc.
[in] | start | magma_int_t Start position of the target array. |
[in] | length | magma_int_t Length of the target array. |
[in,out] | seq | magmaDoubleComplex* Target array, will be modified during operation. |
[in] | flag | magma_int_t ??? |
[in] | queue | magma_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.
[in] | argc | int command line input |
[in] | argv | char** command line input |
[in,out] | opts | magma_zopts * 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_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.
[out] | x | magma_z_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 | magmaDoubleComplex entries in vector |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zvinit_rand | ( | magma_z_matrix * | x, |
magma_location_t | mem_loc, | ||
magma_int_t | num_rows, | ||
magma_int_t | num_cols, | ||
magma_queue_t | queue ) |
Allocates memory for magma_z_matrix and initializes it with random values.
[out] | x | magma_z_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] | queue | magma_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.
[in] | x | magma_z_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_zvread | ( | magma_z_matrix * | x, |
magma_int_t | length, | ||
char * | filename, | ||
magma_queue_t | queue ) |
Reads in a double vector of length "length".
[out] | x | magma_z_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_zvspread | ( | magma_z_matrix * | x, |
const char * | filename, | ||
magma_queue_t | queue ) |
Reads in a sparse vector-block stored in COO format.
[out] | x | magma_z_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_zwrite_vector | ( | magma_z_matrix | A, |
const char * | filename, | ||
magma_queue_t | queue ) |
Writes a vector to a file.
[in] | A | magma_z_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_zvset | ( | magma_int_t | m, |
magma_int_t | n, | ||
magmaDoubleComplex * | val, | ||
magma_z_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 | magmaDoubleComplex* array containing vector entries |
[out] | v | magma_z_matrix* magma vector |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zvcopy | ( | magma_z_matrix | v, |
magma_int_t * | m, | ||
magma_int_t * | n, | ||
magmaDoubleComplex * | val, | ||
magma_queue_t | queue ) |
Passes a MAGMA vector back.
This function requires the array val to be already allocated (of size m x n).
[in] | v | magma_z_matrix magma vector |
[out] | m | magma_int_t number of rows |
[out] | n | magma_int_t number of columns |
[out] | val | magmaDoubleComplex* array of size m x n the vector entries are copied into |
[in] | queue | magma_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).
[in] | m | magma_int_t number of rows |
[in] | n | magma_int_t number of columns |
[in] | val | magmaDoubleComplex* array containing vector entries |
[out] | v | magma_z_matrix* magma vector |
[in] | queue | magma_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.
[in] | v | magma_z_matrix magma vector |
[out] | m | magma_int_t number of rows |
[out] | n | magma_int_t number of columns |
[out] | val | magmaDoubleComplex* array containing vector entries |
[in] | queue | magma_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).
[in] | v | magma_z_matrix magma vector |
[out] | m | magma_int_t number of rows |
[out] | n | magma_int_t number of columns |
[out] | val | magmaDoubleComplex_ptr array containing vector entries |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zvcopy_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).
This function requires the array val to be already allocated (of size m x n).
[in] | v | magma_z_matrix magma vector |
[out] | m | magma_int_t number of rows |
[out] | n | magma_int_t number of columns |
[out] | val | magmaDoubleComplex* array of size m x n on the device the vector entries are copied into |
[in] | queue | magma_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.
[in] | x | magma_z_matrix input vector |
[out] | y | magma_z_matrix* output vector |
[in] | queue | magma_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.
[in] | dA | magma_z_matrix matrix in CSR format |
[in] | queue | magma_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
x | magma_z_matrix input vector descriptor | |
y | magma_c_vector* output vector descriptor | |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zmatrix_cup_gpu | ( | magma_z_matrix | A, |
magma_z_matrix | B, | ||
magma_z_matrix * | U, | ||
magma_queue_t | queue ) |
Generates a matrix \(U = A \cup B\).
If both matrices have a nonzero value in the same location, the value of A is used.
This is the GPU version of the operation.
[in] | A | magma_z_matrix Input matrix 1. |
[in] | B | magma_z_matrix Input matrix 2. |
[out] | U | magma_z_matrix* \(U = A \cup B\). If both matrices have a nonzero value in the same location, the value of A is used. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zcsr_sort_gpu | ( | magma_z_matrix * | A, |
magma_queue_t | queue ) |
Generates a matrix \(U = A \cup B\).
If both matrices have a nonzero value in the same location, the value of A is used.
This is the GPU version of the operation.
[in] | A | magma_z_matrix Input matrix 1. |
[in] | B | magma_z_matrix Input matrix 2. |
[out] | U | magma_z_matrix* \(U = A \cup B\). If both matrices have a nonzero value in the same location, the value of A is used. |
[in] | queue | magma_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.
[in,out] | A | magma_z_matrix* input/output matrix |
[in] | queue | magma_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.
[in,out] | A | magma_z_matrix* input/output matrix |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zpreselect_gpu | ( | magma_int_t | order, |
magma_z_matrix * | A, | ||
magma_z_matrix * | oneA, | ||
magma_queue_t | queue ) |
This function takes a list of candidates with residuals, and selects the largest in every row.
The output matrix only contains these largest elements (respectively a zero element if there is no candidate for a certain row).
[in] | order | magma_int_t order==0 lower triangular order==1 upper triangular |
[in] | A | magma_z_matrix* Matrix where elements are removed. |
[out] | oneA | magma_z_matrix* Matrix where elements are removed. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zsampleselect | ( | magma_int_t | total_size, |
magma_int_t | subset_size, | ||
magmaDoubleComplex * | val, | ||
double * | thrs, | ||
magma_ptr * | tmp_ptr, | ||
magma_int_t * | tmp_size, | ||
magma_queue_t | queue ) |
This routine selects a threshold separating the subset_size smallest magnitude elements from the rest.
[in] | total_size | magma_int_t size of array val |
[in] | subset_size | magma_int_t number of smallest elements to separate |
[in] | val | magmaDoubleComplex array containing the values |
[out] | thrs | double* computed threshold |
[in,out] | tmp_ptr | magma_ptr* pointer to pointer to temporary storage. May be reallocated during execution. |
[in,out] | tmp_size | magma_int_t* pointer to size of temporary storage. May be increased during execution. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zsampleselect_approx | ( | magma_int_t | total_size, |
magma_int_t | subset_size, | ||
magmaDoubleComplex * | val, | ||
double * | thrs, | ||
magma_ptr * | tmp_ptr, | ||
magma_int_t * | tmp_size, | ||
magma_queue_t | queue ) |
This routine selects an approximate threshold separating the subset_size smallest magnitude elements from the rest.
[in] | total_size | magma_int_t size of array val |
[in] | subset_size | magma_int_t number of smallest elements to separate |
[in] | val | magmaDoubleComplex array containing the values |
[out] | thrs | double* computed threshold |
[in,out] | tmp_ptr | magma_ptr* pointer to pointer to temporary storage. May be reallocated during execution. |
[in,out] | tmp_size | magma_int_t* pointer to size of temporary storage. May be increased during execution. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zsampleselect_nodp | ( | magma_int_t | total_size, |
magma_int_t | subset_size, | ||
magmaDoubleComplex * | val, | ||
double * | thrs, | ||
magma_ptr * | tmp_ptr, | ||
magma_int_t * | tmp_size, | ||
magma_queue_t | queue ) |
This routine selects a threshold separating the subset_size smallest magnitude elements from the rest.
This routine does not use dynamic parallelism (DP)
[in] | total_size | magma_int_t size of array val |
[in] | subset_size | magma_int_t number of smallest elements to separate |
[in] | val | magmaDoubleComplex array containing the values |
[out] | thrs | double* computed threshold |
[in,out] | tmp_ptr | magma_ptr* pointer to pointer to temporary storage. May be reallocated during execution. |
[in,out] | tmp_size | magma_int_t* pointer to size of temporary storage. May be increased during execution. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zsampleselect_approx_nodp | ( | magma_int_t | total_size, |
magma_int_t | subset_size, | ||
magmaDoubleComplex * | val, | ||
double * | thrs, | ||
magma_ptr * | tmp_ptr, | ||
magma_int_t * | tmp_size, | ||
magma_queue_t | queue ) |
This routine selects an approximate threshold separating the subset_size smallest magnitude elements from the rest.
This routine does not use dynamic parallelism (DP)
[in] | total_size | magma_int_t size of array val |
[in] | subset_size | magma_int_t number of smallest elements to separate |
[in] | val | magmaDoubleComplex array containing the values |
[out] | thrs | double* computed threshold |
[in,out] | tmp_ptr | magma_ptr* pointer to pointer to temporary storage. May be reallocated during execution. |
[in,out] | tmp_size | magma_int_t* pointer to size of temporary storage. May be increased during execution. |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zthrsholdselect | ( | magma_int_t | sampling, |
magma_int_t | total_size, | ||
magma_int_t | subset_size, | ||
magmaDoubleComplex * | val, | ||
double * | thrs, | ||
magma_queue_t | queue ) |
This routine selects a threshold separating the subset_size smallest magnitude elements from the rest.
Hilarious approach: Start a number of threads, each thread uses a pre-defined threshold, then checks for each element whether it is smaller than the threshold. In the end a global reduction identifies the threshold that is closest.
Assuming all values are in (0,1), the distinct thresholds are defined as:
threshold [ thread ] = thread / num_threads
We obviously need to launch many threads.
[in] | sampling | magma_int_t determines how many elements are considered (approximate method) |
[in] | total_size | magma_int_t size of array val |
[in] | subset_size | magma_int_t number of smallest elements to separate |
[in] | val | magmaDoubleComplex array containing the values |
[out] | thrs | float* computed threshold |
[in] | queue | magma_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.
[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_z_matrix* Generated sparsity pattern matrix. |
[in] | queue | magma_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.
[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_z_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 | magmaDoubleComplex* trisystems |
[out] | rhs | magmaDoubleComplex* right-hand sides |
[in] | queue | magma_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.
[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_z_matrix triangular factor for which the ISAI matrix is computed. Col-Major CSR storage. |
[in,out] | M | magma_z_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 | magmaDoubleComplex* trisystems |
[out] | rhs | magmaDoubleComplex* right-hand sides |
[in] | queue | magma_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.
[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_z_matrix triangular factor for which the ISAI matrix is computed. Col-Major CSR storage. |
[in,out] | M | magma_z_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 | magmaDoubleComplex* trisystems |
[out] | rhs | magmaDoubleComplex* right-hand sides |
[in] | queue | magma_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.
[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_z_matrix triangular factor for which the ISAI matrix is computed. Col-Major CSR storage. |
[in,out] | M | magma_z_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 | magmaDoubleComplex* trisystems |
[out] | rhs | magmaDoubleComplex* right-hand sides |
[in] | queue | magma_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_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_z_matrix triangular factor for which the ISAI matrix is computed. Col-Major CSR storage. |
[in,out] | M | magma_z_matrix* SPAI preconditioner CSR col-major |
[in] | queue | magma_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.
[in,out] | L | magma_z_matrix Incomplete factor. |
[in,out] | MT | magma_z_matrix* SPAI preconditioner structure, CSR col-major. |
[in] | queue | magma_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.
[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_z_matrix Matrix in CSR format |
[in] | LC | magma_z_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 | magmaDoubleComplex* trisystems |
[out] | rhs | magmaDoubleComplex* right-hand sides |
[in] | queue | magma_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.
[in] | M | INTEGER The number of lines of the matrix A. M >= 0. |
[in] | N | INTEGER The number of columns of the matrix A. N >= 0. |
[in] | A | COMPLEX_16 array, dimension (LDA,N) On entry, the M-by-N coefficient matrix A. |
[in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,M). |
[in,out] | SA | COMPLEX 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] | ldsa | INTEGER The leading dimension of the array SA. LDSA >= max(1,M). |
[in] | queue | magma_queue_t Queue to execute in. |
[in,out] | info | INTEGER
|
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] /
[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 | magmaDoubleComplex_ptr block of eigenvector approximations |
[in] | R | magmaDoubleComplex_ptr block of residuals |
[in] | res | magmaDouble_ptr array of residuals |
[in] | queue | magma_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] /
[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 | magmaDoubleComplex_ptr input/output vector x |
[in] | queue | magma_queue_t Queue to execute in. |
magma_int_t magma_zparilut_candidates_gpu | ( | magma_z_matrix | L0, |
magma_z_matrix | U0, | ||
magma_z_matrix | L, | ||
magma_z_matrix | U, | ||
magma_z_matrix * | L_new, | ||
magma_z_matrix * | U_new, | ||
magma_queue_t | queue ) |
This function identifies the locations with a potential nonzero ILU residual R = A - L*U where L and U are the current incomplete factors.
Nonzero ILU residuals are possible 1 where A is nonzero but L and U have no nonzero entry 2 where the product L*U has fill-in but the location is not included in L or U
We assume that the incomplete factors are exact fro the elements included in the current pattern.
This is the GPU implementation of the candidate search.
2 GPU kernels are used: the first is a dry run assessing the memory need, the second then computes the candidate locations, the third eliminates double entries. The fourth kernel ensures the elements in a row are sorted for increasing column index.
[in] | L0 | magma_z_matrix tril(ILU(0) ) pattern of original system matrix. |
[in] | U0 | magma_z_matrix triu(ILU(0) ) pattern of original system matrix. |
[in] | L | magma_z_matrix Current lower triangular factor. |
[in] | U | magma_z_matrix Current upper triangular factor. |
[in,out] | L_new | magma_z_matrix* List of candidates for L in COO format. |
[in,out] | U_new | magma_z_matrix* List of candidates for U in COO format. |
[in] | queue | magma_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) ) .
[in] | n | int length of v_i |
[in] | k | int |
[in] | r | magmaDoubleComplex_ptr vector of length n |
[in] | v | magmaDoubleComplex_ptr vector of length n |
[in] | skp | magmaDoubleComplex_ptr array of parameters |
[in] | queue | magma_queue_t Queue to execute in. |