libflame revision_anchor
Functions
bl1_trmv.c File Reference

(r)

Functions

void bl1_strmv (uplo1_t uplo, trans1_t trans, diag1_t diag, int m, float *a, int a_rs, int a_cs, float *x, int incx)
 
void bl1_dtrmv (uplo1_t uplo, trans1_t trans, diag1_t diag, int m, double *a, int a_rs, int a_cs, double *x, int incx)
 
void bl1_ctrmv (uplo1_t uplo, trans1_t trans, diag1_t diag, int m, scomplex *a, int a_rs, int a_cs, scomplex *x, int incx)
 
void bl1_ztrmv (uplo1_t uplo, trans1_t trans, diag1_t diag, int m, dcomplex *a, int a_rs, int a_cs, dcomplex *x, int incx)
 
void bl1_strmv_blas (uplo1_t uplo, trans1_t trans, diag1_t diag, int m, float *a, int lda, float *x, int incx)
 
void bl1_dtrmv_blas (uplo1_t uplo, trans1_t trans, diag1_t diag, int m, double *a, int lda, double *x, int incx)
 
void bl1_ctrmv_blas (uplo1_t uplo, trans1_t trans, diag1_t diag, int m, scomplex *a, int lda, scomplex *x, int incx)
 
void bl1_ztrmv_blas (uplo1_t uplo, trans1_t trans, diag1_t diag, int m, dcomplex *a, int lda, dcomplex *x, int incx)
 

Function Documentation

◆ bl1_ctrmv()

void bl1_ctrmv ( uplo1_t  uplo,
trans1_t  trans,
diag1_t  diag,
int  m,
scomplex a,
int  a_rs,
int  a_cs,
scomplex x,
int  incx 
)
100{
101 scomplex* a_save = a;
102 int a_rs_save = a_rs;
103 int a_cs_save = a_cs;
105 int incx_conj;
106 int lda, inca;
107
108 // Return early if possible.
109 if ( bl1_zero_dim1( m ) ) return;
110
111 // If necessary, allocate, initialize, and use a temporary contiguous
112 // copy of the matrix rather than the original matrix.
114 m,
115 m,
117 &a, &a_rs, &a_cs );
118
119 // Initialize with values assuming column-major storage.
120 lda = a_cs;
121 inca = a_rs;
122
123 // If A is a row-major matrix, then we can use the underlying column-major
124 // BLAS implementation by fiddling with the parameters.
125 if ( bl1_is_row_storage( a_rs, a_cs ) )
126 {
128 bl1_toggle_uplo( uplo );
130 }
131
132 // Initialize with values assuming that trans is not conjnotrans.
133 x_conj = x;
134 incx_conj = incx;
135
136 // We want to handle the conjnotrans case, but without explicitly
137 // conjugating A. To do so, we leverage the fact that computing the
138 // product conj(A) * x is equivalent to computing conj( A * conj(x) ).
139 // Note: strictly speaking, we don't need to create a copy of x since
140 // the operation is simpler than, say, gemv. However, we create a copy
141 // anyway since in practice it performs better due to increased spatial
142 // locality.
143 if ( bl1_is_conjnotrans( trans ) )
144 {
145 x_conj = bl1_callocv( m );
146 incx_conj = 1;
147
149 m,
150 x, incx,
151 x_conj, incx_conj );
152 }
153
154 bl1_ctrmv_blas( uplo,
155 trans,
156 diag,
157 m,
158 a, lda,
159 x_conj, incx_conj );
160
161 // Save the contents of and then free the temporary conjugated x vector.
162 if ( bl1_is_conjnotrans( trans ) )
163 {
165 m,
167 x, incx );
168
169 bl1_cfree( x_conj );
170 }
171
172 // Free the temporary contiguous matrix.
174 &a, &a_rs, &a_cs );
175}
int i
Definition bl1_axmyv2.c:145
void bl1_ccopyv(conj1_t conj, int m, scomplex *x, int incx, scomplex *y, int incy)
Definition bl1_copyv.c:49
void bl1_ctrmv_blas(uplo1_t uplo, trans1_t trans, diag1_t diag, int m, scomplex *a, int lda, scomplex *x, int incx)
Definition bl1_trmv.c:331
int bl1_is_row_storage(int rs, int cs)
Definition bl1_is.c:95
int bl1_zero_dim1(int m)
Definition bl1_is.c:113
int bl1_is_conjnotrans(trans1_t trans)
Definition bl1_is.c:25
void bl1_cfree_contigm(scomplex *a_save, int a_rs_save, int a_cs_save, scomplex **a, int *a_rs, int *a_cs)
Definition bl1_free_contigm.c:45
void bl1_cfree(scomplex *p)
Definition bl1_free.c:40
void bl1_ccreate_contigmr(uplo1_t uplo, int m, int n, scomplex *a_save, int a_rs_save, int a_cs_save, scomplex **a, int *a_rs, int *a_cs)
Definition bl1_create_contigmr.c:77
scomplex * bl1_callocv(unsigned int n_elem)
Definition bl1_allocv.c:40
@ BLIS1_CONJUGATE
Definition blis_type_defs.h:82
Definition blis_type_defs.h:133

References bl1_callocv(), bl1_ccopyv(), bl1_ccreate_contigmr(), bl1_cfree(), bl1_cfree_contigm(), bl1_ctrmv_blas(), bl1_is_conjnotrans(), bl1_is_row_storage(), bl1_zero_dim1(), and BLIS1_CONJUGATE.

Referenced by bl1_ctrmvsx(), FLA_CAQR2_UT_opc_var1(), FLA_Eig_gest_nl_opc_var1(), FLA_Eig_gest_nl_opc_var5(), FLA_Eig_gest_nu_opc_var1(), FLA_Eig_gest_nu_opc_var5(), FLA_Hess_UT_step_opc_var5(), FLA_Trinv_ln_opc_var1(), FLA_Trinv_ln_opc_var4(), FLA_Trinv_lu_opc_var1(), FLA_Trinv_lu_opc_var4(), FLA_Trinv_un_opc_var1(), FLA_Trinv_un_opc_var4(), FLA_Trinv_uu_opc_var1(), FLA_Trinv_uu_opc_var4(), FLA_Trmv_external(), FLA_Ttmm_l_opc_var3(), and FLA_Ttmm_u_opc_var3().

◆ bl1_ctrmv_blas()

void bl1_ctrmv_blas ( uplo1_t  uplo,
trans1_t  trans,
diag1_t  diag,
int  m,
scomplex a,
int  lda,
scomplex x,
int  incx 
)
332{
333#ifdef BLIS1_ENABLE_CBLAS_INTERFACES
338
342
347 m,
348 a, lda,
349 x, incx );
350#else
351 char blas_uplo;
352 char blas_trans;
353 char blas_diag;
354
358
360 &blas_trans,
361 &blas_diag,
362 &m,
363 a, &lda,
364 x, &incx );
365#endif
366}
void F77_ctrmv(char *uplo, char *transa, char *diag, int *n, scomplex *a, int *lda, scomplex *y, int *incy)
CBLAS_ORDER
Definition blis_prototypes_cblas.h:17
@ CblasColMajor
Definition blis_prototypes_cblas.h:17
CBLAS_UPLO
Definition blis_prototypes_cblas.h:19
CBLAS_TRANSPOSE
Definition blis_prototypes_cblas.h:18
void cblas_ctrmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const int N, const void *A, const int lda, void *X, const int incX)
CBLAS_DIAG
Definition blis_prototypes_cblas.h:20
void bl1_param_map_to_netlib_diag(diag1_t blis_diag, void *blas_diag)
Definition bl1_param_map.c:95
void bl1_param_map_to_netlib_trans(trans1_t blis_trans, void *blas_trans)
Definition bl1_param_map.c:15
void bl1_param_map_to_netlib_uplo(uplo1_t blis_uplo, void *blas_uplo)
Definition bl1_param_map.c:47

References bl1_param_map_to_netlib_diag(), bl1_param_map_to_netlib_trans(), bl1_param_map_to_netlib_uplo(), cblas_ctrmv(), CblasColMajor, and F77_ctrmv().

Referenced by bl1_ctrmv().

◆ bl1_dtrmv()

void bl1_dtrmv ( uplo1_t  uplo,
trans1_t  trans,
diag1_t  diag,
int  m,
double a,
int  a_rs,
int  a_cs,
double x,
int  incx 
)
57{
58 double* a_save = a;
59 int a_rs_save = a_rs;
60 int a_cs_save = a_cs;
61 int lda, inca;
62
63 // Return early if possible.
64 if ( bl1_zero_dim1( m ) ) return;
65
66 // If necessary, allocate, initialize, and use a temporary contiguous
67 // copy of the matrix rather than the original matrix.
69 m,
70 m,
72 &a, &a_rs, &a_cs );
73
74 // Initialize with values assuming column-major storage.
75 lda = a_cs;
76 inca = a_rs;
77
78 // If A is a row-major matrix, then we can use the underlying column-major
79 // BLAS implementation by fiddling with the parameters.
81 {
83 bl1_toggle_uplo( uplo );
85 }
86
87 bl1_dtrmv_blas( uplo,
88 trans,
89 diag,
90 m,
91 a, lda,
92 x, incx );
93
94 // Free the temporary contiguous matrix.
96 &a, &a_rs, &a_cs );
97}
void bl1_dtrmv_blas(uplo1_t uplo, trans1_t trans, diag1_t diag, int m, double *a, int lda, double *x, int incx)
Definition bl1_trmv.c:294
void bl1_dfree_contigm(double *a_save, int a_rs_save, int a_cs_save, double **a, int *a_rs, int *a_cs)
Definition bl1_free_contigm.c:29
void bl1_dcreate_contigmr(uplo1_t uplo, int m, int n, double *a_save, int a_rs_save, int a_cs_save, double **a, int *a_rs, int *a_cs)
Definition bl1_create_contigmr.c:45

References bl1_dcreate_contigmr(), bl1_dfree_contigm(), bl1_dtrmv_blas(), bl1_is_row_storage(), and bl1_zero_dim1().

Referenced by bl1_dtrmvsx(), FLA_CAQR2_UT_opd_var1(), FLA_Eig_gest_nl_opd_var1(), FLA_Eig_gest_nl_opd_var5(), FLA_Eig_gest_nu_opd_var1(), FLA_Eig_gest_nu_opd_var5(), FLA_Hess_UT_step_opd_var5(), FLA_Trinv_ln_opd_var1(), FLA_Trinv_ln_opd_var4(), FLA_Trinv_lu_opd_var1(), FLA_Trinv_lu_opd_var4(), FLA_Trinv_un_opd_var1(), FLA_Trinv_un_opd_var4(), FLA_Trinv_uu_opd_var1(), FLA_Trinv_uu_opd_var4(), FLA_Trmv_external(), FLA_Ttmm_l_opd_var3(), and FLA_Ttmm_u_opd_var3().

◆ bl1_dtrmv_blas()

void bl1_dtrmv_blas ( uplo1_t  uplo,
trans1_t  trans,
diag1_t  diag,
int  m,
double a,
int  lda,
double x,
int  incx 
)
295{
296#ifdef BLIS1_ENABLE_CBLAS_INTERFACES
301
305
310 m,
311 a, lda,
312 x, incx );
313#else
314 char blas_uplo;
315 char blas_trans;
316 char blas_diag;
317
321
323 &blas_trans,
324 &blas_diag,
325 &m,
326 a, &lda,
327 x, &incx );
328#endif
329}
void F77_dtrmv(char *uplo, char *transa, char *diag, int *n, double *a, int *lda, double *y, int *incy)
void cblas_dtrmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const int N, const double *A, const int lda, double *X, const int incX)

References bl1_param_map_to_netlib_diag(), bl1_param_map_to_netlib_trans(), bl1_param_map_to_netlib_uplo(), cblas_dtrmv(), CblasColMajor, and F77_dtrmv().

Referenced by bl1_dtrmv().

◆ bl1_strmv()

void bl1_strmv ( uplo1_t  uplo,
trans1_t  trans,
diag1_t  diag,
int  m,
float a,
int  a_rs,
int  a_cs,
float x,
int  incx 
)
14{
15 float* a_save = a;
16 int a_rs_save = a_rs;
17 int a_cs_save = a_cs;
18 int lda, inca;
19
20 // Return early if possible.
21 if ( bl1_zero_dim1( m ) ) return;
22
23 // If necessary, allocate, initialize, and use a temporary contiguous
24 // copy of the matrix rather than the original matrix.
26 m,
27 m,
29 &a, &a_rs, &a_cs );
30
31 // Initialize with values assuming column-major storage.
32 lda = a_cs;
33 inca = a_rs;
34
35 // If A is a row-major matrix, then we can use the underlying column-major
36 // BLAS implementation by fiddling with the parameters.
38 {
40 bl1_toggle_uplo( uplo );
42 }
43
44 bl1_strmv_blas( uplo,
45 trans,
46 diag,
47 m,
48 a, lda,
49 x, incx );
50
51 // Free the temporary contiguous matrix.
53 &a, &a_rs, &a_cs );
54}
void bl1_strmv_blas(uplo1_t uplo, trans1_t trans, diag1_t diag, int m, float *a, int lda, float *x, int incx)
Definition bl1_trmv.c:257
void bl1_sfree_contigm(float *a_save, int a_rs_save, int a_cs_save, float **a, int *a_rs, int *a_cs)
Definition bl1_free_contigm.c:13
void bl1_screate_contigmr(uplo1_t uplo, int m, int n, float *a_save, int a_rs_save, int a_cs_save, float **a, int *a_rs, int *a_cs)
Definition bl1_create_contigmr.c:13

References bl1_is_row_storage(), bl1_screate_contigmr(), bl1_sfree_contigm(), bl1_strmv_blas(), and bl1_zero_dim1().

Referenced by bl1_strmvsx(), FLA_CAQR2_UT_ops_var1(), FLA_Eig_gest_nl_ops_var1(), FLA_Eig_gest_nl_ops_var5(), FLA_Eig_gest_nu_ops_var1(), FLA_Eig_gest_nu_ops_var5(), FLA_Hess_UT_step_ops_var5(), FLA_Trinv_ln_ops_var1(), FLA_Trinv_ln_ops_var4(), FLA_Trinv_lu_ops_var1(), FLA_Trinv_lu_ops_var4(), FLA_Trinv_un_ops_var1(), FLA_Trinv_un_ops_var4(), FLA_Trinv_uu_ops_var1(), FLA_Trinv_uu_ops_var4(), FLA_Trmv_external(), FLA_Ttmm_l_ops_var3(), and FLA_Ttmm_u_ops_var3().

◆ bl1_strmv_blas()

void bl1_strmv_blas ( uplo1_t  uplo,
trans1_t  trans,
diag1_t  diag,
int  m,
float a,
int  lda,
float x,
int  incx 
)
258{
259#ifdef BLIS1_ENABLE_CBLAS_INTERFACES
264
268
273 m,
274 a, lda,
275 x, incx );
276#else
277 char blas_uplo;
278 char blas_trans;
279 char blas_diag;
280
284
286 &blas_trans,
287 &blas_diag,
288 &m,
289 a, &lda,
290 x, &incx );
291#endif
292}
void F77_strmv(char *uplo, char *transa, char *diag, int *n, float *a, int *lda, float *y, int *incy)
void cblas_strmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const int N, const float *A, const int lda, float *X, const int incX)

References bl1_param_map_to_netlib_diag(), bl1_param_map_to_netlib_trans(), bl1_param_map_to_netlib_uplo(), cblas_strmv(), CblasColMajor, and F77_strmv().

Referenced by bl1_strmv().

◆ bl1_ztrmv()

void bl1_ztrmv ( uplo1_t  uplo,
trans1_t  trans,
diag1_t  diag,
int  m,
dcomplex a,
int  a_rs,
int  a_cs,
dcomplex x,
int  incx 
)
178{
179 dcomplex* a_save = a;
180 int a_rs_save = a_rs;
181 int a_cs_save = a_cs;
183 int incx_conj;
184 int lda, inca;
185
186 // Return early if possible.
187 if ( bl1_zero_dim1( m ) ) return;
188
189 // If necessary, allocate, initialize, and use a temporary contiguous
190 // copy of the matrix rather than the original matrix.
192 m,
193 m,
195 &a, &a_rs, &a_cs );
196
197 // Initialize with values assuming column-major storage.
198 lda = a_cs;
199 inca = a_rs;
200
201 // If A is a row-major matrix, then we can use the underlying column-major
202 // BLAS implementation by fiddling with the parameters.
203 if ( bl1_is_row_storage( a_rs, a_cs ) )
204 {
206 bl1_toggle_uplo( uplo );
208 }
209
210 // Initialize with values assuming that trans is not conjnotrans.
211 x_conj = x;
212 incx_conj = incx;
213
214 // We want to handle the conjnotrans case, but without explicitly
215 // conjugating A. To do so, we leverage the fact that computing the
216 // product conj(A) * x is equivalent to computing conj( A * conj(x) ).
217 // Note: strictly speaking, we don't need to create a copy of x since
218 // the operation is simpler than, say, gemv. However, we create a copy
219 // anyway since in practice it performs better due to increased spatial
220 // locality.
221 if ( bl1_is_conjnotrans( trans ) )
222 {
223 x_conj = bl1_zallocv( m );
224 incx_conj = 1;
225
227 m,
228 x, incx,
229 x_conj, incx_conj );
230 }
231
232 bl1_ztrmv_blas( uplo,
233 trans,
234 diag,
235 m,
236 a, lda,
237 x_conj, incx_conj );
238
239 // Save the contents of and then free the temporary conjugated x vector.
240 if ( bl1_is_conjnotrans( trans ) )
241 {
243 m,
245 x, incx );
246
247 bl1_zfree( x_conj );
248 }
249
250 // Free the temporary contiguous matrix.
252 &a, &a_rs, &a_cs );
253}
void bl1_zcopyv(conj1_t conj, int m, dcomplex *x, int incx, dcomplex *y, int incy)
Definition bl1_copyv.c:63
void bl1_ztrmv_blas(uplo1_t uplo, trans1_t trans, diag1_t diag, int m, dcomplex *a, int lda, dcomplex *x, int incx)
Definition bl1_trmv.c:368
dcomplex * bl1_zallocv(unsigned int n_elem)
Definition bl1_allocv.c:45
void bl1_zcreate_contigmr(uplo1_t uplo, int m, int n, dcomplex *a_save, int a_rs_save, int a_cs_save, dcomplex **a, int *a_rs, int *a_cs)
Definition bl1_create_contigmr.c:109
void bl1_zfree(dcomplex *p)
Definition bl1_free.c:45
void bl1_zfree_contigm(dcomplex *a_save, int a_rs_save, int a_cs_save, dcomplex **a, int *a_rs, int *a_cs)
Definition bl1_free_contigm.c:61
Definition blis_type_defs.h:138

References bl1_is_conjnotrans(), bl1_is_row_storage(), bl1_zallocv(), bl1_zcopyv(), bl1_zcreate_contigmr(), bl1_zero_dim1(), bl1_zfree(), bl1_zfree_contigm(), bl1_ztrmv_blas(), and BLIS1_CONJUGATE.

Referenced by bl1_ztrmvsx(), FLA_CAQR2_UT_opz_var1(), FLA_Eig_gest_nl_opz_var1(), FLA_Eig_gest_nl_opz_var5(), FLA_Eig_gest_nu_opz_var1(), FLA_Eig_gest_nu_opz_var5(), FLA_Hess_UT_step_opz_var5(), FLA_Trinv_ln_opz_var1(), FLA_Trinv_ln_opz_var4(), FLA_Trinv_lu_opz_var1(), FLA_Trinv_lu_opz_var4(), FLA_Trinv_un_opz_var1(), FLA_Trinv_un_opz_var4(), FLA_Trinv_uu_opz_var1(), FLA_Trinv_uu_opz_var4(), FLA_Trmv_external(), FLA_Ttmm_l_opz_var3(), and FLA_Ttmm_u_opz_var3().

◆ bl1_ztrmv_blas()

void bl1_ztrmv_blas ( uplo1_t  uplo,
trans1_t  trans,
diag1_t  diag,
int  m,
dcomplex a,
int  lda,
dcomplex x,
int  incx 
)
369{
370#ifdef BLIS1_ENABLE_CBLAS_INTERFACES
375
379
384 m,
385 a, lda,
386 x, incx );
387#else
388 char blas_uplo;
389 char blas_trans;
390 char blas_diag;
391
395
397 &blas_trans,
398 &blas_diag,
399 &m,
400 a, &lda,
401 x, &incx );
402#endif
403}
void F77_ztrmv(char *uplo, char *transa, char *diag, int *n, dcomplex *a, int *lda, dcomplex *y, int *incy)
void cblas_ztrmv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const int N, const void *A, const int lda, void *X, const int incX)

References bl1_param_map_to_netlib_diag(), bl1_param_map_to_netlib_trans(), bl1_param_map_to_netlib_uplo(), cblas_ztrmv(), CblasColMajor, and F77_ztrmv().

Referenced by bl1_ztrmv().