libflame revision_anchor
Functions
FLA_Apply_Q_UT_lhbc_blk_var1.c File Reference

(r)

Functions

FLA_Error FLA_Apply_Q_UT_lhbc_blk_var1 (FLA_Obj A, FLA_Obj T, FLA_Obj W, FLA_Obj B, fla_apqut_t *cntl)
 

Function Documentation

◆ FLA_Apply_Q_UT_lhbc_blk_var1()

FLA_Error FLA_Apply_Q_UT_lhbc_blk_var1 ( FLA_Obj  A,
FLA_Obj  T,
FLA_Obj  W,
FLA_Obj  B,
fla_apqut_t cntl 
)
90{
91 FLA_Obj ATL, ATR, A00, A01, A02,
92 ABL, ABR, A10, A11, A12,
93 A20, A21, A22;
94
95 FLA_Obj TL, TR, T0, T1, T2;
96
98 T2B;
99
100 FLA_Obj WTL, WTR,
101 WBL, WBR;
102
103 FLA_Obj BT, B0,
104 BB, B1,
105 B2;
106
107 dim_t b_alg, b;
108 dim_t m_BR, n_BR;
109
110 // Query the algorithmic blocksize by inspecting the length of T.
112
113 // If m > n, then we have to initialize our partitionings carefully so
114 // that we begin in the proper location in A and B (since we traverse
115 // matrix A from BR to TL).
116 if ( FLA_Obj_length( A ) > FLA_Obj_width( A ) )
117 {
119 n_BR = 0;
120 }
121 else if ( FLA_Obj_length( A ) < FLA_Obj_width( A ) )
122 {
123 m_BR = 0;
125 }
126 else
127 {
128 m_BR = 0;
129 n_BR = 0;
130 }
131
132 FLA_Part_2x2( A, &ATL, &ATR,
133 &ABL, &ABR, m_BR, n_BR, FLA_BR );
134
135 // A and T are dependent; we determine T matrix w.r.t. A
137
138 FLA_Part_2x1( B, &BT,
139 &BB, m_BR, FLA_BOTTOM );
140
141 while ( FLA_Obj_min_dim( ATL ) > 0 ){
142
143 b = min( b_alg, FLA_Obj_min_dim( ATL ) );
144
145 // Since T was filled from left to right, and since we need to access them
146 // in reverse order, we need to handle the case where the last block is
147 // smaller than the other b x b blocks.
148 if ( FLA_Obj_width( TR ) == 0 && FLA_Obj_width( T ) % b_alg > 0 )
149 b = FLA_Obj_width( T ) % b_alg;
150
151 FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, &A01, /**/ &A02,
152 &A10, &A11, /**/ &A12,
153 /* ************* */ /* ******************** */
154 ABL, /**/ ABR, &A20, &A21, /**/ &A22,
155 b, b, FLA_TL );
156
157 FLA_Repart_1x2_to_1x3( TL, /**/ TR, &T0, &T1, /**/ &T2,
158 b, FLA_LEFT );
159
161 &B1,
162 /* ** */ /* ** */
163 BB, &B2, b, FLA_TOP );
164
165 /*------------------------------------------------------------*/
166
167 FLA_Part_2x1( T1, &T1T,
168 &T2B, b, FLA_TOP );
169
170 FLA_Part_2x2( W, &WTL, &WTR,
171 &WBL, &WBR, b, FLA_Obj_width( B1 ), FLA_TL );
172
173 // WTL = B1;
174
176 FLA_Cntl_sub_copyt( cntl ) );
177
178 // U11 = trilu( A11 );
179 // U21 = A21;
180 //
181 // WTL = inv( triu(T1T) ) * ( U11' * B1 + U21' * B2 );
182
185 FLA_ONE, A11, WTL,
186 FLA_Cntl_sub_trmm1( cntl ) );
187
190 FLA_Cntl_sub_gemm1( cntl ) );
191
194 FLA_ONE, T1T, WTL,
195 FLA_Cntl_sub_trsm( cntl ) );
196
197 // B2 = B2 - U21 * WTL;
198 // B1 = B1 - U11 * WTL;
199
202 FLA_Cntl_sub_gemm2( cntl ) );
203
207 FLA_Cntl_sub_trmm2( cntl ) );
208
210 FLA_Cntl_sub_axpyt( cntl ) );
211
212 /*------------------------------------------------------------*/
213
214 FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, /**/ A01, A02,
215 /* ************** */ /* ****************** */
216 A10, /**/ A11, A12,
217 &ABL, /**/ &ABR, A20, /**/ A21, A22,
218 FLA_BR );
219
220 FLA_Cont_with_1x3_to_1x2( &TL, /**/ &TR, T0, /**/ T1, T2,
221 FLA_RIGHT );
222
224 /* ** */ /* ** */
225 B1,
226 &BB, B2, FLA_BOTTOM );
227 }
228
229 return FLA_SUCCESS;
230}
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_Trmm_internal(FLA_Side side, FLA_Uplo uplo, FLA_Trans transa, FLA_Diag diag, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, fla_trmm_t *cntl)
Definition FLA_Trmm_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_Cont_with_3x3_to_2x2(FLA_Obj *ATL, FLA_Obj *ATR, FLA_Obj A00, FLA_Obj A01, FLA_Obj A02, FLA_Obj A10, FLA_Obj A11, FLA_Obj A12, FLA_Obj *ABL, FLA_Obj *ABR, FLA_Obj A20, FLA_Obj A21, FLA_Obj A22, FLA_Quadrant quadrant)
Definition FLA_View.c:304
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_2x2_to_3x3(FLA_Obj ATL, FLA_Obj ATR, FLA_Obj *A00, FLA_Obj *A01, FLA_Obj *A02, FLA_Obj *A10, FLA_Obj *A11, FLA_Obj *A12, FLA_Obj ABL, FLA_Obj ABR, FLA_Obj *A20, FLA_Obj *A21, FLA_Obj *A22, dim_t mb, dim_t nb, FLA_Quadrant quadrant)
Definition FLA_View.c:142
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
dim_t FLA_Obj_min_dim(FLA_Obj obj)
Definition FLA_Query.c:153
unsigned long dim_t
Definition FLA_type_defs.h:71
int i
Definition bl1_axmyv2.c:145
Definition FLA_type_defs.h:159

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

Referenced by FLA_Apply_Q_UT_lhbc().