MAGMA  magma-1.4.0
Matrix Algebra on GPU and Multicore Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
cgessm_gpu.cpp File Reference
#include "common_magma.h"
Include dependency graph for cgessm_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_cgessm_gpu (char storev, magma_int_t m, magma_int_t n, magma_int_t k, magma_int_t ib, magma_int_t *ipiv, magmaFloatComplex *dL1, magma_int_t lddl1, magmaFloatComplex *dL, magma_int_t lddl, magmaFloatComplex *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_cgessm_gpu ( char  storev,
magma_int_t  m,
magma_int_t  n,
magma_int_t  k,
magma_int_t  ib,
magma_int_t ipiv,
magmaFloatComplex *  dL1,
magma_int_t  lddl1,
magmaFloatComplex *  dL,
magma_int_t  lddl,
magmaFloatComplex *  dA,
magma_int_t  ldda,
magma_int_t info 
)

Definition at line 17 of file cgessm_gpu.cpp.

References __func__, AT, dA, dAT, dL1, L, MAGMA_C_NEG_ONE, MAGMA_C_ONE, magma_cgemm(), magma_ctrmm(), magma_ctrsm(), magma_xerbla(), magmablas_cgetmo_in, magmablas_claswp(), 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  CGESSM applies the factors L computed by CGETRF_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  CGETRF_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  magmaFloatComplex c_one = MAGMA_C_ONE;
76  magmaFloatComplex c_neg_one = MAGMA_C_NEG_ONE;
77 
78  int i, s, sb;
79  magmaFloatComplex *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_cgetmo_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_claswp( 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_cgetmo_in( dA, dAT, ldda, m, n );
134  }
135 
136  return *info;
137  /* End of MAGMA_CGETRF_GPU */
138 }
#define min(a, b)
Definition: common_magma.h:86
#define AT(i, j)
#define __func__
Definition: common_magma.h:65
#define MAGMA_C_NEG_ONE
Definition: magma.h:156
void magma_cgemm(magma_trans_t transA, magma_trans_t transB, magma_int_t m, magma_int_t n, magma_int_t k, magmaFloatComplex alpha, magmaFloatComplex_const_ptr dA, magma_int_t ldda, magmaFloatComplex_const_ptr dB, magma_int_t lddb, magmaFloatComplex beta, magmaFloatComplex_ptr dC, magma_int_t lddc)
#define L(i, j)
void magma_ctrsm(magma_side_t side, magma_uplo_t uplo, magma_trans_t trans, magma_diag_t diag, magma_int_t m, magma_int_t n, magmaFloatComplex alpha, magmaFloatComplex_const_ptr dA, magma_int_t ldda, magmaFloatComplex_ptr dB, magma_int_t lddb)
#define magmablas_cgetmo_in(dA, dAT, ldda, m, n)
Definition: transpose.h:55
void magmablas_claswp(magma_int_t n, magmaFloatComplex_ptr dAT, magma_int_t ldda, magma_int_t i1, magma_int_t i2, const magma_int_t *ipiv, magma_int_t inci)
#define MagmaLower
Definition: magma.h:62
#define dAT(i, j)
#define dL1(j)
void magma_xerbla(const char *srname, magma_int_t info)
Definition: xerbla.cpp:8
#define MagmaTrans
Definition: magma.h:58
#define MAGMA_C_ONE
Definition: magma.h:154
magma_int_t ldda
#define MagmaRight
Definition: magma.h:69
#define MagmaUnit
Definition: magma.h:66
void magma_ctrmm(magma_side_t side, magma_uplo_t uplo, magma_trans_t trans, magma_diag_t diag, magma_int_t m, magma_int_t n, magmaFloatComplex alpha, magmaFloatComplex_const_ptr dA, magma_int_t ldda, magmaFloatComplex_ptr dB, magma_int_t lddb)
#define MagmaNoTrans
Definition: magma.h:57
#define max(a, b)
Definition: common_magma.h:82
#define dA(dev, i, j)

Here is the call graph for this function:

Here is the caller graph for this function: