MAGMA  magma-1.4.0
Matrix Algebra on GPU and Multicore Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
zgessm_gpu.cpp File Reference
#include "common_magma.h"
Include dependency graph for zgessm_gpu.cpp:

Go to the source code of this file.

Macros

#define AT(i, j)   (dAT + (i)*ldda + (j) )
 
#define L(i, j)   (dL + (i) + (j)*lddl )
 
#define dL1(j)   (dL1 + (j)*lddl1)
 

Functions

magma_int_t magma_zgessm_gpu (char storev, magma_int_t m, magma_int_t n, magma_int_t k, magma_int_t ib, magma_int_t *ipiv, magmaDoubleComplex *dL1, magma_int_t lddl1, magmaDoubleComplex *dL, magma_int_t lddl, magmaDoubleComplex *dA, magma_int_t ldda, magma_int_t *info)
 

Macro Definition Documentation

#define AT (   i,
 
)    (dAT + (i)*ldda + (j) )
#define dL1 (   j)    (dL1 + (j)*lddl1)
#define L (   i,
 
)    (dL + (i) + (j)*lddl )

Function Documentation

magma_int_t magma_zgessm_gpu ( char  storev,
magma_int_t  m,
magma_int_t  n,
magma_int_t  k,
magma_int_t  ib,
magma_int_t ipiv,
magmaDoubleComplex *  dL1,
magma_int_t  lddl1,
magmaDoubleComplex *  dL,
magma_int_t  lddl,
magmaDoubleComplex *  dA,
magma_int_t  ldda,
magma_int_t info 
)

Definition at line 17 of file zgessm_gpu.cpp.

References __func__, AT, dA, dAT, dL1, L, magma_xerbla(), MAGMA_Z_NEG_ONE, MAGMA_Z_ONE, magma_zgemm(), magma_ztrmm(), magma_ztrsm(), magmablas_zgetmo_in, magmablas_zlaswp(), MagmaLower, MagmaNoTrans, MagmaRight, MagmaTrans, MagmaUnit, max, and min.

23 {
24 /* -- MAGMA (version 1.4.0) --
25  Univ. of Tennessee, Knoxville
26  Univ. of California, Berkeley
27  Univ. of Colorado, Denver
28  August 2013
29 
30  Purpose
31  =======
32  ZGESSM applies the factors L computed by ZGETRF_INCPIV to
33  a complex M-by-N tile A.
34 
35  Arguments
36  =========
37  M (input) INTEGER
38  The number of rows of the matrix A. M >= 0.
39 
40  N (input) INTEGER
41  The number of columns of the matrix A. N >= 0.
42 
43  K (input) INTEGER
44  The number of columns of the matrix L. K >= 0.
45 
46  IB (input) INTEGER
47  The inner-blocking size. IB >= 0.
48 
49  IPIV (input) INTEGER array on the cpu.
50  The pivot indices array of size K as returned by
51  ZGETRF_INCPIV.
52 
53  dL1 (input) DOUBLE COMPLEX array, dimension(LDDL1, N)
54  The IB-by-K matrix in which is stored L^(-1) as returned by GETRF_INCPIV
55 
56  LDDL1 (input) INTEGER
57  The leading dimension of the array L1. LDDL1 >= max(1,2*IB).
58 
59  dL (input) DOUBLE COMPLEX array, dimension(LDDL, N)
60  The M-by-K lower triangular tile on the gpu.
61 
62  LDDL (input) INTEGER
63  The leading dimension of the array L. LDDL >= max(1,M).
64 
65  dA (input/output) DOUBLE COMPLEX array, dimension (LDDA, N)
66  On entry, the M-by-N tile A on the gpu.
67  On exit, updated by the application of L on the gpu.
68 
69  ===================================================================== */
70 
71 #define AT(i,j) (dAT + (i)*ldda + (j) )
72 #define L(i,j) (dL + (i) + (j)*lddl )
73 #define dL1(j) (dL1 + (j)*lddl1)
74 
75  magmaDoubleComplex c_one = MAGMA_Z_ONE;
76  magmaDoubleComplex c_neg_one = MAGMA_Z_NEG_ONE;
77 
78  int i, s, sb;
79  magmaDoubleComplex *dAT;
80 
81  /* Check arguments */
82  *info = 0;
83  if (m < 0)
84  *info = -1;
85  else if (n < 0)
86  *info = -2;
87  else if (ldda < max(1,m))
88  *info = -4;
89 
90  if (*info != 0) {
91  magma_xerbla( __func__, -(*info) );
92  return *info;
93  }
94 
95  /* Quick return if possible */
96  if (m == 0 || n == 0)
97  return *info;
98 
99  if ( (storev == 'C') || (storev == 'c') ) {
100  magmablas_zgetmo_in( dA, dAT, ldda, m, n );
101  } else {
102  dAT = dA;
103  }
104 
105  s = k / ib;
106  for(i = 0; i < k; i += ib) {
107  sb = min(ib, k-i);
108 
109  magmablas_zlaswp( n, dAT, ldda, i+1, i+sb, ipiv, 1 );
110 
111 #ifndef WITHOUTTRTRI
113  n, sb,
114  c_one, dL1(i), lddl1,
115  AT(i, 0), ldda);
116 #else
118  n, sb,
119  c_one, L( i, i), lddl,
120  AT(i, 0), ldda);
121 #endif
122 
123  if ( (i+sb) < m) {
125  n, m-(i+sb), sb,
126  c_neg_one, AT(i, 0), ldda,
127  L( i+sb, i), lddl,
128  c_one, AT(i+sb, 0), ldda );
129  }
130  }
131 
132  if ( (storev == 'C') || (storev == 'c') ) {
133  magmablas_zgetmo_in( dA, dAT, ldda, m, n );
134  }
135 
136  return *info;
137  /* End of MAGMA_ZGETRF_GPU */
138 }
#define magmablas_zgetmo_in(dA, dAT, ldda, m, n)
Definition: transpose.h:74
void magma_ztrmm(magma_side_t side, magma_uplo_t uplo, magma_trans_t trans, magma_diag_t diag, magma_int_t m, magma_int_t n, magmaDoubleComplex alpha, magmaDoubleComplex_const_ptr dA, magma_int_t ldda, magmaDoubleComplex_ptr dB, magma_int_t lddb)
#define AT(i, j)
#define min(a, b)
Definition: common_magma.h:86
#define __func__
Definition: common_magma.h:65
#define MAGMA_Z_NEG_ONE
Definition: magma.h:134
#define L(i, j)
void magma_zgemm(magma_trans_t transA, magma_trans_t transB, magma_int_t m, magma_int_t n, magma_int_t k, magmaDoubleComplex alpha, magmaDoubleComplex_const_ptr dA, magma_int_t ldda, magmaDoubleComplex_const_ptr dB, magma_int_t lddb, magmaDoubleComplex beta, magmaDoubleComplex_ptr dC, magma_int_t lddc)
void magma_ztrsm(magma_side_t side, magma_uplo_t uplo, magma_trans_t trans, magma_diag_t diag, magma_int_t m, magma_int_t n, magmaDoubleComplex alpha, magmaDoubleComplex_const_ptr dA, magma_int_t ldda, magmaDoubleComplex_ptr dB, magma_int_t lddb)
#define MagmaLower
Definition: magma.h:62
#define dAT(i, j)
void magma_xerbla(const char *srname, magma_int_t info)
Definition: xerbla.cpp:8
#define MagmaTrans
Definition: magma.h:58
#define dL1(j)
magma_int_t ldda
#define MagmaRight
Definition: magma.h:69
#define MagmaUnit
Definition: magma.h:66
#define MAGMA_Z_ONE
Definition: magma.h:132
#define MagmaNoTrans
Definition: magma.h:57
#define max(a, b)
Definition: common_magma.h:82
void magmablas_zlaswp(magma_int_t N, cuDoubleComplex *dAT, magma_int_t lda, magma_int_t i1, magma_int_t i2, magma_int_t *ipiv, magma_int_t inci)
#define dA(dev, i, j)

Here is the call graph for this function: