libflame revision_anchor
Functions
FLA_Apply_G_rf_asm_var2.c File Reference

(r)

Functions

FLA_Error FLA_Apply_G_rf_asm_var2 (FLA_Obj G, FLA_Obj A)
 
FLA_Error FLA_Apply_G_rf_ass_var2 (int k_G, int m_A, int n_A, scomplex *buff_G, int rs_G, int cs_G, float *buff_A, int rs_A, int cs_A)
 
FLA_Error FLA_Apply_G_rf_asd_var2 (int k_G, int m_A, int n_A, dcomplex *buff_G, int rs_G, int cs_G, double *buff_A, int rs_A, int cs_A)
 
FLA_Error FLA_Apply_G_rf_asc_var2 (int k_G, int m_A, int n_A, scomplex *buff_G, int rs_G, int cs_G, scomplex *buff_A, int rs_A, int cs_A)
 
FLA_Error FLA_Apply_G_rf_asz_var2 (int k_G, int m_A, int n_A, dcomplex *buff_G, int rs_G, int cs_G, dcomplex *buff_A, int rs_A, int cs_A)
 

Function Documentation

◆ FLA_Apply_G_rf_asc_var2()

FLA_Error FLA_Apply_G_rf_asc_var2 ( int  k_G,
int  m_A,
int  n_A,
scomplex buff_G,
int  rs_G,
int  cs_G,
scomplex buff_A,
int  rs_A,
int  cs_A 
)
344{
345 float one = bl1_s1();
346 float zero = bl1_s0();
347 float gamma;
348 float sigma;
349 scomplex* a1;
350 scomplex* a2;
351 scomplex* g11;
352 int j, g, k;
353 int nG, nG_app;
354 int k_minus_1;
355
356 k_minus_1 = k_G - 1;
357 nG = n_A - 1;
358
359 // Use the simple variant for nG < 2(k - 1).
360 if ( nG < k_minus_1 || k_G == 1 )
361 {
363 m_A,
364 n_A,
365 buff_G, rs_G, cs_G,
366 buff_A, rs_A, cs_A );
367 return FLA_SUCCESS;
368 }
369
370
371 // Start-up phase.
372
373 for ( j = 0; j < k_minus_1; ++j )
374 {
375 nG_app = j + 1;
376
377 for ( k = 0, g = nG_app - 1; k < nG_app; ++k, --g )
378 {
379 g11 = buff_G + (g )*rs_G + (k )*cs_G;
380 a1 = buff_A + (g )*cs_A;
381 a2 = buff_A + (g + 1)*cs_A;
382
383 gamma = g11->real;
384 sigma = g11->imag;
385
386 // Skip the current iteration if the rotation is identity.
387 if ( gamma == one && sigma == zero ) continue;
388
390 &gamma,
391 &sigma,
392 a1, 1,
393 a2, 1 );
394 }
395 }
396
397 // Pipeline stage
398
399 for ( j = k_minus_1; j < nG; ++j )
400 {
401 nG_app = k_G;
402
403 for ( k = 0, g = j; k < nG_app; ++k, --g )
404 {
405 g11 = buff_G + (g )*rs_G + (k )*cs_G;
406 a1 = buff_A + (g )*cs_A;
407 a2 = buff_A + (g + 1)*cs_A;
408
409 gamma = g11->real;
410 sigma = g11->imag;
411
412 // Skip the current iteration if the rotation is identity.
413 if ( gamma == one && sigma == zero ) continue;
414
416 &gamma,
417 &sigma,
418 a1, 1,
419 a2, 1 );
420 }
421 }
422
423 // Shutdown stage
424
425 for ( j = nG - k_minus_1; j < nG; ++j )
426 {
427 nG_app = nG - j;
428
429 for ( k = k_G - nG_app, g = nG - 1; k < k_G; ++k, --g )
430 {
431 g11 = buff_G + (g )*rs_G + (k )*cs_G;
432 a1 = buff_A + (g )*cs_A;
433 a2 = buff_A + (g + 1)*cs_A;
434
435 gamma = g11->real;
436 sigma = g11->imag;
437
438 // Skip the current iteration if the rotation is identity.
439 if ( gamma == one && sigma == zero ) continue;
440
442 &gamma,
443 &sigma,
444 a1, 1,
445 a2, 1 );
446 }
447 }
448
449 return FLA_SUCCESS;
450}
FLA_Error FLA_Apply_G_rf_asc_var1(int k_G, int m_A, int n_A, scomplex *buff_G, int rs_G, int cs_G, scomplex *buff_A, int rs_A, int cs_A)
Definition FLA_Apply_G_rf_asm_var1.c:215
int i
Definition bl1_axmyv2.c:145
float bl1_s0(void)
Definition bl1_constants.c:111
float bl1_s1(void)
Definition bl1_constants.c:47
Definition blis_type_defs.h:133

References bl1_s0(), bl1_s1(), FLA_Apply_G_rf_asc_var1(), and i.

Referenced by FLA_Apply_G_rf_asm_var2(), and FLA_Apply_G_rf_blc_var2().

◆ FLA_Apply_G_rf_asd_var2()

FLA_Error FLA_Apply_G_rf_asd_var2 ( int  k_G,
int  m_A,
int  n_A,
dcomplex buff_G,
int  rs_G,
int  cs_G,
double buff_A,
int  rs_A,
int  cs_A 
)
231{
232 double one = bl1_d1();
233 double zero = bl1_d0();
234 double gamma;
235 double sigma;
236 double* a1;
237 double* a2;
238 dcomplex* g11;
239 int j, g, k;
240 int nG, nG_app;
241 int k_minus_1;
242
243 k_minus_1 = k_G - 1;
244 nG = n_A - 1;
245
246 // Use the simple variant for nG < 2(k - 1).
247 if ( nG < k_minus_1 || k_G == 1 )
248 {
250 m_A,
251 n_A,
252 buff_G, rs_G, cs_G,
253 buff_A, rs_A, cs_A );
254 return FLA_SUCCESS;
255 }
256
257
258 // Start-up phase.
259
260 for ( j = 0; j < k_minus_1; ++j )
261 {
262 nG_app = j + 1;
263
264 for ( k = 0, g = nG_app - 1; k < nG_app; ++k, --g )
265 {
266 g11 = buff_G + (g )*rs_G + (k )*cs_G;
267 a1 = buff_A + (g )*cs_A;
268 a2 = buff_A + (g + 1)*cs_A;
269
270 gamma = g11->real;
271 sigma = g11->imag;
272
273 // Skip the current iteration if the rotation is identity.
274 if ( gamma == one && sigma == zero ) continue;
275
277 &gamma,
278 &sigma,
279 a1, 1,
280 a2, 1 );
281 }
282 }
283
284 // Pipeline stage
285
286 for ( j = k_minus_1; j < nG; ++j )
287 {
288 nG_app = k_G;
289
290 for ( k = 0, g = j; k < nG_app; ++k, --g )
291 {
292 g11 = buff_G + (g )*rs_G + (k )*cs_G;
293 a1 = buff_A + (g )*cs_A;
294 a2 = buff_A + (g + 1)*cs_A;
295
296 gamma = g11->real;
297 sigma = g11->imag;
298
299 // Skip the current iteration if the rotation is identity.
300 if ( gamma == one && sigma == zero ) continue;
301
303 &gamma,
304 &sigma,
305 a1, 1,
306 a2, 1 );
307 }
308 }
309
310 // Shutdown stage
311
312 for ( j = nG - k_minus_1; j < nG; ++j )
313 {
314 nG_app = nG - j;
315
316 for ( k = k_G - nG_app, g = nG - 1; k < k_G; ++k, --g )
317 {
318 g11 = buff_G + (g )*rs_G + (k )*cs_G;
319 a1 = buff_A + (g )*cs_A;
320 a2 = buff_A + (g + 1)*cs_A;
321
322 gamma = g11->real;
323 sigma = g11->imag;
324
325 // Skip the current iteration if the rotation is identity.
326 if ( gamma == one && sigma == zero ) continue;
327
329 &gamma,
330 &sigma,
331 a1, 1,
332 a2, 1 );
333 }
334 }
335
336 return FLA_SUCCESS;
337}
FLA_Error FLA_Apply_G_rf_asd_var1(int k_G, int m_A, int n_A, dcomplex *buff_G, int rs_G, int cs_G, double *buff_A, int rs_A, int cs_A)
Definition FLA_Apply_G_rf_asm_var1.c:164
double bl1_d0(void)
Definition bl1_constants.c:118
double bl1_d1(void)
Definition bl1_constants.c:54
Definition blis_type_defs.h:138

References bl1_d0(), bl1_d1(), FLA_Apply_G_rf_asd_var1(), and i.

Referenced by FLA_Apply_G_rf_asm_var2(), and FLA_Apply_G_rf_bld_var2().

◆ FLA_Apply_G_rf_asm_var2()

FLA_Error FLA_Apply_G_rf_asm_var2 ( FLA_Obj  G,
FLA_Obj  A 
)
32{
33 FLA_Datatype datatype;
34 int k_G, m_A, n_A;
35 int rs_G, cs_G;
36 int rs_A, cs_A;
37
38 datatype = FLA_Obj_datatype( A );
39
40 k_G = FLA_Obj_width( G );
41 m_A = FLA_Obj_length( A );
42 n_A = FLA_Obj_width( A );
43
46
49
50 switch ( datatype )
51 {
52 case FLA_FLOAT:
53 {
55 float* buff_A = ( float* ) FLA_FLOAT_PTR( A );
56
58 m_A,
59 n_A,
61 buff_A, rs_A, cs_A );
62
63 break;
64 }
65
66 case FLA_DOUBLE:
67 {
69 double* buff_A = ( double* ) FLA_DOUBLE_PTR( A );
70
72 m_A,
73 n_A,
75 buff_A, rs_A, cs_A );
76
77 break;
78 }
79
80 case FLA_COMPLEX:
81 {
84
86 m_A,
87 n_A,
89 buff_A, rs_A, cs_A );
90
91 break;
92 }
93
95 {
98
100 m_A,
101 n_A,
102 buff_G, rs_G, cs_G,
103 buff_A, rs_A, cs_A );
104
105 break;
106 }
107 }
108
109 return FLA_SUCCESS;
110}
FLA_Error FLA_Apply_G_rf_asc_var2(int k_G, int m_A, int n_A, scomplex *buff_G, int rs_G, int cs_G, scomplex *buff_A, int rs_A, int cs_A)
Definition FLA_Apply_G_rf_asm_var2.c:339
FLA_Error FLA_Apply_G_rf_asd_var2(int k_G, int m_A, int n_A, dcomplex *buff_G, int rs_G, int cs_G, double *buff_A, int rs_A, int cs_A)
Definition FLA_Apply_G_rf_asm_var2.c:226
FLA_Error FLA_Apply_G_rf_ass_var2(int k_G, int m_A, int n_A, scomplex *buff_G, int rs_G, int cs_G, float *buff_A, int rs_A, int cs_A)
Definition FLA_Apply_G_rf_asm_var2.c:113
FLA_Error FLA_Apply_G_rf_asz_var2(int k_G, int m_A, int n_A, dcomplex *buff_G, int rs_G, int cs_G, dcomplex *buff_A, int rs_A, int cs_A)
Definition FLA_Apply_G_rf_asm_var2.c:452
dim_t FLA_Obj_width(FLA_Obj obj)
Definition FLA_Query.c:123
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition FLA_Query.c:167
dim_t FLA_Obj_length(FLA_Obj obj)
Definition FLA_Query.c:116
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition FLA_Query.c:174
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition FLA_Query.c:13
int FLA_Datatype
Definition FLA_type_defs.h:49

References FLA_Apply_G_rf_asc_var2(), FLA_Apply_G_rf_asd_var2(), FLA_Apply_G_rf_ass_var2(), FLA_Apply_G_rf_asz_var2(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), and i.

◆ FLA_Apply_G_rf_ass_var2()

FLA_Error FLA_Apply_G_rf_ass_var2 ( int  k_G,
int  m_A,
int  n_A,
scomplex buff_G,
int  rs_G,
int  cs_G,
float buff_A,
int  rs_A,
int  cs_A 
)
118{
119 float one = bl1_s1();
120 float zero = bl1_s0();
121 float gamma;
122 float sigma;
123 float* a1;
124 float* a2;
125 scomplex* g11;
126 int j, g, k;
127 int nG, nG_app;
128 int k_minus_1;
129
130 k_minus_1 = k_G - 1;
131 nG = n_A - 1;
132
133 // Use the simple variant for nG < 2(k - 1).
134 if ( nG < k_minus_1 || k_G == 1 )
135 {
137 m_A,
138 n_A,
139 buff_G, rs_G, cs_G,
140 buff_A, rs_A, cs_A );
141 return FLA_SUCCESS;
142 }
143
144
145 // Start-up phase.
146
147 for ( j = 0; j < k_minus_1; ++j )
148 {
149 nG_app = j + 1;
150
151 for ( k = 0, g = nG_app - 1; k < nG_app; ++k, --g )
152 {
153 g11 = buff_G + (g )*rs_G + (k )*cs_G;
154 a1 = buff_A + (g )*cs_A;
155 a2 = buff_A + (g + 1)*cs_A;
156
157 gamma = g11->real;
158 sigma = g11->imag;
159
160 // Skip the current iteration if the rotation is identity.
161 if ( gamma == one && sigma == zero ) continue;
162
164 &gamma,
165 &sigma,
166 a1, 1,
167 a2, 1 );
168 }
169 }
170
171 // Pipeline stage
172
173 for ( j = k_minus_1; j < nG; ++j )
174 {
175 nG_app = k_G;
176
177 for ( k = 0, g = j; k < nG_app; ++k, --g )
178 {
179 g11 = buff_G + (g )*rs_G + (k )*cs_G;
180 a1 = buff_A + (g )*cs_A;
181 a2 = buff_A + (g + 1)*cs_A;
182
183 gamma = g11->real;
184 sigma = g11->imag;
185
186 // Skip the current iteration if the rotation is identity.
187 if ( gamma == one && sigma == zero ) continue;
188
190 &gamma,
191 &sigma,
192 a1, 1,
193 a2, 1 );
194 }
195 }
196
197 // Shutdown stage
198
199 for ( j = nG - k_minus_1; j < nG; ++j )
200 {
201 nG_app = nG - j;
202
203 for ( k = k_G - nG_app, g = nG - 1; k < k_G; ++k, --g )
204 {
205 g11 = buff_G + (g )*rs_G + (k )*cs_G;
206 a1 = buff_A + (g )*cs_A;
207 a2 = buff_A + (g + 1)*cs_A;
208
209 gamma = g11->real;
210 sigma = g11->imag;
211
212 // Skip the current iteration if the rotation is identity.
213 if ( gamma == one && sigma == zero ) continue;
214
216 &gamma,
217 &sigma,
218 a1, 1,
219 a2, 1 );
220 }
221 }
222
223 return FLA_SUCCESS;
224}
FLA_Error FLA_Apply_G_rf_ass_var1(int k_G, int m_A, int n_A, scomplex *buff_G, int rs_G, int cs_G, float *buff_A, int rs_A, int cs_A)
Definition FLA_Apply_G_rf_asm_var1.c:113

References bl1_s0(), bl1_s1(), FLA_Apply_G_rf_ass_var1(), and i.

Referenced by FLA_Apply_G_rf_asm_var2(), and FLA_Apply_G_rf_bls_var2().

◆ FLA_Apply_G_rf_asz_var2()

FLA_Error FLA_Apply_G_rf_asz_var2 ( int  k_G,
int  m_A,
int  n_A,
dcomplex buff_G,
int  rs_G,
int  cs_G,
dcomplex buff_A,
int  rs_A,
int  cs_A 
)
457{
458 double one = bl1_d1();
459 double zero = bl1_d0();
460 double gamma;
461 double sigma;
462 dcomplex* a1;
463 dcomplex* a2;
464 dcomplex* g11;
465 int j, g, k;
466 int nG, nG_app;
467 int k_minus_1;
468
469 k_minus_1 = k_G - 1;
470 nG = n_A - 1;
471
472 // Use the simple variant for nG < 2(k - 1).
473 if ( nG < k_minus_1 || k_G == 1 )
474 {
476 m_A,
477 n_A,
478 buff_G, rs_G, cs_G,
479 buff_A, rs_A, cs_A );
480 return FLA_SUCCESS;
481 }
482
483
484 // Start-up phase.
485
486 for ( j = 0; j < k_minus_1; ++j )
487 {
488 nG_app = j + 1;
489
490 for ( k = 0, g = nG_app - 1; k < nG_app; ++k, --g )
491 {
492 g11 = buff_G + (g )*rs_G + (k )*cs_G;
493 a1 = buff_A + (g )*cs_A;
494 a2 = buff_A + (g + 1)*cs_A;
495
496 gamma = g11->real;
497 sigma = g11->imag;
498
499 // Skip the current iteration if the rotation is identity.
500 if ( gamma == one && sigma == zero ) continue;
501
503 &gamma,
504 &sigma,
505 a1, 1,
506 a2, 1 );
507 }
508 }
509
510 // Pipeline stage
511
512 for ( j = k_minus_1; j < nG; ++j )
513 {
514 nG_app = k_G;
515
516 for ( k = 0, g = j; k < nG_app; ++k, --g )
517 {
518 g11 = buff_G + (g )*rs_G + (k )*cs_G;
519 a1 = buff_A + (g )*cs_A;
520 a2 = buff_A + (g + 1)*cs_A;
521
522 gamma = g11->real;
523 sigma = g11->imag;
524
525 // Skip the current iteration if the rotation is identity.
526 if ( gamma == one && sigma == zero ) continue;
527
529 &gamma,
530 &sigma,
531 a1, 1,
532 a2, 1 );
533 }
534 }
535
536 // Shutdown stage
537
538 for ( j = nG - k_minus_1; j < nG; ++j )
539 {
540 nG_app = nG - j;
541
542 for ( k = k_G - nG_app, g = nG - 1; k < k_G; ++k, --g )
543 {
544 g11 = buff_G + (g )*rs_G + (k )*cs_G;
545 a1 = buff_A + (g )*cs_A;
546 a2 = buff_A + (g + 1)*cs_A;
547
548 gamma = g11->real;
549 sigma = g11->imag;
550
551 // Skip the current iteration if the rotation is identity.
552 if ( gamma == one && sigma == zero ) continue;
553
555 &gamma,
556 &sigma,
557 a1, 1,
558 a2, 1 );
559 }
560 }
561
562 return FLA_SUCCESS;
563}
FLA_Error FLA_Apply_G_rf_asz_var1(int k_G, int m_A, int n_A, dcomplex *buff_G, int rs_G, int cs_G, dcomplex *buff_A, int rs_A, int cs_A)
Definition FLA_Apply_G_rf_asm_var1.c:267

References bl1_d0(), bl1_d1(), FLA_Apply_G_rf_asz_var1(), and i.

Referenced by FLA_Apply_G_rf_asm_var2(), and FLA_Apply_G_rf_blz_var2().