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

Functions

magma_int_t magma_zjacobisetup_matrix (magma_z_sparse_matrix A, magma_z_vector b, magma_z_sparse_matrix *M, magma_z_vector *d)
 Prepares the Matrix M for the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k. More...
 
magma_int_t magma_zjacobisetup_diagscal (magma_z_sparse_matrix A, magma_z_vector *d)
 It returns a vector d containing the inverse diagonal elements. More...
 
magma_int_t magma_zjacobisetup_vector (magma_z_vector b, magma_z_vector d, magma_z_vector *c)
 Prepares the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k. More...
 
magma_int_t magma_zjacobisetup (magma_z_sparse_matrix A, magma_z_vector b, magma_z_sparse_matrix *M, magma_z_vector *c)
 Prepares the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k. More...
 
magma_int_t magma_zjacobiiter (magma_z_sparse_matrix M, magma_z_vector c, magma_z_vector *x, magma_z_solver_par *solver_par)
 Iterates the solution approximation according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k. More...
 
magma_int_t magma_zfrobenius (magma_z_sparse_matrix A, magma_z_sparse_matrix B, real_Double_t *res)
 Computes the Frobenius norm of the difference between the CSR matrices A and B. More...
 
magma_int_t magma_zinitguess (magma_z_sparse_matrix A, magma_z_sparse_matrix *L, magma_z_sparse_matrix *U)
 Computes an initial guess for the iterative ILU/IC. More...
 
magma_int_t magma_z_mpkinfo_one (magma_z_sparse_matrix A, magma_int_t offset, magma_int_t blocksize, magma_int_t s, magma_index_t **num_add_rows, magma_index_t **add_rows, magma_int_t *num_add_vecs, magma_index_t **add_vecs)
 Provides for a matrix A, a blocksize, an offset, and a number of matrix powers s, the number of additional rows that are needed by this processor for the matrix power kernel. More...
 
magma_int_t magma_z_mpkback (magma_z_sparse_matrix A, magma_int_t num_procs, magma_int_t *offset, magma_int_t *blocksize, magma_int_t s, magma_int_t *num_addvecs, magma_index_t **add_vecs, magma_int_t *num_vecs_back, magma_index_t **vecs_back)
 Extension of magma_z_mpkinfo. More...
 
magma_int_t magma_zmhom_fd (magma_z_sparse_matrix A, magma_int_t n, magma_int_t b, magma_index_t *p)
 – MAGMA (version 1.5.0-beta3) – Univ. More...
 
magma_int_t magma_zmreorder (magma_z_sparse_matrix A, magma_int_t n, magma_int_t b, magma_z_sparse_matrix *B)
 – MAGMA (version 1.5.0-beta3) – Univ. More...
 
magma_int_t magma_sparse_matrix_dlag2s (magma_d_sparse_matrix A, magma_s_sparse_matrix *B)
 convertes magma_d_sparse_matrix from Z to C More...
 
magma_int_t magma_z_spmv (magmaDoubleComplex alpha, magma_z_sparse_matrix A, magma_z_vector x, magmaDoubleComplex beta, magma_z_vector y)
 For a given input matrix A and vectors x, y and scalars alpha, beta the wrapper determines the suitable SpMV computing y = alpha * A * x + beta * y. More...
 
int magma_z_mpk_uncompress_gpu (magma_int_t num_add_rows, magma_index_t *add_rows, magmaDoubleComplex *x, magmaDoubleComplex *y)
 Unpacks a compressed vector x and a key add_rows on the GPU. More...
 
int magma_z_mpk_uncompspmv (magma_int_t offset, magma_int_t blocksize, magma_int_t num_add_rows, magma_index_t *add_rows, magmaDoubleComplex *x, magmaDoubleComplex *y)
 Distributes a compressed vector x after the SpMV using offset, blocksize and key. More...
 
magma_int_t magma_sparse_matrix_zlag2c (magma_z_sparse_matrix A, magma_c_sparse_matrix *B)
 convertes magma_z_sparse_matrix from Z to C More...
 
void magma_zcompactActive (magma_int_t m, magma_int_t n, magmaDoubleComplex *dA, magma_int_t ldda, magma_index_t *active)
 ZCOMPACTACTIVE takes a set of n vectors of size m (in dA) and an array of 1s and 0sindicating which vectors to compact (for 1s) and which to disregard (for 0s). More...
 
magma_int_t magma_zgeelltmv (magma_trans_t transA, magma_int_t m, magma_int_t n, magma_int_t nnz_per_row, magmaDoubleComplex alpha, magmaDoubleComplex *d_val, magma_index_t *d_colind, magmaDoubleComplex *d_x, magmaDoubleComplex beta, magmaDoubleComplex *d_y)
 This routine computes y = alpha * A^t * x + beta * y on the GPU. More...
 
magma_int_t magma_zjacobi_diagscal (int num_rows, magmaDoubleComplex *b, magmaDoubleComplex *d, magmaDoubleComplex *c)
 Prepares the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k. More...
 
magma_int_t magma_zgemvmdot (int n, int k, magmaDoubleComplex *v, magmaDoubleComplex *r, magmaDoubleComplex *d1, magmaDoubleComplex *d2, magmaDoubleComplex *skp)
 This is an extension of the merged dot product above by chunking the set of vectors v_i such that the data always fits into cache. More...
 

Detailed Description

Function Documentation

magma_int_t magma_sparse_matrix_dlag2s ( magma_d_sparse_matrix  A,
magma_s_sparse_matrix *  B 
)

convertes magma_d_sparse_matrix from Z to C

Parameters
Amagma_d_sparse_matrix input matrix descriptor
Bmagma_s_sparse_matrix* output matrix descriptor
magma_int_t magma_sparse_matrix_zlag2c ( magma_z_sparse_matrix  A,
magma_c_sparse_matrix *  B 
)

convertes magma_z_sparse_matrix from Z to C

Parameters
Amagma_z_sparse_matrix input matrix descriptor
Bmagma_c_sparse_matrix* output matrix descriptor
int magma_z_mpk_uncompress_gpu ( magma_int_t  num_add_rows,
magma_index_t *  add_rows,
magmaDoubleComplex *  x,
magmaDoubleComplex *  y 
)

Unpacks a compressed vector x and a key add_rows on the GPU.

Parameters
num_add_rowsmagma_int_tnumber of elements to unpack
add_rowsmagma_index_t* indices of elements to unpack
xmagmaDoubleComplex* compressed input vector
ymagmaDoubleComplex* uncompressed output vector
int magma_z_mpk_uncompspmv ( magma_int_t  offset,
magma_int_t  blocksize,
magma_int_t  num_add_rows,
magma_index_t *  add_rows,
magmaDoubleComplex *  x,
magmaDoubleComplex *  y 
)

Distributes a compressed vector x after the SpMV using offset, blocksize and key.

Parameters
offsetmagma_int_t offset from 0
blocksizemagma_int_t number of elements handled by GPU
num_add_rowsmagma_int_tnumber of elements to pack
add_rowsmagma_index_t* indices of elements to pack
xmagmaDoubleComplex* compressed input vector
ymagmaDoubleComplex* uncompressed output vector
magma_int_t magma_z_mpkback ( magma_z_sparse_matrix  A,
magma_int_t  num_procs,
magma_int_t *  offset,
magma_int_t *  blocksize,
magma_int_t  s,
magma_int_t *  num_addvecs,
magma_index_t **  add_vecs,
magma_int_t *  num_vecs_back,
magma_index_t **  vecs_back 
)

Extension of magma_z_mpkinfo.

The idea is to have an array containing for all GPU sets which data is needed. Furthermore, it provides for a matrix A, a number of processors num_procs, and a distribution *offset, *blocksize and s the number of rows added to the different matrices.

num_add_vecs = [ GPU0 from Host, GPU1 from GPU0, GPU2 from GPU0 . GPU0 from GPU1, GPU1 from Host, GPU2 from GPU0 . ... ]

add_vecs has the same structure, but instead of the number, the component indices are provided.

magma_sparse_matrix A input matrix A

Parameters
num_procsmagma_int_t number of processors
offsetmagma_int_t* array containing the offsets
blocksizemagma_int_t* array containing the chunk sizes
smagma_int_t matrix powers
num_addvecsmagma_int_t* output array: number of additional rows
num_addvecsmagma_int_t* output array: number of additional rows
num_addvecsmagma_int_t* number of additional vector entries
add_vecsmagma_int_t* array for additional vector entries
magma_int_t magma_z_mpkinfo_one ( magma_z_sparse_matrix  A,
magma_int_t  offset,
magma_int_t  blocksize,
magma_int_t  s,
magma_index_t **  num_add_rows,
magma_index_t **  add_rows,
magma_int_t *  num_add_vecs,
magma_index_t **  add_vecs 
)

Provides for a matrix A, a blocksize, an offset, and a number of matrix powers s, the number of additional rows that are needed by this processor for the matrix power kernel.

magma_sparse_matrix A input matrix A

Parameters
offsetmagma_int_t first row to compute
blocksizemagma_int_t number of rows to compute
smagma_int_t matrix powers
num_add_rowsmagma_int_t**number of additional rows for each s
add_rowsmagma_int_t* array for additional rows ordered
according to s
num_add_vecsmagma_int_t*number of additional vector entries
add_vecsmagma_int_t* array for additional vector entries
magma_int_t magma_z_spmv ( magmaDoubleComplex  alpha,
magma_z_sparse_matrix  A,
magma_z_vector  x,
magmaDoubleComplex  beta,
magma_z_vector  y 
)

For a given input matrix A and vectors x, y and scalars alpha, beta the wrapper determines the suitable SpMV computing y = alpha * A * x + beta * y.

Parameters
alphamagmaDoubleComplex scalar alpha
Amagma_z_sparse_matrix sparse matrix A
xmagma_z_vector input vector x
betamagmaDoubleComplex scalar beta
ymagma_z_vector output vector y
void magma_zcompactActive ( magma_int_t  m,
magma_int_t  n,
magmaDoubleComplex *  dA,
magma_int_t  ldda,
magma_index_t *  active 
)

ZCOMPACTACTIVE takes a set of n vectors of size m (in dA) and an array of 1s and 0sindicating which vectors to compact (for 1s) and which to disregard (for 0s).

Parameters
[in]mINTEGER The number of rows of the matrix dA. M >= 0.
[in]nINTEGER The number of columns of the matrix dA. N >= 0.
[in,out]dACOMPLEX DOUBLE PRECISION array, dimension (LDDA,N) The m by n matrix dA.
[in]lddaINTEGER The leading dimension of the array dA. LDDA >= max(1,M).
[in]activeINTEGER array, dimension N A mask of 1s and 0s showing if a vector remains or has been removed
magma_int_t magma_zfrobenius ( magma_z_sparse_matrix  A,
magma_z_sparse_matrix  B,
real_Double_t *  res 
)

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

They need to share the same sparsity pattern!

Parameters
Amagma_z_sparse_matrix sparse matrix in CSR
Bmagma_z_sparse_matrix sparse matrix in CSR
resreal_Double_t* residual
magma_int_t magma_zgeelltmv ( magma_trans_t  transA,
magma_int_t  m,
magma_int_t  n,
magma_int_t  nnz_per_row,
magmaDoubleComplex  alpha,
magmaDoubleComplex *  d_val,
magma_index_t *  d_colind,
magmaDoubleComplex *  d_x,
magmaDoubleComplex  beta,
magmaDoubleComplex *  d_y 
)

This routine computes y = alpha * A^t * x + beta * y on the GPU.

Input format is ELL.

Parameters
transAmagma_trans_t transposition parameter for A
mmagma_int_t number of rows in A
nmagma_int_t number of columns in A
nnz_per_rowmagma_int_t number of elements in the longest row
alphamagmaDoubleComplex scalar multiplier
d_valmagmaDoubleComplex* array containing values of A in ELL
d_colindmagma_int_t* columnindices of A in ELL
d_xmagmaDoubleComplex* input vector x
betamagmaDoubleComplex scalar multiplier
d_ymagmaDoubleComplex* input/output vector y
magma_int_t magma_zgemvmdot ( int  n,
int  k,
magmaDoubleComplex *  v,
magmaDoubleComplex *  r,
magmaDoubleComplex *  d1,
magmaDoubleComplex *  d2,
magmaDoubleComplex *  skp 
)

This is an extension of the merged dot product above by chunking the set of vectors v_i such that the data always fits into cache.

It is equivalent to a matrix vecor product Vr where V contains few rows and many columns. The computation is the same:

skp = ( <v_0,r>, <v_1,r>, .. )

Returns the vector skp.

Parameters
nint length of v_i and r
kint

vectors v_i

Parameters
vmagmaDoubleComplex* v = (v_0 .. v_i.. v_k)
rmagmaDoubleComplex* r
d1magmaDoubleComplex* workspace
d2magmaDoubleComplex* workspace
skpmagmaDoubleComplex* vector[k] of scalar products (<v_i,r>...)
magma_int_t magma_zinitguess ( magma_z_sparse_matrix  A,
magma_z_sparse_matrix *  L,
magma_z_sparse_matrix *  U 
)

Computes an initial guess for the iterative ILU/IC.

Parameters
Amagma_z_sparse_matrix sparse matrix in CSR
Bmagma_z_sparse_matrix* sparse matrix in CSR
magma_int_t magma_zjacobi_diagscal ( int  num_rows,
magmaDoubleComplex *  b,
magmaDoubleComplex *  d,
magmaDoubleComplex *  c 
)

Prepares the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k.

Returns the vector c. It calls a GPU kernel

Parameters
num_rowsmagma_int_t number of rows
bmagma_z_vector RHS b
dmagma_z_vector vector with diagonal entries
cmagma_z_vector* c = D^(-1) * b
magma_int_t magma_zjacobiiter ( magma_z_sparse_matrix  M,
magma_z_vector  c,
magma_z_vector *  x,
magma_z_solver_par *  solver_par 
)

Iterates the solution approximation according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k.

Parameters
mmagma_z_sparse_matrix input matrix M = D^(-1) * (L+U)
cmagma_z_vector c = D^(-1) * b
xmagma_z_vector* iteration vector x
solver_parmagma_z_solver_par* solver parameters
magma_int_t magma_zjacobisetup ( magma_z_sparse_matrix  A,
magma_z_vector  b,
magma_z_sparse_matrix *  M,
magma_z_vector *  c 
)

Prepares the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k.

Parameters
Amagma_z_sparse_matrix input matrix A
bmagma_z_vector RHS b
mmagma_z_sparse_matrix* M = D^(-1) * (L+U)
cmagma_z_vector* c = D^(-1) * b
magma_int_t magma_zjacobisetup_diagscal ( magma_z_sparse_matrix  A,
magma_z_vector *  d 
)

It returns a vector d containing the inverse diagonal elements.

Parameters
Amagma_z_sparse_matrix input matrix A
dmagma_z_vector* vector with diagonal elements
magma_int_t magma_zjacobisetup_matrix ( magma_z_sparse_matrix  A,
magma_z_vector  b,
magma_z_sparse_matrix *  M,
magma_z_vector *  d 
)

Prepares the Matrix M for the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k.

It returns the preconditioner Matrix M and a vector d containing the diagonal elements.

Parameters
Amagma_z_sparse_matrix input matrix A
bmagma_z_vector RHS b
mmagma_z_sparse_matrix* M = D^(-1) * (L+U)
dmagma_z_vector* vector with diagonal elements
magma_int_t magma_zjacobisetup_vector ( magma_z_vector  b,
magma_z_vector  d,
magma_z_vector *  c 
)

Prepares the Jacobi Iteration according to x^(k+1) = D^(-1) * b - D^(-1) * (L+U) * x^k x^(k+1) = c - M * x^k.

Returns the vector c

Parameters
bmagma_z_vector RHS b
dmagma_z_vector vector with diagonal entries
cmagma_z_vector* c = D^(-1) * b
magma_int_t magma_zmhom_fd ( magma_z_sparse_matrix  A,
magma_int_t  n,
magma_int_t  b,
magma_index_t *  p 
)

– MAGMA (version 1.5.0-beta3) – Univ.

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

Takes a matrix and a blocksize b to generate a homomorphism that orders the matrix entries according to the subdomains of size b x b. Returns p on the device

example:

/ a 0 0 b 0 \
| 0 c 0 d 0 |

A= | 0 e f g 0 | b = 2 | h 0 0 0 0 | \ i j 0 0 0 /

will generate the projection:

0 2 1 3 4 7 8 9 10 11

according to

a c b d e h f g i j

Parameters
Amagma_z_sparse_matrix input/output matrix
bmagma_int_t blocksize
pmagma_index_t* homomorphism vector containing the indices
magma_int_t magma_zmreorder ( magma_z_sparse_matrix  A,
magma_int_t  n,
magma_int_t  b,
magma_z_sparse_matrix *  B 
)

– MAGMA (version 1.5.0-beta3) – Univ.

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

Takes a matrix and a reordering scheme such that the output mat

example:

/ a 0 0 b 0 \
| 0 c 0 d 0 |

A= | 0 e f g 0 | b = 2 | h 0 0 0 0 | \ i j 0 0 0 /

will generate the projection:

0 2 1 3 4 7 8 9 10 11

according to

a c b d e h f g i j

Parameters
Amagma_z_sparse_matrix input/output matrix
nmagma_int_t nodes in one dimension
bmagma_int_t blocksize
Bmagma_z_sparse_matrix* new matrix filled with new indices