libflame revision_anchor
Functions
bl1_syr.c File Reference

(r)

Functions

void bl1_ssyr (uplo1_t uplo, int m, float *alpha, float *x, int incx, float *a, int a_rs, int a_cs)
 
void bl1_dsyr (uplo1_t uplo, int m, double *alpha, double *x, int incx, double *a, int a_rs, int a_cs)
 
void bl1_csyr (uplo1_t uplo, int m, scomplex *alpha, scomplex *x, int incx, scomplex *a, int a_rs, int a_cs)
 
void bl1_zsyr (uplo1_t uplo, int m, dcomplex *alpha, dcomplex *x, int incx, dcomplex *a, int a_rs, int a_cs)
 
void bl1_ssyr_blas (uplo1_t uplo, int m, float *alpha, float *x, int incx, float *a, int lda)
 
void bl1_dsyr_blas (uplo1_t uplo, int m, double *alpha, double *x, int incx, double *a, int lda)
 
void bl1_csyr_blas (uplo1_t uplo, int m, scomplex *alpha, scomplex *x, int incx, scomplex *a, int lda)
 
void bl1_zsyr_blas (uplo1_t uplo, int m, dcomplex *alpha, dcomplex *x, int incx, dcomplex *a, int lda)
 

Function Documentation

◆ bl1_csyr()

void bl1_csyr ( uplo1_t  uplo,
int  m,
scomplex alpha,
scomplex x,
int  incx,
scomplex a,
int  a_rs,
int  a_cs 
)
102{
103 int m_save = m;
104 scomplex* a_save = a;
105 int a_rs_save = a_rs;
106 int a_cs_save = a_cs;
107 int lda, inca;
108
109 // Return early if possible.
110 if ( bl1_zero_dim1( m ) ) return;
111
112 // If necessary, allocate, initialize, and use a temporary contiguous
113 // copy of the matrix rather than the original matrix.
115 m,
116 m,
118 &a, &a_rs, &a_cs );
119
120 // Initialize with values assuming column-major storage.
121 lda = a_cs;
122 inca = a_rs;
123
124 // If A is a row-major matrix, then we can use the underlying column-major
125 // BLAS implementation by fiddling with the parameters.
126 if ( bl1_is_row_storage( a_rs, a_cs ) )
127 {
129 bl1_toggle_uplo( uplo );
130 }
131
132 bl1_csyr_blas( uplo,
133 m,
134 alpha,
135 x, incx,
136 a, lda );
137
138 // Free the temporary contiguous matrix.
140 m_save,
142 &a, &a_rs, &a_cs );
143}
int i
Definition bl1_axmyv2.c:145
void bl1_csyr_blas(uplo1_t uplo, int m, scomplex *alpha, scomplex *x, int incx, scomplex *a, int lda)
Definition bl1_syr.c:247
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
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
void bl1_cfree_saved_contigm(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_free_saved_contigm.c:59
Definition blis_type_defs.h:133

References bl1_ccreate_contigmr(), bl1_cfree_saved_contigm(), bl1_csyr_blas(), bl1_is_row_storage(), and bl1_zero_dim1().

Referenced by FLA_Syr_external().

◆ bl1_csyr_blas()

void bl1_csyr_blas ( uplo1_t  uplo,
int  m,
scomplex alpha,
scomplex x,
int  incx,
scomplex a,
int  lda 
)
248{
251 int k = 1;
252 int ldx = m;
253
254#ifdef BLIS1_ENABLE_CBLAS_INTERFACES
258
261
262 x_copy = bl1_callocv( m );
263
265 m,
266 x, incx,
267 x_copy, 1 );
268
269 beta.real = 1.0;
270 beta.imag = 0.0;
271
275 m,
276 k,
277 alpha,
278 x_copy, ldx,
279 &beta,
280 a, lda );
281
282 bl1_cfree( x_copy );
283#else
284 char blas_uplo;
285 char blas_trans;
286
289
290 x_copy = bl1_callocv( m );
291
293 m,
294 x, incx,
295 x_copy, 1 );
296
297 beta.real = 1.0;
298 beta.imag = 0.0;
299
301 &blas_trans,
302 &m,
303 &k,
304 alpha,
305 x_copy, &ldx,
306 &beta,
307 a, &lda );
308
309 bl1_cfree( x_copy );
310#endif
311}
void bl1_ccopyv(conj1_t conj, int m, scomplex *x, int incx, scomplex *y, int incy)
Definition bl1_copyv.c:49
void F77_csyrk(char *uplo, char *transa, int *n, int *k, scomplex *alpha, scomplex *a, int *lda, scomplex *beta, scomplex *c, int *ldc)
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_csyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans, const int N, const int K, const void *alpha, const void *A, const int lda, const void *beta, void *C, const int ldc)
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
void bl1_cfree(scomplex *p)
Definition bl1_free.c:40
scomplex * bl1_callocv(unsigned int n_elem)
Definition bl1_allocv.c:40
@ BLIS1_NO_TRANSPOSE
Definition blis_type_defs.h:54
@ BLIS1_NO_CONJUGATE
Definition blis_type_defs.h:81

References bl1_callocv(), bl1_ccopyv(), bl1_cfree(), bl1_param_map_to_netlib_trans(), bl1_param_map_to_netlib_uplo(), BLIS1_NO_CONJUGATE, BLIS1_NO_TRANSPOSE, cblas_csyrk(), CblasColMajor, F77_csyrk(), scomplex::imag, and scomplex::real.

Referenced by bl1_csyr().

◆ bl1_dsyr()

void bl1_dsyr ( uplo1_t  uplo,
int  m,
double alpha,
double x,
int  incx,
double a,
int  a_rs,
int  a_cs 
)
58{
59 int m_save = m;
60 double* a_save = a;
61 int a_rs_save = a_rs;
62 int a_cs_save = a_cs;
63 int lda, inca;
64
65 // Return early if possible.
66 if ( bl1_zero_dim1( m ) ) return;
67
68 // If necessary, allocate, initialize, and use a temporary contiguous
69 // copy of the matrix rather than the original matrix.
71 m,
72 m,
74 &a, &a_rs, &a_cs );
75
76 // Initialize with values assuming column-major storage.
77 lda = a_cs;
78 inca = a_rs;
79
80 // If A is a row-major matrix, then we can use the underlying column-major
81 // BLAS implementation by fiddling with the parameters.
83 {
85 bl1_toggle_uplo( uplo );
86 }
87
88 bl1_dsyr_blas( uplo,
89 m,
90 alpha,
91 x, incx,
92 a, lda );
93
94 // Free the temporary contiguous matrix.
96 m_save,
98 &a, &a_rs, &a_cs );
99}
void bl1_dsyr_blas(uplo1_t uplo, int m, double *alpha, double *x, int incx, double *a, int lda)
Definition bl1_syr.c:220
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
void bl1_dfree_saved_contigm(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_free_saved_contigm.c:36

References bl1_dcreate_contigmr(), bl1_dfree_saved_contigm(), bl1_dsyr_blas(), bl1_is_row_storage(), and bl1_zero_dim1().

Referenced by bl1_dher(), FLA_Chol_l_opd_var3(), FLA_Chol_u_opd_var3(), FLA_Her_external(), FLA_Herc_external(), FLA_Syr_external(), FLA_Ttmm_l_opd_var1(), and FLA_Ttmm_u_opd_var1().

◆ bl1_dsyr_blas()

void bl1_dsyr_blas ( uplo1_t  uplo,
int  m,
double alpha,
double x,
int  incx,
double a,
int  lda 
)
221{
222#ifdef BLIS1_ENABLE_CBLAS_INTERFACES
225
227
230 m,
231 *alpha,
232 x, incx,
233 a, lda );
234#else
235 char blas_uplo;
236
238
240 &m,
241 alpha,
242 x, &incx,
243 a, &lda );
244#endif
245}
void F77_dsyr(char *uplo, int *n, double *alpha, double *x, int *incx, double *a, int *lda)
void cblas_dsyr(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const int N, const double alpha, const double *X, const int incX, double *A, const int lda)

References bl1_param_map_to_netlib_uplo(), cblas_dsyr(), CblasColMajor, and F77_dsyr().

Referenced by bl1_dsyr().

◆ bl1_ssyr()

void bl1_ssyr ( uplo1_t  uplo,
int  m,
float alpha,
float x,
int  incx,
float a,
int  a_rs,
int  a_cs 
)
14{
15 int m_save = m;
16 float* a_save = a;
17 int a_rs_save = a_rs;
18 int a_cs_save = a_cs;
19 int lda, inca;
20
21 // Return early if possible.
22 if ( bl1_zero_dim1( m ) ) return;
23
24 // If necessary, allocate, initialize, and use a temporary contiguous
25 // copy of the matrix rather than the original matrix.
27 m,
28 m,
30 &a, &a_rs, &a_cs );
31
32 // Initialize with values assuming column-major storage.
33 lda = a_cs;
34 inca = a_rs;
35
36 // If A is a row-major matrix, then we can use the underlying column-major
37 // BLAS implementation by fiddling with the parameters.
39 {
41 bl1_toggle_uplo( uplo );
42 }
43
44 bl1_ssyr_blas( uplo,
45 m,
46 alpha,
47 x, incx,
48 a, lda );
49
50 // Free the temporary contiguous matrix.
52 m_save,
54 &a, &a_rs, &a_cs );
55}
void bl1_ssyr_blas(uplo1_t uplo, int m, float *alpha, float *x, int incx, float *a, int lda)
Definition bl1_syr.c:193
void bl1_sfree_saved_contigm(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_free_saved_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_saved_contigm(), bl1_ssyr_blas(), and bl1_zero_dim1().

Referenced by bl1_sher(), FLA_Chol_l_ops_var3(), FLA_Chol_u_ops_var3(), FLA_Her_external(), FLA_Herc_external(), FLA_Syr_external(), FLA_Ttmm_l_ops_var1(), and FLA_Ttmm_u_ops_var1().

◆ bl1_ssyr_blas()

void bl1_ssyr_blas ( uplo1_t  uplo,
int  m,
float alpha,
float x,
int  incx,
float a,
int  lda 
)
194{
195#ifdef BLIS1_ENABLE_CBLAS_INTERFACES
198
200
203 m,
204 *alpha,
205 x, incx,
206 a, lda );
207#else
208 char blas_uplo;
209
211
213 &m,
214 alpha,
215 x, &incx,
216 a, &lda );
217#endif
218}
void F77_ssyr(char *uplo, int *n, float *alpha, float *x, int *incx, float *a, int *lda)
void cblas_ssyr(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const int N, const float alpha, const float *X, const int incX, float *A, const int lda)

References bl1_param_map_to_netlib_uplo(), cblas_ssyr(), CblasColMajor, and F77_ssyr().

Referenced by bl1_ssyr().

◆ bl1_zsyr()

void bl1_zsyr ( uplo1_t  uplo,
int  m,
dcomplex alpha,
dcomplex x,
int  incx,
dcomplex a,
int  a_rs,
int  a_cs 
)
146{
147 int m_save = m;
148 dcomplex* a_save = a;
149 int a_rs_save = a_rs;
150 int a_cs_save = a_cs;
151 int lda, inca;
152
153 // Return early if possible.
154 if ( bl1_zero_dim1( m ) ) return;
155
156 // If necessary, allocate, initialize, and use a temporary contiguous
157 // copy of the matrix rather than the original matrix.
159 m,
160 m,
162 &a, &a_rs, &a_cs );
163
164 // Initialize with values assuming column-major storage.
165 lda = a_cs;
166 inca = a_rs;
167
168 // If A is a row-major matrix, then we can use the underlying column-major
169 // BLAS implementation by fiddling with the parameters.
170 if ( bl1_is_row_storage( a_rs, a_cs ) )
171 {
173 bl1_toggle_uplo( uplo );
174 }
175
176 bl1_zsyr_blas( uplo,
177 m,
178 alpha,
179 x, incx,
180 a, lda );
181
182 // Free the temporary contiguous matrix.
184 m_save,
186 &a, &a_rs, &a_cs );
187}
void bl1_zsyr_blas(uplo1_t uplo, int m, dcomplex *alpha, dcomplex *x, int incx, dcomplex *a, int lda)
Definition bl1_syr.c:313
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_saved_contigm(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_free_saved_contigm.c:82
Definition blis_type_defs.h:138

References bl1_is_row_storage(), bl1_zcreate_contigmr(), bl1_zero_dim1(), bl1_zfree_saved_contigm(), and bl1_zsyr_blas().

Referenced by FLA_Syr_external().

◆ bl1_zsyr_blas()

void bl1_zsyr_blas ( uplo1_t  uplo,
int  m,
dcomplex alpha,
dcomplex x,
int  incx,
dcomplex a,
int  lda 
)
314{
317 int k = 1;
318 int ldx = m;
319
320#ifdef BLIS1_ENABLE_CBLAS_INTERFACES
324
327
328 x_copy = bl1_zallocv( m );
329
331 m,
332 x, incx,
333 x_copy, 1 );
334
335 beta.real = 1.0;
336 beta.imag = 0.0;
337
341 m,
342 k,
343 alpha,
344 x_copy, ldx,
345 &beta,
346 a, lda );
347
348 bl1_zfree( x_copy );
349#else
350 char blas_uplo;
351 char blas_trans;
352
355
356 x_copy = bl1_zallocv( m );
357
359 m,
360 x, incx,
361 x_copy, 1 );
362
363 beta.real = 1.0;
364 beta.imag = 0.0;
365
367 &blas_trans,
368 &m,
369 &k,
370 alpha,
371 x_copy, &ldx,
372 &beta,
373 a, &lda );
374
375 bl1_zfree( x_copy );
376#endif
377}
void bl1_zcopyv(conj1_t conj, int m, dcomplex *x, int incx, dcomplex *y, int incy)
Definition bl1_copyv.c:63
void F77_zsyrk(char *uplo, char *transa, int *n, int *k, dcomplex *alpha, dcomplex *a, int *lda, dcomplex *beta, dcomplex *c, int *ldc)
void cblas_zsyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans, const int N, const int K, const void *alpha, const void *A, const int lda, const void *beta, void *C, const int ldc)
dcomplex * bl1_zallocv(unsigned int n_elem)
Definition bl1_allocv.c:45
void bl1_zfree(dcomplex *p)
Definition bl1_free.c:45

References bl1_param_map_to_netlib_trans(), bl1_param_map_to_netlib_uplo(), bl1_zallocv(), bl1_zcopyv(), bl1_zfree(), BLIS1_NO_CONJUGATE, BLIS1_NO_TRANSPOSE, cblas_zsyrk(), CblasColMajor, F77_zsyrk(), dcomplex::imag, and dcomplex::real.

Referenced by bl1_zsyr().