本文整理汇总了C++中FLA_Cont_with_1x3_to_1x2函数的典型用法代码示例。如果您正苦于以下问题:C++ FLA_Cont_with_1x3_to_1x2函数的具体用法?C++ FLA_Cont_with_1x3_to_1x2怎么用?C++ FLA_Cont_with_1x3_to_1x2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FLA_Cont_with_1x3_to_1x2函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: FLA_Gemm_tn_unb_var1
FLA_Error FLA_Gemm_tn_unb_var1( FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C )
{
FLA_Obj AL, AR, A0, a1, A2;
FLA_Obj CT, C0,
CB, c1t,
C2;
FLA_Scal_external( beta, C );
FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT );
FLA_Part_2x1( C, &CT,
&CB, 0, FLA_TOP );
while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){
FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &a1, &A2,
1, FLA_RIGHT );
FLA_Repart_2x1_to_3x1( CT, &C0,
/* ** */ /* *** */
&c1t,
CB, &C2, 1, FLA_BOTTOM );
/*------------------------------------------------------------*/
/* c1t = a1' * B + c1t */
/* c1t' = B' * a1 + c1t' */
FLA_Gemv_external( FLA_TRANSPOSE, alpha, B, a1, FLA_ONE, c1t );
/*------------------------------------------------------------*/
FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, a1, /**/ A2,
FLA_LEFT );
FLA_Cont_with_3x1_to_2x1( &CT, C0,
c1t,
/* ** */ /* *** */
&CB, C2, FLA_TOP );
}
return FLA_SUCCESS;
}
开发者ID:pgawron,项目名称:tlash,代码行数:45,代码来源:FLA_Gemm_tn_unb_var1.c
示例2: FLA_Gemm_tt_unb_var5
FLA_Error FLA_Gemm_tt_unb_var5( FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C )
{
FLA_Obj AT, A0,
AB, a1t,
A2;
FLA_Obj BL, BR, B0, b1, B2;
FLA_Scal_external( beta, C );
FLA_Part_2x1( A, &AT,
&AB, 0, FLA_TOP );
FLA_Part_1x2( B, &BL, &BR, 0, FLA_LEFT );
while ( FLA_Obj_length( AT ) < FLA_Obj_length( A ) ){
FLA_Repart_2x1_to_3x1( AT, &A0,
/* ** */ /* *** */
&a1t,
AB, &A2, 1, FLA_BOTTOM );
FLA_Repart_1x2_to_1x3( BL, /**/ BR, &B0, /**/ &b1, &B2,
1, FLA_RIGHT );
/*------------------------------------------------------------*/
/* C = a1t' * b1' + C */
FLA_Ger_external( alpha, a1t, b1, C );
/*------------------------------------------------------------*/
FLA_Cont_with_3x1_to_2x1( &AT, A0,
a1t,
/* ** */ /* *** */
&AB, A2, FLA_TOP );
FLA_Cont_with_1x3_to_1x2( &BL, /**/ &BR, B0, b1, /**/ B2,
FLA_LEFT );
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:44,代码来源:FLA_Gemm_tt_unb_var5.c
示例3: FLA_Syrk_ln_omp1t_var5_fc
FLA_Error FLA_Syrk_ln_omp1t_var5_fc( FLA_Obj A, FLA_Obj C, int nb_alg )
{
FLA_Obj AL, AR, A0, A1, A2;
FLA_Obj MyC;
int b;
FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT );
#pragma intel omp parallel taskq
{
while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){
nb_alg = FLA_Obj_width( A )/omp_get_num_threads() + 1;
b = min( FLA_Obj_width( AR ), nb_alg );
FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &A1, &A2,
b, FLA_RIGHT );
/*------------------------------------------------------------*/
#pragma intel omp task captureprivate(A1) private(MyC)
{
FLA_Obj_create_conf_to( FLA_NO_TRANSPOSE, C, &MyC );
FLA_Obj_set_to_zero( MyC );
/* MyC := A1 * A1' */
FLA_Syrk( FLA_LOWER_TRIANGULAR, FLA_NO_TRANSPOSE, FLA_ONE, A1, FLA_ZERO, MyC );
/* C := MyC */
FLA_Axpy_sync_circular( FLA_ONE, MyC, C );
FLA_Obj_free( &MyC );
}
/*------------------------------------------------------------*/
FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, A1, /**/ A2,
FLA_LEFT );
}
}
return FLA_SUCCESS;
}
开发者ID:pgawron,项目名称:tlash,代码行数:44,代码来源:FLA_Syrk_ln_omp1t_var5_fc.c
示例4: FLA_Gemm_nc_unb_var5
FLA_Error FLA_Gemm_nc_unb_var5( FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C )
{
FLA_Obj AL, AR, A0, a1, A2;
FLA_Obj BT, B0,
BB, b1t,
B2;
FLA_Scal_external( beta, C );
FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT );
FLA_Part_2x1( B, &BT,
&BB, 0, FLA_TOP );
while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){
FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &a1, &A2,
1, FLA_RIGHT );
FLA_Repart_2x1_to_3x1( BT, &B0,
/* ** */ /* *** */
&b1t,
BB, &B2, 1, FLA_BOTTOM );
/*------------------------------------------------------------*/
/* C = a1 * b1t + C */
FLA_Gerc_external( FLA_NO_CONJUGATE, FLA_CONJUGATE, alpha, a1, b1t, C );
/*------------------------------------------------------------*/
FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, a1, /**/ A2,
FLA_LEFT );
FLA_Cont_with_3x1_to_2x1( &BT, B0,
b1t,
/* ** */ /* *** */
&BB, B2, FLA_TOP );
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:44,代码来源:FLA_Gemm_nc_unb_var5.c
示例5: FLA_Gemm_ht_unb_var4
FLA_Error FLA_Gemm_ht_unb_var4( FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C )
{
FLA_Obj BT, B0,
BB, b1t,
B2;
FLA_Obj CL, CR, C0, c1, C2;
FLA_Scal_external( beta, C );
FLA_Part_2x1( B, &BT,
&BB, 0, FLA_BOTTOM );
FLA_Part_1x2( C, &CL, &CR, 0, FLA_RIGHT );
while ( FLA_Obj_length( BB ) < FLA_Obj_length( B ) ){
FLA_Repart_2x1_to_3x1( BT, &B0,
&b1t,
/* ** */ /* *** */
BB, &B2, 1, FLA_TOP );
FLA_Repart_1x2_to_1x3( CL, /**/ CR, &C0, &c1, /**/ &C2,
1, FLA_LEFT );
/*------------------------------------------------------------*/
/* c1 = A' * b1t' + c1 */
FLA_Gemv_external( FLA_CONJ_TRANSPOSE, alpha, A, b1t, FLA_ONE, c1 );
/*------------------------------------------------------------*/
FLA_Cont_with_3x1_to_2x1( &BT, B0,
/* ** */ /* *** */
b1t,
&BB, B2, FLA_BOTTOM );
FLA_Cont_with_1x3_to_1x2( &CL, /**/ &CR, C0, /**/ c1, C2,
FLA_RIGHT );
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:44,代码来源:FLA_Gemm_ht_unb_var4.c
示例6: FLA_Syrk_ln_omp1t_var5
FLA_Error FLA_Syrk_ln_omp1t_var5( FLA_Obj A, FLA_Obj C )
{
FLA_Obj AL, AR, A0, A1, A2;
FLA_Obj MyC;
int b;
FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT );
#pragma intel omp parallel taskq
{
while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){
b = FLA_Task_compute_blocksize( 0, A, AL, FLA_LEFT );
FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &A1, &A2,
b, FLA_RIGHT );
/*------------------------------------------------------------*/
#pragma intel omp task captureprivate(A1) private(MyC)
{
FLA_Obj_create_conf_to( FLA_NO_TRANSPOSE, C, &MyC );
FLA_Obj_set_to_zero( MyC );
/* MyC := A1 * A1' */
FLA_Syrk_external( FLA_LOWER_TRIANGULAR, FLA_NO_TRANSPOSE, FLA_ONE, A1, FLA_ZERO, MyC );
/* C := MyC */
FLA_Axpy_sync_pipeline( FLA_ONE, MyC, C );
FLA_Obj_free( &MyC );
}
/*------------------------------------------------------------*/
FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, A1, /**/ A2,
FLA_LEFT );
}
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:43,代码来源:FLA_Syrk_ln_omp1t_var5.c
示例7: Gemm_unb_var1
int Gemm_unb_var1( FLA_Obj A, FLA_Obj B, FLA_Obj C )
{
FLA_Obj AL, AR, A0, a1, A2;
FLA_Obj BT, B0,
BB, b1t,
B2;
FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT );
FLA_Part_2x1( B, &BT,
&BB, 0, FLA_TOP );
while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){
FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &a1, &A2,
1, FLA_RIGHT );
FLA_Repart_2x1_to_3x1( BT, &B0,
/* ** */ /* *** */
&b1t,
BB, &B2, 1, FLA_BOTTOM );
/*------------------------------------------------------------*/
FLA_Ger( FLA_ONE, a1, b1t, C );
/*------------------------------------------------------------*/
FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, a1, /**/ A2,
FLA_LEFT );
FLA_Cont_with_3x1_to_2x1( &BT, B0,
b1t,
/* ** */ /* *** */
&BB, B2, FLA_TOP );
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:41,代码来源:Gemm_unb_var1.c
示例8: SLAP_Syrk_ln_unb_var5
int SLAP_Syrk_ln_unb_var5( FLA_Obj C, FLA_Obj A )
{
FLA_Obj AL, AR, A0, a1, A2;
FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT );
while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){
FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &a1, &A2,
1, FLA_RIGHT );
/*------------------------------------------------------------*/
FLA_Syr(FLA_LOWER_TRIANGULAR, FLA_ONE, a1, C);
/*------------------------------------------------------------*/
FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, a1, /**/ A2,
FLA_LEFT );
}
return FLA_SUCCESS;
}
开发者ID:philkjacobs,项目名称:Programming-for-Correctness,代码行数:24,代码来源:SLAP_Syrk_ln_unb_var5.c
示例9: FLA_Symm_ru_blk_var4
FLA_Error FLA_Symm_ru_blk_var4( FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C, fla_symm_t* cntl )
{
FLA_Obj ATL, ATR, A00, A01, A02,
ABL, ABR, A10, A11, A12,
A20, A21, A22;
FLA_Obj BL, BR, B0, B1, B2;
FLA_Obj CL, CR, C0, C1, C2;
dim_t b;
FLA_Scal_internal( beta, C,
FLA_Cntl_sub_scal( cntl ) );
FLA_Part_2x2( A, &ATL, &ATR,
&ABL, &ABR, 0, 0, FLA_TL );
FLA_Part_1x2( B, &BL, &BR, 0, FLA_LEFT );
FLA_Part_1x2( C, &CL, &CR, 0, FLA_LEFT );
while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) ){
b = FLA_Determine_blocksize( ABR, FLA_BR, FLA_Cntl_blocksize( cntl ) );
FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02,
/* ************* */ /* ******************** */
&A10, /**/ &A11, &A12,
ABL, /**/ ABR, &A20, /**/ &A21, &A22,
b, b, FLA_BR );
FLA_Repart_1x2_to_1x3( BL, /**/ BR, &B0, /**/ &B1, &B2,
b, FLA_RIGHT );
FLA_Repart_1x2_to_1x3( CL, /**/ CR, &C0, /**/ &C1, &C2,
b, FLA_RIGHT );
/*------------------------------------------------------------*/
/* C0 = C0 + B1 * A01' */
FLA_Gemm_internal( FLA_NO_TRANSPOSE, FLA_TRANSPOSE,
alpha, B1, A01, FLA_ONE, C0,
FLA_Cntl_sub_gemm1( cntl ) );
/* C1 = C1 + B1 * A11 */
FLA_Symm_internal( FLA_RIGHT, FLA_UPPER_TRIANGULAR,
alpha, A11, B1, FLA_ONE, C1,
FLA_Cntl_sub_symm( cntl ) );
/* C2 = C2 + B1 * A12 */
FLA_Gemm_internal( FLA_NO_TRANSPOSE, FLA_NO_TRANSPOSE,
alpha, B1, A12, FLA_ONE, C2,
FLA_Cntl_sub_gemm2( cntl ) );
/*------------------------------------------------------------*/
FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
A10, A11, /**/ A12,
/* ************** */ /* ****************** */
&ABL, /**/ &ABR, A20, A21, /**/ A22,
FLA_TL );
FLA_Cont_with_1x3_to_1x2( &BL, /**/ &BR, B0, B1, /**/ B2,
FLA_LEFT );
FLA_Cont_with_1x3_to_1x2( &CL, /**/ &CR, C0, C1, /**/ C2,
FLA_LEFT );
}
return FLA_SUCCESS;
}
开发者ID:pgawron,项目名称:tlash,代码行数:73,代码来源:FLA_Symm_ru_blk_var4.c
示例10: FLA_Apply_Q_UT_lnfc_blk_var1
//.........这里部分代码省略.........
FLA_Part_2x2( A, &ATL, &ATR,
&ABL, &ABR, m_BR, n_BR, FLA_BR );
// A and T are dependent; we determine T matrix w.r.t. A
FLA_Part_1x2( T, &TL, &TR, FLA_Obj_min_dim( A ), FLA_LEFT );
FLA_Part_2x1( B, &BT,
&BB, m_BR, FLA_BOTTOM );
while ( FLA_Obj_min_dim( ATL ) > 0 ){
b = min( b_alg, FLA_Obj_min_dim( ATL ) );
// Since T was filled from left to right, and since we need to access them
// in reverse order, we need to handle the case where the last block is
// smaller than the other b x b blocks.
if ( FLA_Obj_width( TR ) == 0 && FLA_Obj_width( T ) % b_alg > 0 )
b = FLA_Obj_width( T ) % b_alg;
FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, &A01, /**/ &A02,
&A10, &A11, /**/ &A12,
/* ************* */ /* ******************** */
ABL, /**/ ABR, &A20, &A21, /**/ &A22,
b, b, FLA_TL );
FLA_Repart_1x2_to_1x3( TL, /**/ TR, &T0, &T1, /**/ &T2,
b, FLA_LEFT );
FLA_Repart_2x1_to_3x1( BT, &B0,
&B1,
/* ** */ /* ** */
BB, &B2, b, FLA_TOP );
/*------------------------------------------------------------*/
FLA_Part_2x1( T1, &T1T,
&T2B, b, FLA_TOP );
FLA_Part_2x2( W, &WTL, &WTR,
&WBL, &WBR, b, FLA_Obj_width( B1 ), FLA_TL );
// WTL = B1;
FLA_Copyt_internal( FLA_NO_TRANSPOSE, B1, WTL,
FLA_Cntl_sub_copyt( cntl ) );
// U11 = trilu( A11 );
// U21 = A21;
//
// WTL = inv( triu(T1T) ) * ( U11' * B1 + U21' * B2 );
FLA_Trmm_internal( FLA_LEFT, FLA_LOWER_TRIANGULAR,
FLA_CONJ_TRANSPOSE, FLA_UNIT_DIAG,
FLA_ONE, A11, WTL,
FLA_Cntl_sub_trmm1( cntl ) );
FLA_Gemm_internal( FLA_CONJ_TRANSPOSE, FLA_NO_TRANSPOSE,
FLA_ONE, A21, B2, FLA_ONE, WTL,
FLA_Cntl_sub_gemm1( cntl ) );
FLA_Trsm_internal( FLA_LEFT, FLA_UPPER_TRIANGULAR,
FLA_NO_TRANSPOSE, FLA_NONUNIT_DIAG,
FLA_ONE, T1T, WTL,
FLA_Cntl_sub_trsm( cntl ) );
// B2 = B2 - U21 * WTL;
// B1 = B1 - U11 * WTL;
FLA_Gemm_internal( FLA_NO_TRANSPOSE, FLA_NO_TRANSPOSE,
FLA_MINUS_ONE, A21, WTL, FLA_ONE, B2,
FLA_Cntl_sub_gemm2( cntl ) );
FLA_Trmm_internal( FLA_LEFT, FLA_LOWER_TRIANGULAR,
FLA_NO_TRANSPOSE, FLA_UNIT_DIAG,
FLA_MINUS_ONE, A11, WTL,
FLA_Cntl_sub_trmm2( cntl ) );
FLA_Axpyt_internal( FLA_NO_TRANSPOSE, FLA_ONE, WTL, B1,
FLA_Cntl_sub_axpyt( cntl ) );
/*------------------------------------------------------------*/
FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, /**/ A01, A02,
/* ************** */ /* ****************** */
A10, /**/ A11, A12,
&ABL, /**/ &ABR, A20, /**/ A21, A22,
FLA_BR );
FLA_Cont_with_1x3_to_1x2( &TL, /**/ &TR, T0, /**/ T1, T2,
FLA_RIGHT );
FLA_Cont_with_3x1_to_2x1( &BT, B0,
/* ** */ /* ** */
B1,
&BB, B2, FLA_BOTTOM );
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:101,代码来源:FLA_Apply_Q_UT_lnfc_blk_var1.c
示例11: FLA_Apply_Q_UT_lhfr_blk_var1
//.........这里部分代码省略.........
BB, B1,
B2;
dim_t b_alg, b;
// Query the algorithmic blocksize by inspecting the length of T.
b_alg = FLA_Obj_length( T );
FLA_Part_2x2( A, &ATL, &ATR,
&ABL, &ABR, 0, 0, FLA_TL );
FLA_Part_1x2( T, &TL, &TR, 0, FLA_LEFT );
FLA_Part_2x1( B, &BT,
&BB, 0, FLA_TOP );
while ( FLA_Obj_min_dim( ABR ) > 0 ){
b = min( b_alg, FLA_Obj_min_dim( ABR ) );
FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02,
/* ************* */ /* ******************** */
&A10, /**/ &A11, &A12,
ABL, /**/ ABR, &A20, /**/ &A21, &A22,
b, b, FLA_BR );
FLA_Repart_1x2_to_1x3( TL, /**/ TR, &T0, /**/ &T1, &T2,
b, FLA_RIGHT );
FLA_Repart_2x1_to_3x1( BT, &B0,
/* ** */ /* ** */
&B1,
BB, &B2, b, FLA_BOTTOM );
/*------------------------------------------------------------*/
FLA_Part_2x1( T1, &T1T,
&T2B, b, FLA_TOP );
FLA_Part_2x2( W, &WTL, &WTR,
&WBL, &WBR, b, FLA_Obj_width( B1 ), FLA_TL );
// WTL = B1;
FLA_Copyt_internal( FLA_NO_TRANSPOSE, B1, WTL,
FLA_Cntl_sub_copyt( cntl ) );
// U11 = triuu( A11 );
// U12 = A12;
//
// WTL = inv( triu(T1T) )' * ( conj(U11) * B1 + conj(U12) * B2 );
FLA_Trmm_internal( FLA_LEFT, FLA_UPPER_TRIANGULAR,
FLA_CONJ_NO_TRANSPOSE, FLA_UNIT_DIAG,
FLA_ONE, A11, WTL,
FLA_Cntl_sub_trmm1( cntl ) );
FLA_Gemm_internal( FLA_CONJ_NO_TRANSPOSE, FLA_NO_TRANSPOSE,
FLA_ONE, A12, B2, FLA_ONE, WTL,
FLA_Cntl_sub_gemm1( cntl ) );
FLA_Trsm_internal( FLA_LEFT, FLA_UPPER_TRIANGULAR,
FLA_CONJ_TRANSPOSE, FLA_NONUNIT_DIAG,
FLA_ONE, T1T, WTL,
FLA_Cntl_sub_trsm( cntl ) );
// B2 = B2 - U12^T * WTL;
// B1 = B1 - U11^T * WTL;
FLA_Gemm_internal( FLA_TRANSPOSE, FLA_NO_TRANSPOSE,
FLA_MINUS_ONE, A12, WTL, FLA_ONE, B2,
FLA_Cntl_sub_gemm2( cntl ) );
FLA_Trmm_internal( FLA_LEFT, FLA_UPPER_TRIANGULAR,
FLA_TRANSPOSE, FLA_UNIT_DIAG,
FLA_MINUS_ONE, A11, WTL,
FLA_Cntl_sub_trmm2( cntl ) );
FLA_Axpyt_internal( FLA_NO_TRANSPOSE, FLA_ONE, WTL, B1,
FLA_Cntl_sub_axpyt( cntl ) );
/*------------------------------------------------------------*/
FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
A10, A11, /**/ A12,
/* ************** */ /* ****************** */
&ABL, /**/ &ABR, A20, A21, /**/ A22,
FLA_TL );
FLA_Cont_with_1x3_to_1x2( &TL, /**/ &TR, T0, T1, /**/ T2,
FLA_LEFT );
FLA_Cont_with_3x1_to_2x1( &BT, B0,
B1,
/* ** */ /* ** */
&BB, B2, FLA_TOP );
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:101,代码来源:FLA_Apply_Q_UT_lhfr_blk_var1.c
示例12: FLA_QR_UT_blk_var1
FLA_Error FLA_QR_UT_blk_var1( FLA_Obj A, FLA_Obj T, fla_qrut_t* cntl )
{
FLA_Obj ATL, ATR, A00, A01, A02,
ABL, ABR, A10, A11, A12,
A20, A21, A22;
FLA_Obj TL, TR, T0, T1, W12;
FLA_Obj T1T, T2B;
FLA_Obj AB1, AB2;
dim_t b_alg, b;
// Query the algorithmic blocksize by inspecting the length of T.
b_alg = FLA_Obj_length( T );
FLA_Part_2x2( A, &ATL, &ATR,
&ABL, &ABR, 0, 0, FLA_TL );
FLA_Part_1x2( T, &TL, &TR, 0, FLA_LEFT );
while ( FLA_Obj_min_dim( ABR ) > 0 ){
b = min( b_alg, FLA_Obj_min_dim( ABR ) );
FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02,
/* ************* */ /* ******************** */
&A10, /**/ &A11, &A12,
ABL, /**/ ABR, &A20, /**/ &A21, &A22,
b, b, FLA_BR );
FLA_Repart_1x2_to_1x3( TL, /**/ TR, &T0, /**/ &T1, &W12,
b, FLA_RIGHT );
/*------------------------------------------------------------*/
FLA_Part_2x1( T1, &T1T,
&T2B, b, FLA_TOP );
FLA_Merge_2x1( A11,
A21, &AB1 );
// Perform a QR factorization via the UT transform on AB1:
//
// / A11 \ -> QB1 R11
// \ A21 /
//
// where:
// - QB1 is formed from UB1 (which is stored column-wise below the
// diagonal of AB1) and T11 (which is stored to the upper triangle
// of T11).
// - R11 is stored to the upper triangle of AB1.
FLA_QR_UT_internal( AB1, T1T,
FLA_Cntl_sub_qrut( cntl ) );
if ( FLA_Obj_width( A12 ) > 0 )
{
FLA_Merge_2x1( A12,
A22, &AB2 );
// Apply the Householder transforms associated with UB1 and T11 to
// AB2:
//
// / A12 \ := QB1' / A12 \
// \ A22 / \ A22 /
//
// where QB1 is formed from UB1 and T11.
FLA_Apply_Q_UT_internal( FLA_LEFT, FLA_CONJ_TRANSPOSE, FLA_FORWARD, FLA_COLUMNWISE,
AB1, T1T, W12, AB2,
FLA_Cntl_sub_apqut( cntl ) );
}
/*------------------------------------------------------------*/
FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
A10, A11, /**/ A12,
/* ************** */ /* ****************** */
&ABL, /**/ &ABR, A20, A21, /**/ A22,
FLA_TL );
FLA_Cont_with_1x3_to_1x2( &TL, /**/ &TR, T0, T1, /**/ W12,
FLA_LEFT );
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:90,代码来源:FLA_QR_UT_blk_var1.c
示例13: FLA_Gemm_nn_omp_var5
FLA_Error FLA_Gemm_nn_omp_var5( FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj C, fla_gemm_t* cntl )
{
FLA_Obj AL, AR, A0, A1, A2;
FLA_Obj BT, B0,
BB, B1,
B2;
FLA_Obj C_local;
int b;
FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT );
FLA_Part_2x1( B, &BT,
&BB, 0, FLA_TOP );
#pragma intel omp parallel taskq
{
while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){
b = FLA_Determine_blocksize( A, AL, FLA_LEFT, FLA_Cntl_blocksize( cntl ) );
//b = min( FLA_Obj_width( AR ), nb_alg );
FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &A1, &A2,
b, FLA_RIGHT );
FLA_Repart_2x1_to_3x1( BT, &B0,
/* ** */ /* ** */
&B1,
BB, &B2, b, FLA_BOTTOM );
/*------------------------------------------------------------*/
#pragma intel omp task captureprivate(A1,B1) private(C_local)
{
FLA_Obj_create_conf_to( FLA_NO_TRANSPOSE, C, &C_local );
FLA_Obj_set_to_zero( C_local );
/* C = alpha * A1 * B1 + C; */
FLA_Gemm_external( FLA_NO_TRANSPOSE, FLA_NO_TRANSPOSE,
alpha, A1, B1, FLA_ONE, C_local );
REF_Axpy_sync_circular( FLA_ONE, C_local, C );
FLA_Obj_free( &C_local );
}
/*------------------------------------------------------------*/
FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, A1, /**/ A2,
FLA_LEFT );
FLA_Cont_with_3x1_to_2x1( &BT, B0,
B1,
/* ** */ /* ** */
&BB, B2, FLA_TOP );
}
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:62,代码来源:FLA_Gemm_nn_omp_var5.c
示例14: FLA_Bidiag_UT_u_blk_var2
FLA_Error FLA_Bidiag_UT_u_blk_var2( FLA_Obj A, FLA_Obj TU, FLA_Obj TV )
{
FLA_Obj ATL, ATR, A00, A01, A02,
ABL, ABR, A10, A11, A12,
A20, A21, A22;
FLA_Obj TUL, TUR, TU0, TU1, TU2;
FLA_Obj TVL, TVR, TV0, TV1, TV2;
FLA_Obj TU1_tl;
FLA_Obj TV1_tl;
FLA_Obj none, none2, none3;
dim_t b_alg, b;
b_alg = FLA_Obj_length( TU );
FLA_Part_2x2( A, &ATL, &ATR,
&ABL, &ABR, 0, 0, FLA_TL );
FLA_Part_1x2( TU, &TUL, &TUR, 0, FLA_LEFT );
FLA_Part_1x2( TV, &TVL, &TVR, 0, FLA_LEFT );
while ( FLA_Obj_min_dim( ABR ) > 0 )
{
b = min( FLA_Obj_min_dim( ABR ), b_alg );
FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02,
/* ************* */ /* ******************** */
&A10, /**/ &A11, &A12,
ABL, /**/ ABR, &A20, /**/ &A21, &A22,
b, b, FLA_BR );
FLA_Repart_1x2_to_1x3( TUL, /**/ TUR, &TU0, /**/ &TU1, &TU2,
b, FLA_RIGHT );
FLA_Repart_1x2_to_1x3( TVL, /**/ TVR, &TV0, /**/ &TV1, &TV2,
b, FLA_RIGHT );
/*------------------------------------------------------------*/
FLA_Part_2x2( TU1, &TU1_tl, &none,
&none2, &none3, b, b, FLA_TL );
FLA_Part_2x2( TV1, &TV1_tl, &none,
&none2, &none3, b, b, FLA_TL );
// [ ABR, T1 ] = FLA_Bidiag_UT_u_step_unb_var2( ABR, TU1, TV1, b );
//FLA_Bidiag_UT_u_step_unb_var2( ABR, TU1_tl, TV1_tl );
//FLA_Bidiag_UT_u_step_ofu_var2( ABR, TU1_tl, TV1_tl );
FLA_Bidiag_UT_u_step_opt_var2( ABR, TU1_tl, TV1_tl );
/*------------------------------------------------------------*/
FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02,
A10, A11, /**/ A12,
/* ************** */ /* ****************** */
&ABL, /**/ &ABR, A20, A21, /**/ A22,
FLA_TL );
FLA_Cont_with_1x3_to_1x2( &TUL, /**/ &TUR, TU0, TU1, /**/ TU2,
FLA_LEFT );
FLA_Cont_with_1x3_to_1x2( &TVL, /**/ &TVR, TV0, TV1, /**/ TV2,
FLA_LEFT );
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:62,代码来源:FLA_Bidiag_UT_u_blk_var2.c
示例15: FLA_Syr2k_lt_unb_var6
FLA_Error FLA_Syr2k_lt_unb_var6( FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C )
{
FLA_Obj AL, AR, A0, a1, A2;
FLA_Obj BL, BR, B0, b1, B2;
FLA_Obj CTL, CTR, C00, c01, C02,
CBL, CBR, c10t, gamma11, c12t,
C20, c21, C22;
FLA_Scalr_external( FLA_LOWER_TRIANGULAR, beta, C );
FLA_Part_1x2( A, &AL, &AR, 0, FLA_RIGHT );
FLA_Part_1x2( B, &BL, &BR, 0, FLA_RIGHT );
FLA_Part_2x2( C, &CTL, &CTR,
&CBL, &CBR, 0, 0, FLA_BR );
while ( FLA_Obj_width( AR ) < FLA_Obj_width( A ) ){
FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, &a1, /**/ &A2,
1, FLA_LEFT );
FLA_Repart_1x2_to_1x3( BL, /**/ BR, &B0, &b1, /**/ &B2,
1, FLA_LEFT );
FLA_Repart_2x2_to_3x3( CTL, /**/ CTR, &C00, &c01, /**/ &C02,
&c10t, &gamma11, /**/ &c12t,
/* ************* */ /* ************************** */
CBL, /**/ CBR, &C20, &c21, /**/ &C22,
1, 1, FLA_TL );
/*------------------------------------------------------------*/
/* c10t = c10t + a1' * B0 */
FLA_Gemv_external( FLA_TRANSPOSE, alpha, B0, a1, FLA_ONE, c10t );
/* c21 = c21 + B2' * a1 */
FLA_Gemv_external( FLA_TRANSPOSE, alpha, B2, a1, FLA_ONE, c21 );
/* gamma11 = gamma11 + a1' * b1 + b1' * a1 */
FLA_Dot2s_external( alpha, a1, b1, FLA_ONE, gamma11 );
/*------------------------------------------------------------*/
FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, /**/ a1, A2,
FLA_RIGHT );
FLA_Cont_with_1x3_to_1x2( &BL, /**/ &BR, B0, /**/ b1, B2,
FLA_RIGHT );
FLA_Cont_with_3x3_to_2x2( &CTL, /**/ &CTR, C00, /**/ c01, C02,
/* ************** */ /* ************************ */
c10t, /**/ gamma11, c12t,
&CBL, /**/ &CBR, C20, /**/ c21, C22,
FLA_BR );
}
return FLA_SUCCESS;
}
开发者ID:pgawron,项目名称:tlash,代码行数:64,代码来源:FLA_Syr2k_lt_unb_var6.c
示例16: FLA_Her2k_uh_blk_var7
FLA_Error FLA_Her2k_uh_blk_var7( FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C, fla_her2k_t* cntl )
{
FLA_Obj AL, AR, A0, A1, A2;
FLA_Obj BL, BR, B0, B1, B2;
FLA_Obj CTL, CTR, C00, C01, C02,
CBL, CBR, C10, C11, C12,
C20, C21, C22;
dim_t b;
FLA_Scalr_internal( FLA_UPPER_TRIANGULAR, beta, C,
FLA_Cntl_sub_scalr( cntl ) );
FLA_Part_1x2( A, &AL, &AR, 0, FLA_RIGHT );
FLA_Part_1x2( B, &BL, &BR, 0, FLA_RIGHT );
FLA_Part_2x2( C, &CTL, &CTR,
&CBL, &CBR, 0, 0, FLA_BR );
while ( FLA_Obj_width( AR ) < FLA_Obj_width( A ) ){
b = FLA_Determine_blocksize( AL, FLA_LEFT, FLA_Cntl_blocksize( cntl ) );
FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, &A1, /**/ &A2,
b, FLA_LEFT );
FLA_Repart_1x2_to_1x3( BL, /**/ BR, &B0, &B1, /**/ &B2,
b, FLA_LEFT );
FLA_Repart_2x2_to_3x3( CTL, /**/ CTR, &C00, &C01, /**/ &C02,
&C10, &C11, /**/ &C12,
/* ************* */ /* ******************** */
CBL, /**/ CBR, &C20, &C21, /**/ &C22,
b, b, FLA_TL );
/*------------------------------------------------------------*/
/* C01 = C01 + B0' * A1 */
FLA_Gemm_internal( FLA_CONJ_TRANSPOSE, FLA_NO_TRANSPOSE,
alpha, B0, A1, FLA_ONE, C01,
FLA_Cntl_sub_gemm1( cntl ) );
/* C12 = C12 + A1' * B2 */
FLA_Gemm_internal( FLA_CONJ_TRANSPOSE, FLA_NO_TRANSPOSE,
alpha, A1, B2, FLA_ONE, C12,
FLA_Cntl_sub_gemm2( cntl ) );
/* C11 = C11 + A1' * B1 + B1' * A1 */
FLA_Her2k_internal( FLA_UPPER_TRIANGULAR, FLA_CONJ_TRANSPOSE,
alpha, A1, B1, FLA_ONE, C11,
FLA_Cntl_sub_her2k( cntl ) );
/*------------------------------------------------------------*/
FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, /**/ A1, A2,
FLA_RIGHT );
FLA_Cont_with_1x3_to_1x2( &BL, /**/ &BR, B0, /**/ B1, B2,
FLA_RIGHT );
FLA_Cont_with_3x3_to_2x2( &CTL, /**/ &CTR, C00, /**/ C01, C02,
/* ************** */ /* ****************** */
C10, /**/ C11, C12,
&CBL, /**/ &CBR, C20, /**/ C21, C22,
FLA_BR );
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:73,代码来源:FLA_Her2k_uh_blk_var7.c
示例17: FLA_LU_piv_unb_var3
FLA_Error FLA_LU_piv_unb_var3( FLA_Obj A, FLA_Obj p )
{
FLA_Obj ATL, ATR, A00, a01, A02,
ABL, ABR, a10t, alpha11, a12t,
A20, a21, A22;
FLA_Obj AL, AR, A0, a1, A2;
FLA_Obj pT, p0,
pB, pi1,
p2;
FLA_Obj AB0, aB1;
FLA_Part_2x2( A, &ATL, &ATR,
&ABL, &ABR, 0, 0, FLA_TL );
FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT );
FLA_Part_2x1( p, &pT,
&pB, 0, FLA_TOP );
while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) &&
FLA_Obj_width( ATL ) < FLA_Obj_width( A )){
FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &a01, &A02,
/* ************* */ /* ************************** */
&a10t, /**/ &alpha11, &a12t,
ABL, /**/ ABR, &A20, /**/ &a21, &A22,
1, 1, FLA_BR );
FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &a1, &A2,
1, FLA_RIGHT );
FLA_Repart_2x1_to_3x1( pT, &p0,
/* ** */ /* *** */
&pi1,
pB, &p2, 1, FLA_BOTTOM );
/*------------------------------------------------------------*/
// Apply previously computed pivots
FLA_Apply_pivots( FLA_LEFT, FLA_NO_TRANSPOSE, p0, a1 );
// a01 = trilu( A00 ) \ a01
FLA_Trsv_external( FLA_LOWER_TRIANGULAR, FLA_NO_TRANSPOSE, FLA_UNIT_DIAG, A00, a01 );
// alpha11 = alpha11 - a10t * a01
FLA_Dots_external( FLA_MINUS_ONE, a10t, a01, FLA_ONE, alpha11 );
// a21 = a21 - A20 * a01
FLA_Gemv_external( FLA_NO_TRANSPOSE, FLA_MINUS_ONE, A20, a01, FLA_ONE, a21 );
// aB1 = / alpha11 \
// \ a21 /
FLA_Merge_2x1( alpha11,
a21, &aB1 );
// Determine pivot index
FLA_Amax_external( aB1, pi1 );
// Apply pivots to current column
FLA_Apply_pivots( FLA_LEFT, FLA_NO_TRANSPOSE, pi1, aB1 );
// a21 = a21 / alpha11
FLA_Inv_scal_external( alpha11, a21 );
// AB0 = / a10t \
// \ A20 /
FLA_Merge_2x1( a10t,
A20, &AB0 );
// Apply pivots to previous columns
FLA_Apply_pivots( FLA_LEFT, FLA_NO_TRANSPOSE, pi1, AB0 );
/*------------------------------------------------------------*/
FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, a01, /**/ A02,
a10t, alpha11, /**/ a12t,
/* ************** */ /* ************************ */
&ABL, /**/ &ABR, A20, a21, /**/ A22,
FLA_TL );
FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, a1, /**/ A2,
FLA_LEFT );
FLA_Cont_with_3x1_to_2x1( &pT, p0,
pi1,
/* ** */ /* *** */
&pB, p2, FLA_TOP );
}
if ( FLA_Obj_width( ATR ) > 0 )
{
/* Apply pivots to untouched columns */
FLA_Apply_pivots( FLA_LEFT, FLA_NO_TRANSPOSE, p, ATR );
/* ATR = trilu( ATL ) \ ATR */
//.........这里部分代码省略.........
开发者ID:anaptyxis,项目名称:libflame,代码行数:101,代码来源:FLA_LU_piv_unb_var3.c
示例18: FLA_Gemm_nn_omp_var15
//.........这里部分代码省略.........
{
while ( FLA_Obj_length( AT ) < FLA_Obj_length( A ) )
{
b_m = FLA_Determine_blocksize( A, AT, FLA_TOP, FLA_Cntl_blocksize( cntl ) );
FLA_Repart_2x1_to_3x1( AT, &A0,
/* ** */ /* ** */
&A1,
AB, &A2, b_m, FLA_BOTTOM );
FLA_Repart_2x1_to_3x1( CT, &C0,
/* ** */ /* ** */
&C1,
CB, &C2, b_m, FLA_BOTTOM );
/*------------------------------------------------------------*/
/* C1 = alpha * A1 * B + C1; */
FLA_Part_1x2( A1, &AL, &AR, 0, FLA_LEFT );
FLA_Part_2x1( B, &BT,
&BB, 0, FLA_TOP );
while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) )
{
b_k = FLA_Determine_blocksize( A, AL, FLA_LEFT, FLA_Cntl_blocksize( cntl ) );
// Get the index of the current partition.
// FIX THIS: need + b_m - 1 or something like this
//j = FLA_Obj_length( CT ) / b_m;
//i = FLA_Obj_width( AL ) / b_k;
//lock_ldim = FLA_get_num_threads_in_m_dim(omp_get_num_threads());
lock_i = FLA_Obj_length( CT ) / b_m;
FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A10, /**/ &A11, &A12,
b_k, FLA_RIGHT );
FLA_Repart_2x1_to_3x1( BT, &B0,
/* ** */ /* ** */
&B1,
BB, &B2, b_k, FLA_BOTTOM );
/*-----------
|
请发表评论