libflame revision_anchor
Functions
bl1_axpymrt.c File Reference

(r)

Functions

void bl1_saxpymrt (uplo1_t uplo, trans1_t trans, int m, int n, float *alpha, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
 
void bl1_daxpymrt (uplo1_t uplo, trans1_t trans, int m, int n, double *alpha, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
 
void bl1_caxpymrt (uplo1_t uplo, trans1_t trans, int m, int n, scomplex *alpha, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
 
void bl1_zaxpymrt (uplo1_t uplo, trans1_t trans, int m, int n, dcomplex *alpha, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
 

Function Documentation

◆ bl1_caxpymrt()

void bl1_caxpymrt ( uplo1_t  uplo,
trans1_t  trans,
int  m,
int  n,
scomplex alpha,
scomplex a,
int  a_rs,
int  a_cs,
scomplex b,
int  b_rs,
int  b_cs 
)
228{
231 int lda, inca;
232 int ldb, incb;
233 int n_iter;
234 int n_elem;
235 int n_elem_max;
237 int j;
239
240 // Return early if possible.
241 if ( bl1_zero_dim2( m, n ) ) return;
242
243 // Initialize variables based on storage format of B and value of uplo.
244 if ( bl1_is_col_storage( b_rs, b_cs ) )
245 {
246 if ( bl1_is_lower( uplo ) )
247 {
248 n_iter = bl1_min( m, n );
249 n_elem_max = m;
250 lda = a_cs;
251 inca = a_rs;
252 ldb = b_cs;
253 incb = b_rs;
255 }
256 else // if ( bl1_is_upper( uplo ) )
257 {
258 n_iter = n;
259 n_elem_max = bl1_min( m, n );
260 lda = a_cs;
261 inca = a_rs;
262 ldb = b_cs;
263 incb = b_rs;
265 }
266 }
267 else // if ( bl1_is_row_storage( b_rs, b_cs ) )
268 {
269 if ( bl1_is_lower( uplo ) )
270 {
271 n_iter = m;
272 n_elem_max = bl1_min( m, n );
273 lda = a_rs;
274 inca = a_cs;
275 ldb = b_rs;
276 incb = b_cs;
278 }
279 else // if ( bl1_is_upper( uplo ) )
280 {
281 n_iter = bl1_min( m, n );
282 n_elem_max = n;
283 lda = a_rs;
284 inca = a_cs;
285 ldb = b_rs;
286 incb = b_cs;
288 }
289 }
290
291 // Swap lda and inca if we're doing a transpose.
292 if ( bl1_does_trans( trans ) )
293 {
295 }
296
297 // Extract conj component from trans parameter.
299
300 // Choose the loop based on whether n_elem will be shrinking or growing
301 // with each iteration.
303 {
304 for ( j = 0; j < n_iter; j++ )
305 {
306 n_elem = n_elem_max - j;
307 a_begin = a + j*lda + j*inca;
308 b_begin = b + j*ldb + j*incb;
309
311 n_elem,
312 alpha,
313 a_begin, inca,
314 b_begin, incb );
315 }
316 }
317 else // if ( n_elem_is_ascending )
318 {
319 for ( j = 0; j < n_iter; j++ )
320 {
321 n_elem = bl1_min( j + 1, n_elem_max );
322 a_begin = a + j*lda;
323 b_begin = b + j*ldb;
324
326 n_elem,
327 alpha,
328 a_begin, inca,
329 b_begin, incb );
330 }
331 }
332}
int i
Definition bl1_axmyv2.c:145
void bl1_caxpyv(conj1_t conj, int n, scomplex *alpha, scomplex *x, int incx, scomplex *y, int incy)
Definition bl1_axpyv.c:29
int bl1_is_lower(uplo1_t uplo)
Definition bl1_is.c:49
int bl1_is_col_storage(int rs, int cs)
Definition bl1_is.c:90
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition bl1_proj.c:13
int bl1_zero_dim2(int m, int n)
Definition bl1_is.c:118
int bl1_does_trans(trans1_t trans)
Definition bl1_does.c:13
conj1_t
Definition blis_type_defs.h:80
Definition blis_type_defs.h:133

References bl1_caxpyv(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_lower(), bl1_proj_trans1_to_conj(), and bl1_zero_dim2().

Referenced by bl1_cher2k(), bl1_cherk(), and FLA_Axpyrt_external().

◆ bl1_daxpymrt()

void bl1_daxpymrt ( uplo1_t  uplo,
trans1_t  trans,
int  m,
int  n,
double alpha,
double a,
int  a_rs,
int  a_cs,
double b,
int  b_rs,
int  b_cs 
)
121{
122 double* a_begin;
123 double* b_begin;
124 int lda, inca;
125 int ldb, incb;
126 int n_iter;
127 int n_elem;
128 int n_elem_max;
130 int j;
132
133 // Return early if possible.
134 if ( bl1_zero_dim2( m, n ) ) return;
135
136 // Initialize variables based on storage format of B and value of uplo.
137 if ( bl1_is_col_storage( b_rs, b_cs ) )
138 {
139 if ( bl1_is_lower( uplo ) )
140 {
141 n_iter = bl1_min( m, n );
142 n_elem_max = m;
143 lda = a_cs;
144 inca = a_rs;
145 ldb = b_cs;
146 incb = b_rs;
148 }
149 else // if ( bl1_is_upper( uplo ) )
150 {
151 n_iter = n;
152 n_elem_max = bl1_min( m, n );
153 lda = a_cs;
154 inca = a_rs;
155 ldb = b_cs;
156 incb = b_rs;
158 }
159 }
160 else // if ( bl1_is_row_storage( b_rs, b_cs ) )
161 {
162 if ( bl1_is_lower( uplo ) )
163 {
164 n_iter = m;
165 n_elem_max = bl1_min( m, n );
166 lda = a_rs;
167 inca = a_cs;
168 ldb = b_rs;
169 incb = b_cs;
171 }
172 else // if ( bl1_is_upper( uplo ) )
173 {
174 n_iter = bl1_min( m, n );
175 n_elem_max = n;
176 lda = a_rs;
177 inca = a_cs;
178 ldb = b_rs;
179 incb = b_cs;
181 }
182 }
183
184 // Swap lda and inca if we're doing a transpose.
185 if ( bl1_does_trans( trans ) )
186 {
188 }
189
190 // Extract conj component from trans parameter.
192
193 // Choose the loop based on whether n_elem will be shrinking or growing
194 // with each iteration.
196 {
197 for ( j = 0; j < n_iter; j++ )
198 {
199 n_elem = n_elem_max - j;
200 a_begin = a + j*lda + j*inca;
201 b_begin = b + j*ldb + j*incb;
202
204 n_elem,
205 alpha,
206 a_begin, inca,
207 b_begin, incb );
208 }
209 }
210 else // if ( n_elem_is_ascending )
211 {
212 for ( j = 0; j < n_iter; j++ )
213 {
214 n_elem = bl1_min( j + 1, n_elem_max );
215 a_begin = a + j*lda;
216 b_begin = b + j*ldb;
217
219 n_elem,
220 alpha,
221 a_begin, inca,
222 b_begin, incb );
223 }
224 }
225}
void bl1_daxpyv(conj1_t conj, int n, double *alpha, double *x, int incx, double *y, int incy)
Definition bl1_axpyv.c:21

References bl1_daxpyv(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_lower(), bl1_proj_trans1_to_conj(), and bl1_zero_dim2().

Referenced by FLA_Axpyrt_external().

◆ bl1_saxpymrt()

void bl1_saxpymrt ( uplo1_t  uplo,
trans1_t  trans,
int  m,
int  n,
float alpha,
float a,
int  a_rs,
int  a_cs,
float b,
int  b_rs,
int  b_cs 
)
14{
15 float* a_begin;
16 float* b_begin;
17 int lda, inca;
18 int ldb, incb;
19 int n_iter;
20 int n_elem;
21 int n_elem_max;
23 int j;
25
26 // Return early if possible.
27 if ( bl1_zero_dim2( m, n ) ) return;
28
29 // Initialize variables based on storage format of B and value of uplo.
31 {
32 if ( bl1_is_lower( uplo ) )
33 {
34 n_iter = bl1_min( m, n );
35 n_elem_max = m;
36 lda = a_cs;
37 inca = a_rs;
38 ldb = b_cs;
39 incb = b_rs;
41 }
42 else // if ( bl1_is_upper( uplo ) )
43 {
44 n_iter = n;
45 n_elem_max = bl1_min( m, n );
46 lda = a_cs;
47 inca = a_rs;
48 ldb = b_cs;
49 incb = b_rs;
51 }
52 }
53 else // if ( bl1_is_row_storage( b_rs, b_cs ) )
54 {
55 if ( bl1_is_lower( uplo ) )
56 {
57 n_iter = m;
58 n_elem_max = bl1_min( m, n );
59 lda = a_rs;
60 inca = a_cs;
61 ldb = b_rs;
62 incb = b_cs;
64 }
65 else // if ( bl1_is_upper( uplo ) )
66 {
67 n_iter = bl1_min( m, n );
68 n_elem_max = n;
69 lda = a_rs;
70 inca = a_cs;
71 ldb = b_rs;
72 incb = b_cs;
74 }
75 }
76
77 // Swap lda and inca if we're doing a transpose.
78 if ( bl1_does_trans( trans ) )
79 {
81 }
82
83 // Extract conj component from trans parameter.
85
86 // Choose the loop based on whether n_elem will be shrinking or growing
87 // with each iteration.
89 {
90 for ( j = 0; j < n_iter; j++ )
91 {
93 a_begin = a + j*lda + j*inca;
94 b_begin = b + j*ldb + j*incb;
95
97 n_elem,
98 alpha,
100 b_begin, incb );
101 }
102 }
103 else // if ( n_elem_is_ascending )
104 {
105 for ( j = 0; j < n_iter; j++ )
106 {
107 n_elem = bl1_min( j + 1, n_elem_max );
108 a_begin = a + j*lda;
109 b_begin = b + j*ldb;
110
112 n_elem,
113 alpha,
114 a_begin, inca,
115 b_begin, incb );
116 }
117 }
118}
void bl1_saxpyv(conj1_t conj, int n, float *alpha, float *x, int incx, float *y, int incy)
Definition bl1_axpyv.c:13

References bl1_does_trans(), bl1_is_col_storage(), bl1_is_lower(), bl1_proj_trans1_to_conj(), bl1_saxpyv(), and bl1_zero_dim2().

Referenced by FLA_Axpyrt_external().

◆ bl1_zaxpymrt()

void bl1_zaxpymrt ( uplo1_t  uplo,
trans1_t  trans,
int  m,
int  n,
dcomplex alpha,
dcomplex a,
int  a_rs,
int  a_cs,
dcomplex b,
int  b_rs,
int  b_cs 
)
335{
338 int lda, inca;
339 int ldb, incb;
340 int n_iter;
341 int n_elem;
342 int n_elem_max;
344 int j;
346
347 // Return early if possible.
348 if ( bl1_zero_dim2( m, n ) ) return;
349
350 // Initialize variables based on storage format of B and value of uplo.
351 if ( bl1_is_col_storage( b_rs, b_cs ) )
352 {
353 if ( bl1_is_lower( uplo ) )
354 {
355 n_iter = bl1_min( m, n );
356 n_elem_max = m;
357 lda = a_cs;
358 inca = a_rs;
359 ldb = b_cs;
360 incb = b_rs;
362 }
363 else // if ( bl1_is_upper( uplo ) )
364 {
365 n_iter = n;
366 n_elem_max = bl1_min( m, n );
367 lda = a_cs;
368 inca = a_rs;
369 ldb = b_cs;
370 incb = b_rs;
372 }
373 }
374 else // if ( bl1_is_row_storage( b_rs, b_cs ) )
375 {
376 if ( bl1_is_lower( uplo ) )
377 {
378 n_iter = m;
379 n_elem_max = bl1_min( m, n );
380 lda = a_rs;
381 inca = a_cs;
382 ldb = b_rs;
383 incb = b_cs;
385 }
386 else // if ( bl1_is_upper( uplo ) )
387 {
388 n_iter = bl1_min( m, n );
389 n_elem_max = n;
390 lda = a_rs;
391 inca = a_cs;
392 ldb = b_rs;
393 incb = b_cs;
395 }
396 }
397
398 // Swap lda and inca if we're doing a transpose.
399 if ( bl1_does_trans( trans ) )
400 {
402 }
403
404 // Extract conj component from trans parameter.
406
407 // Choose the loop based on whether n_elem will be shrinking or growing
408 // with each iteration.
410 {
411 for ( j = 0; j < n_iter; j++ )
412 {
413 n_elem = n_elem_max - j;
414 a_begin = a + j*lda + j*inca;
415 b_begin = b + j*ldb + j*incb;
416
418 n_elem,
419 alpha,
420 a_begin, inca,
421 b_begin, incb );
422 }
423 }
424 else // if ( n_elem_is_ascending )
425 {
426 for ( j = 0; j < n_iter; j++ )
427 {
428 n_elem = bl1_min( j + 1, n_elem_max );
429 a_begin = a + j*lda;
430 b_begin = b + j*ldb;
431
433 n_elem,
434 alpha,
435 a_begin, inca,
436 b_begin, incb );
437 }
438 }
439}
void bl1_zaxpyv(conj1_t conj, int n, dcomplex *alpha, dcomplex *x, int incx, dcomplex *y, int incy)
Definition bl1_axpyv.c:60
Definition blis_type_defs.h:138

References bl1_does_trans(), bl1_is_col_storage(), bl1_is_lower(), bl1_proj_trans1_to_conj(), bl1_zaxpyv(), and bl1_zero_dim2().

Referenced by bl1_zher2k(), bl1_zherk(), and FLA_Axpyrt_external().