libflame  revision_anchor
Functions
FLA_Apply_QUD_UT_lhfc.h File Reference

(r)

Go to the source code of this file.

Functions

FLA_Error FLA_Apply_QUD_UT_lhfc_blk_var1 (FLA_Obj T, FLA_Obj W, FLA_Obj R, FLA_Obj U, FLA_Obj C, FLA_Obj V, FLA_Obj D, fla_apqudut_t *cntl)
 
FLA_Error FLA_Apply_QUD_UT_lhfc_blk_var2 (FLA_Obj T, FLA_Obj W, FLA_Obj R, FLA_Obj U, FLA_Obj C, FLA_Obj V, FLA_Obj D, fla_apqudut_t *cntl)
 
FLA_Error FLA_Apply_QUD_UT_lhfc_blk_var3 (FLA_Obj T, FLA_Obj W, FLA_Obj R, FLA_Obj U, FLA_Obj C, FLA_Obj V, FLA_Obj D, fla_apqudut_t *cntl)
 

Function Documentation

◆ FLA_Apply_QUD_UT_lhfc_blk_var1()

FLA_Error FLA_Apply_QUD_UT_lhfc_blk_var1 ( FLA_Obj  T,
FLA_Obj  W,
FLA_Obj  R,
FLA_Obj  U,
FLA_Obj  C,
FLA_Obj  V,
FLA_Obj  D,
fla_apqudut_t cntl 
)
17 {
18  FLA_Obj TL, TR, T0, T1, T2;
19 
20  FLA_Obj UL, UR, U0, U1, U2;
21 
22  FLA_Obj VL, VR, V0, V1, V2;
23 
24  FLA_Obj RT, R0,
25  RB, R1,
26  R2;
27 
28  FLA_Obj T1T,
29  T1B;
30 
31  FLA_Obj W1TL, W1TR,
32  W1BL, W1BR;
33 
34  dim_t b_alg, b;
35 
36  // Query the algorithmic blocksize by inspecting the length of T.
37  b_alg = FLA_Obj_length( T );
38 
39  FLA_Part_1x2( T, &TL, &TR, 0, FLA_LEFT );
40 
41  FLA_Part_1x2( U, &UL, &UR, 0, FLA_LEFT );
42 
43  FLA_Part_1x2( V, &VL, &VR, 0, FLA_LEFT );
44 
45  FLA_Part_2x1( R, &RT,
46  &RB, 0, FLA_TOP );
47 
48  while ( FLA_Obj_width( UL ) < FLA_Obj_width( U ) ){
49 
50  b = min( b_alg, FLA_Obj_width( UR ) );
51 
52  FLA_Repart_1x2_to_1x3( TL, /**/ TR, &T0, /**/ &T1, &T2,
53  b, FLA_RIGHT );
54 
55  FLA_Repart_1x2_to_1x3( UL, /**/ UR, &U0, /**/ &U1, &U2,
56  b, FLA_RIGHT );
57 
58  FLA_Repart_1x2_to_1x3( VL, /**/ VR, &V0, /**/ &V1, &V2,
59  b, FLA_RIGHT );
60 
61  FLA_Repart_2x1_to_3x1( RT, &R0,
62  /* ** */ /* ** */
63  &R1,
64  RB, &R2, b, FLA_BOTTOM );
65 
66  /*------------------------------------------------------------*/
67 
68  FLA_Part_2x1( T1, &T1T,
69  &T1B, b, FLA_TOP );
70 
71  FLA_Part_2x2( W, &W1TL, &W1TR,
72  &W1BL, &W1BR, b, FLA_Obj_width( R1 ), FLA_TL );
73 
74  // W1TL = R1;
75 
76  FLA_Copyt_internal( FLA_NO_TRANSPOSE, R1, W1TL,
77  FLA_Cntl_sub_copyt( cntl ) );
78 
79  // W1TL = inv( triu( T1T ) )' * ( R1 + U1' * C + V1' * D );
80 
81  FLA_Gemm_internal( FLA_CONJ_TRANSPOSE, FLA_NO_TRANSPOSE,
82  FLA_ONE, U1, C, FLA_ONE, W1TL,
83  FLA_Cntl_sub_gemm1( cntl ) );
84 
85  FLA_Gemm_internal( FLA_CONJ_TRANSPOSE, FLA_NO_TRANSPOSE,
86  FLA_ONE, V1, D, FLA_ONE, W1TL,
87  FLA_Cntl_sub_gemm2( cntl ) );
88 
89  FLA_Trsm_internal( FLA_LEFT, FLA_UPPER_TRIANGULAR,
90  FLA_CONJ_TRANSPOSE, FLA_NONUNIT_DIAG,
91  FLA_ONE, T1T, W1TL,
92  FLA_Cntl_sub_trsm( cntl ) );
93 
94  // R1 = R1 - W1TL;
95  // C = C - U1 * W1TL;
96  // D = D + V1 * W1TL;
97 
98  FLA_Axpyt_internal( FLA_NO_TRANSPOSE, FLA_MINUS_ONE, W1TL, R1,
99  FLA_Cntl_sub_axpyt( cntl ) );
100 
101  FLA_Gemm_internal( FLA_NO_TRANSPOSE, FLA_NO_TRANSPOSE,
102  FLA_MINUS_ONE, U1, W1TL, FLA_ONE, C,
103  FLA_Cntl_sub_gemm3( cntl ) );
104 
105  FLA_Gemm_internal( FLA_NO_TRANSPOSE, FLA_NO_TRANSPOSE,
106  FLA_ONE, V1, W1TL, FLA_ONE, D,
107  FLA_Cntl_sub_gemm4( cntl ) );
108 
109  /*------------------------------------------------------------*/
110 
111  FLA_Cont_with_1x3_to_1x2( &TL, /**/ &TR, T0, T1, /**/ T2,
112  FLA_LEFT );
113 
114  FLA_Cont_with_1x3_to_1x2( &UL, /**/ &UR, U0, U1, /**/ U2,
115  FLA_LEFT );
116 
117  FLA_Cont_with_1x3_to_1x2( &VL, /**/ &VR, V0, V1, /**/ V2,
118  FLA_LEFT );
119 
120  FLA_Cont_with_3x1_to_2x1( &RT, R0,
121  R1,
122  /* ** */ /* ** */
123  &RB, R2, FLA_TOP );
124  }
125 
126  return FLA_SUCCESS;
127 }
FLA_Error FLA_Axpyt_internal(FLA_Trans trans, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, fla_axpyt_t *cntl)
Definition: FLA_Axpyt_internal.c:16
FLA_Error FLA_Copyt_internal(FLA_Trans trans, FLA_Obj A, FLA_Obj B, fla_copyt_t *cntl)
Definition: FLA_Copyt_internal.c:16
FLA_Error FLA_Gemm_internal(FLA_Trans transa, FLA_Trans transb, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C, fla_gemm_t *cntl)
Definition: FLA_Gemm_internal.c:16
FLA_Error FLA_Trsm_internal(FLA_Side side, FLA_Uplo uplo, FLA_Trans transa, FLA_Diag diag, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, fla_trsm_t *cntl)
Definition: FLA_Trsm_internal.c:16
FLA_Obj FLA_MINUS_ONE
Definition: FLA_Init.c:22
FLA_Obj FLA_ONE
Definition: FLA_Init.c:18
FLA_Error FLA_Part_2x2(FLA_Obj A, FLA_Obj *A11, FLA_Obj *A12, FLA_Obj *A21, FLA_Obj *A22, dim_t mb, dim_t nb, FLA_Quadrant quadrant)
Definition: FLA_View.c:17
FLA_Error FLA_Cont_with_3x1_to_2x1(FLA_Obj *AT, FLA_Obj A0, FLA_Obj A1, FLA_Obj *AB, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:428
FLA_Error FLA_Repart_2x1_to_3x1(FLA_Obj AT, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj AB, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:226
FLA_Error FLA_Cont_with_1x3_to_1x2(FLA_Obj *AL, FLA_Obj *AR, FLA_Obj A0, FLA_Obj A1, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:475
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
FLA_Error FLA_Part_1x2(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t nb, FLA_Side side)
Definition: FLA_View.c:110
FLA_Error FLA_Part_2x1(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:76
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
FLA_Error FLA_Repart_1x2_to_1x3(FLA_Obj AL, FLA_Obj AR, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj *A2, dim_t nb, FLA_Side side)
Definition: FLA_View.c:267
unsigned long dim_t
Definition: FLA_type_defs.h:71
Definition: FLA_type_defs.h:159

References FLA_Axpyt_internal(), FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x1_to_2x1(), FLA_Copyt_internal(), FLA_Gemm_internal(), FLA_MINUS_ONE, FLA_Obj_length(), FLA_Obj_width(), FLA_ONE, FLA_Part_1x2(), FLA_Part_2x1(), FLA_Part_2x2(), FLA_Repart_1x2_to_1x3(), FLA_Repart_2x1_to_3x1(), and FLA_Trsm_internal().

Referenced by FLA_Apply_QUD_UT_lhfc().

◆ FLA_Apply_QUD_UT_lhfc_blk_var2()

FLA_Error FLA_Apply_QUD_UT_lhfc_blk_var2 ( FLA_Obj  T,
FLA_Obj  W,
FLA_Obj  R,
FLA_Obj  U,
FLA_Obj  C,
FLA_Obj  V,
FLA_Obj  D,
fla_apqudut_t cntl 
)
17 {
18  FLA_Obj WL, WR, W0, W1, W2;
19 
20  FLA_Obj RL, RR, R0, R1, R2;
21 
22  FLA_Obj CL, CR, C0, C1, C2;
23 
24  FLA_Obj DL, DR, D0, D1, D2;
25 
26  dim_t b;
27 
28  FLA_Part_1x2( W, &WL, &WR, 0, FLA_LEFT );
29 
30  FLA_Part_1x2( R, &RL, &RR, 0, FLA_LEFT );
31 
32  FLA_Part_1x2( C, &CL, &CR, 0, FLA_LEFT );
33 
34  FLA_Part_1x2( D, &DL, &DR, 0, FLA_LEFT );
35 
36  while ( FLA_Obj_width( RL ) < FLA_Obj_width( R ) ){
37 
38  b = FLA_Determine_blocksize( RR, FLA_RIGHT, FLA_Cntl_blocksize( cntl ) );
39 
40  FLA_Repart_1x2_to_1x3( WL, /**/ WR, &W0, /**/ &W1, &W2,
41  b, FLA_RIGHT );
42 
43  FLA_Repart_1x2_to_1x3( RL, /**/ RR, &R0, /**/ &R1, &R2,
44  b, FLA_RIGHT );
45 
46  FLA_Repart_1x2_to_1x3( CL, /**/ CR, &C0, /**/ &C1, &C2,
47  b, FLA_RIGHT );
48 
49  FLA_Repart_1x2_to_1x3( DL, /**/ DR, &D0, /**/ &D1, &D2,
50  b, FLA_RIGHT );
51 
52  /*------------------------------------------------------------*/
53 
54  // Apply Q' to R1, C1, and D1 from the left:
55  //
56  // / R1 \ / R1 \
57  // | C1 | = Q' | C1 |
58  // \ D1 / \ D1 /
59  //
60  // where Q is formed from U, V, and T.
61 
62  FLA_Apply_QUD_UT_internal( FLA_LEFT, FLA_CONJ_TRANSPOSE, FLA_FORWARD, FLA_COLUMNWISE,
63  T, W1,
64  R1,
65  U, C1,
66  V, D1, FLA_Cntl_sub_apqudut( cntl ) );
67 
68  /*------------------------------------------------------------*/
69 
70  FLA_Cont_with_1x3_to_1x2( &WL, /**/ &WR, W0, W1, /**/ W2,
71  FLA_LEFT );
72 
73  FLA_Cont_with_1x3_to_1x2( &RL, /**/ &RR, R0, R1, /**/ R2,
74  FLA_LEFT );
75 
76  FLA_Cont_with_1x3_to_1x2( &CL, /**/ &CR, C0, C1, /**/ C2,
77  FLA_LEFT );
78 
79  FLA_Cont_with_1x3_to_1x2( &DL, /**/ &DR, D0, D1, /**/ D2,
80  FLA_LEFT );
81  }
82 
83  return FLA_SUCCESS;
84 }
FLA_Error FLA_Apply_QUD_UT_internal(FLA_Side side, FLA_Trans trans, FLA_Direct direct, FLA_Store storev, FLA_Obj T, FLA_Obj W, FLA_Obj R, FLA_Obj U, FLA_Obj C, FLA_Obj V, FLA_Obj D, fla_apqudut_t *cntl)
Definition: FLA_Apply_QUD_UT_internal.c:17
dim_t FLA_Determine_blocksize(FLA_Obj A_unproc, FLA_Quadrant to_dir, fla_blocksize_t *cntl_blocksizes)
Definition: FLA_Blocksize.c:234

References FLA_Apply_QUD_UT_internal(), FLA_Cont_with_1x3_to_1x2(), FLA_Determine_blocksize(), FLA_Obj_width(), FLA_Part_1x2(), and FLA_Repart_1x2_to_1x3().

Referenced by FLA_Apply_QUD_UT_lhfc().

◆ FLA_Apply_QUD_UT_lhfc_blk_var3()

FLA_Error FLA_Apply_QUD_UT_lhfc_blk_var3 ( FLA_Obj  T,
FLA_Obj  W,
FLA_Obj  R,
FLA_Obj  U,
FLA_Obj  C,
FLA_Obj  V,
FLA_Obj  D,
fla_apqudut_t cntl 
)
17 {
18  FLA_Obj TT, T0,
19  TB, T1,
20  T2;
21 
22  FLA_Obj UT, U0,
23  UB, U1,
24  U2;
25 
26  FLA_Obj VT, V0,
27  VB, V1,
28  V2;
29 
30  FLA_Obj CT, C0,
31  CB, C1,
32  C2;
33 
34  FLA_Obj DT, D0,
35  DB, D1,
36  D2;
37 
38  dim_t b_T, b_UC, b_VD;
39 
40  FLA_Part_2x1( T, &TT,
41  &TB, 0, FLA_TOP );
42 
43  FLA_Part_2x1( U, &UT,
44  &UB, 0, FLA_TOP );
45 
46  FLA_Part_2x1( V, &VT,
47  &VB, 0, FLA_TOP );
48 
49  FLA_Part_2x1( C, &CT,
50  &CB, 0, FLA_TOP );
51 
52  FLA_Part_2x1( D, &DT,
53  &DB, 0, FLA_TOP );
54 
55  while ( FLA_Obj_length( TT ) < FLA_Obj_length( T ) ){
56 
57  b_T = FLA_Determine_blocksize( TB, FLA_BOTTOM, FLA_Cntl_blocksize( cntl ) );
58  b_UC = FLA_Determine_blocksize( UB, FLA_BOTTOM, FLA_Cntl_blocksize( cntl ) );
59  b_VD = FLA_Determine_blocksize( VB, FLA_BOTTOM, FLA_Cntl_blocksize( cntl ) );
60 
61  FLA_Repart_2x1_to_3x1( TT, &T0,
62  /* ** */ /* ** */
63  &T1,
64  TB, &T2, b_T, FLA_BOTTOM );
65 
66  FLA_Repart_2x1_to_3x1( UT, &U0,
67  /* ** */ /* ** */
68  &U1,
69  UB, &U2, b_UC, FLA_BOTTOM );
70 
71  FLA_Repart_2x1_to_3x1( VT, &V0,
72  /* ** */ /* ** */
73  &V1,
74  VB, &V2, b_VD, FLA_BOTTOM );
75 
76  FLA_Repart_2x1_to_3x1( CT, &C0,
77  /* ** */ /* ** */
78  &C1,
79  CB, &C2, b_UC, FLA_BOTTOM );
80 
81  FLA_Repart_2x1_to_3x1( DT, &D0,
82  /* ** */ /* ** */
83  &D1,
84  DB, &D2, b_VD, FLA_BOTTOM );
85 
86  /*------------------------------------------------------------*/
87 
88  // / R \ / R \
89  // | C1 | = Q' | C1 |
90  // \ D1 / \ D1 /
91  //
92  // where Q is formed from U1, V1, and T1.
93 
94  FLA_Apply_QUD_UT_internal( FLA_LEFT, FLA_CONJ_TRANSPOSE, FLA_FORWARD, FLA_COLUMNWISE,
95  T1, W,
96  R,
97  U1, C1,
98  V1, D1, FLA_Cntl_sub_apqudut( cntl ) );
99 
100  /*------------------------------------------------------------*/
101 
102  FLA_Cont_with_3x1_to_2x1( &TT, T0,
103  T1,
104  /* ** */ /* ** */
105  &TB, T2, FLA_TOP );
106 
107  FLA_Cont_with_3x1_to_2x1( &UT, U0,
108  U1,
109  /* ** */ /* ** */
110  &UB, U2, FLA_TOP );
111 
112  FLA_Cont_with_3x1_to_2x1( &VT, V0,
113  V1,
114  /* ** */ /* ** */
115  &VB, V2, FLA_TOP );
116 
117  FLA_Cont_with_3x1_to_2x1( &CT, C0,
118  C1,
119  /* ** */ /* ** */
120  &CB, C2, FLA_TOP );
121 
122  FLA_Cont_with_3x1_to_2x1( &DT, D0,
123  D1,
124  /* ** */ /* ** */
125  &DB, D2, FLA_TOP );
126  }
127 
128  return FLA_SUCCESS;
129 }

References FLA_Apply_QUD_UT_internal(), FLA_Cont_with_3x1_to_2x1(), FLA_Determine_blocksize(), FLA_Obj_length(), FLA_Part_2x1(), and FLA_Repart_2x1_to_3x1().

Referenced by FLA_Apply_QUD_UT_lhfc().