libflame  revision_anchor
Functions
FLA_Gemm_th_blk_var6.c File Reference

(r)

Functions

FLA_Error FLA_Gemm_th_blk_var6 (FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C, fla_gemm_t *cntl)
 

Function Documentation

◆ FLA_Gemm_th_blk_var6()

FLA_Error FLA_Gemm_th_blk_var6 ( FLA_Obj  alpha,
FLA_Obj  A,
FLA_Obj  B,
FLA_Obj  beta,
FLA_Obj  C,
fla_gemm_t cntl 
)

References FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x1_to_2x1(), FLA_Determine_blocksize(), FLA_Gemm_internal(), FLA_Obj_length(), FLA_ONE, FLA_Part_1x2(), FLA_Part_2x1(), FLA_Repart_1x2_to_1x3(), FLA_Repart_2x1_to_3x1(), and FLA_Scal_internal().

Referenced by FLA_Gemm_th().

16 {
17  FLA_Obj AT, A0,
18  AB, A1,
19  A2;
20 
21  FLA_Obj BL, BR, B0, B1, B2;
22 
23  dim_t b;
24 
25  FLA_Scal_internal( beta, C,
26  FLA_Cntl_sub_scal( cntl ) );
27 
28  FLA_Part_2x1( A, &AT,
29  &AB, 0, FLA_BOTTOM );
30 
31  FLA_Part_1x2( B, &BL, &BR, 0, FLA_RIGHT );
32 
33  while ( FLA_Obj_length( AB ) < FLA_Obj_length( A ) ){
34 
35  b = FLA_Determine_blocksize( AT, FLA_TOP, FLA_Cntl_blocksize( cntl ) );
36 
37  FLA_Repart_2x1_to_3x1( AT, &A0,
38  &A1,
39  /* ** */ /* ** */
40  AB, &A2, b, FLA_TOP );
41 
42  FLA_Repart_1x2_to_1x3( BL, /**/ BR, &B0, &B1, /**/ &B2,
43  b, FLA_LEFT );
44 
45  /*------------------------------------------------------------*/
46 
47  /* C = alpha * A1' * B1' + C; */
48  FLA_Gemm_internal( FLA_TRANSPOSE, FLA_CONJ_TRANSPOSE,
49  alpha, A1, B1, FLA_ONE, C,
50  FLA_Cntl_sub_gemm( cntl ) );
51 
52  /*------------------------------------------------------------*/
53 
54  FLA_Cont_with_3x1_to_2x1( &AT, A0,
55  /* ** */ /* ** */
56  A1,
57  &AB, A2, FLA_BOTTOM );
58 
59  FLA_Cont_with_1x3_to_1x2( &BL, /**/ &BR, B0, /**/ B1, B2,
60  FLA_RIGHT );
61 
62  }
63 
64  return FLA_SUCCESS;
65 }
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_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
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
unsigned long dim_t
Definition: FLA_type_defs.h:71
dim_t FLA_Determine_blocksize(FLA_Obj A_unproc, FLA_Quadrant to_dir, fla_blocksize_t *cntl_blocksizes)
Definition: FLA_Blocksize.c:234
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_Obj FLA_ONE
Definition: FLA_Init.c:18
Definition: FLA_type_defs.h:158
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
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
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_Scal_internal(FLA_Obj alpha, FLA_Obj A, fla_scal_t *cntl)
Definition: FLA_Scal_internal.c:16
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116