libflame  revision_anchor
Functions
FLA_Gemv_n.h File Reference

(r)

Go to the source code of this file.

Functions

FLA_Error FLA_Gemv_n_blk_var1 (FLA_Obj alpha, FLA_Obj A, FLA_Obj x, FLA_Obj beta, FLA_Obj y, fla_gemv_t *cntl)
 
FLA_Error FLA_Gemv_n_blk_var2 (FLA_Obj alpha, FLA_Obj A, FLA_Obj x, FLA_Obj beta, FLA_Obj y, fla_gemv_t *cntl)
 
FLA_Error FLA_Gemv_n_blk_var5 (FLA_Obj alpha, FLA_Obj A, FLA_Obj x, FLA_Obj beta, FLA_Obj y, fla_gemv_t *cntl)
 
FLA_Error FLA_Gemv_n_blk_var6 (FLA_Obj alpha, FLA_Obj A, FLA_Obj x, FLA_Obj beta, FLA_Obj y, fla_gemv_t *cntl)
 

Function Documentation

◆ FLA_Gemv_n_blk_var1()

FLA_Error FLA_Gemv_n_blk_var1 ( FLA_Obj  alpha,
FLA_Obj  A,
FLA_Obj  x,
FLA_Obj  beta,
FLA_Obj  y,
fla_gemv_t cntl 
)

References FLA_Cont_with_3x1_to_2x1(), FLA_Determine_blocksize(), FLA_Gemv_internal(), FLA_Obj_length(), FLA_Part_2x1(), FLA_Repart_2x1_to_3x1(), and y1.

Referenced by FLA_Gemv_n().

14 {
15  FLA_Obj AT, A0,
16  AB, A1,
17  A2;
18 
19  FLA_Obj yT, y0,
20  yB, y1,
21  y2;
22 
23  dim_t b;
24 
25  FLA_Part_2x1( A, &AT,
26  &AB, 0, FLA_TOP );
27 
28  FLA_Part_2x1( y, &yT,
29  &yB, 0, FLA_TOP );
30 
31  while ( FLA_Obj_length( AT ) < FLA_Obj_length( A ) ){
32 
33  b = FLA_Determine_blocksize( AB, FLA_BOTTOM, FLA_Cntl_blocksize( cntl ) );
34 
35  FLA_Repart_2x1_to_3x1( AT, &A0,
36  /* ** */ /* ** */
37  &A1,
38  AB, &A2, b, FLA_BOTTOM );
39 
40  FLA_Repart_2x1_to_3x1( yT, &y0,
41  /* ** */ /* ** */
42  &y1,
43  yB, &y2, b, FLA_BOTTOM );
44 
45  /*------------------------------------------------------------*/
46 
47  /* y1 = alpha * A1 * x + y1; */
48  FLA_Gemv_internal( FLA_NO_TRANSPOSE,
49  alpha, A1, x, beta, y1,
50  FLA_Cntl_sub_gemv( cntl ) );
51 
52  /*------------------------------------------------------------*/
53 
54  FLA_Cont_with_3x1_to_2x1( &AT, A0,
55  A1,
56  /* ** */ /* ** */
57  &AB, A2, FLA_TOP );
58 
59  FLA_Cont_with_3x1_to_2x1( &yT, y0,
60  y1,
61  /* ** */ /* ** */
62  &yB, y2, FLA_TOP );
63 
64  }
65 
66  return FLA_SUCCESS;
67 }
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_Gemv_internal(FLA_Trans transa, FLA_Obj alpha, FLA_Obj A, FLA_Obj x, FLA_Obj beta, FLA_Obj y, fla_gemv_t *cntl)
Definition: FLA_Gemv_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
Definition: FLA_type_defs.h:158
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
double *restrict y1
Definition: bl1_dotsv2.c:145

◆ FLA_Gemv_n_blk_var2()

FLA_Error FLA_Gemv_n_blk_var2 ( FLA_Obj  alpha,
FLA_Obj  A,
FLA_Obj  x,
FLA_Obj  beta,
FLA_Obj  y,
fla_gemv_t cntl 
)

References FLA_Cont_with_3x1_to_2x1(), FLA_Determine_blocksize(), FLA_Gemv_internal(), FLA_Obj_length(), FLA_Part_2x1(), FLA_Repart_2x1_to_3x1(), and y1.

Referenced by FLA_Gemv_n().

16 {
17  FLA_Obj AT, A0,
18  AB, A1,
19  A2;
20 
21  FLA_Obj yT, y0,
22  yB, y1,
23  y2;
24 
25  dim_t b;
26 
27  FLA_Part_2x1( A, &AT,
28  &AB, 0, FLA_BOTTOM );
29 
30  FLA_Part_2x1( y, &yT,
31  &yB, 0, FLA_BOTTOM );
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_2x1_to_3x1( yT, &y0,
43  &y1,
44  /* ** */ /* ** */
45  yB, &y2, b, FLA_TOP );
46 
47  /*------------------------------------------------------------*/
48 
49  /* y1 = alpha * A1 * x + y1; */
50  FLA_Gemv_internal( FLA_NO_TRANSPOSE,
51  alpha, A1, x, beta, y1,
52  FLA_Cntl_sub_gemv( cntl ) );
53 
54  /*------------------------------------------------------------*/
55 
56  FLA_Cont_with_3x1_to_2x1( &AT, A0,
57  /* ** */ /* ** */
58  A1,
59  &AB, A2, FLA_BOTTOM );
60 
61  FLA_Cont_with_3x1_to_2x1( &yT, y0,
62  /* ** */ /* ** */
63  y1,
64  &yB, y2, FLA_BOTTOM );
65 
66  }
67 
68  return FLA_SUCCESS;
69 }
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_Gemv_internal(FLA_Trans transa, FLA_Obj alpha, FLA_Obj A, FLA_Obj x, FLA_Obj beta, FLA_Obj y, fla_gemv_t *cntl)
Definition: FLA_Gemv_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
Definition: FLA_type_defs.h:158
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
double *restrict y1
Definition: bl1_dotsv2.c:145

◆ FLA_Gemv_n_blk_var5()

FLA_Error FLA_Gemv_n_blk_var5 ( FLA_Obj  alpha,
FLA_Obj  A,
FLA_Obj  x,
FLA_Obj  beta,
FLA_Obj  y,
fla_gemv_t cntl 
)

References FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x1_to_2x1(), FLA_Determine_blocksize(), FLA_Gemv_internal(), FLA_Obj_width(), FLA_ONE, FLA_Part_1x2(), FLA_Part_2x1(), FLA_Repart_1x2_to_1x3(), FLA_Repart_2x1_to_3x1(), FLA_Scal_internal(), and x1.

Referenced by FLA_Gemv_n().

14 {
15  FLA_Obj AL, AR, A0, A1, A2;
16 
17  FLA_Obj xT, x0,
18  xB, x1,
19  x2;
20 
21  dim_t b;
22 
23  FLA_Scal_internal( beta, y,
24  FLA_Cntl_sub_scal( cntl ) );
25 
26  FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT );
27 
28  FLA_Part_2x1( x, &xT,
29  &xB, 0, FLA_TOP );
30 
31  while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){
32 
33  b = FLA_Determine_blocksize( AR, FLA_RIGHT, FLA_Cntl_blocksize( cntl ) );
34 
35  FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &A1, &A2,
36  b, FLA_RIGHT );
37 
38  FLA_Repart_2x1_to_3x1( xT, &x0,
39  /* ** */ /* ** */
40  &x1,
41  xB, &x2, b, FLA_BOTTOM );
42 
43  /*------------------------------------------------------------*/
44 
45  /* y = alpha * A1 * x1 + y; */
46  FLA_Gemv_internal( FLA_NO_TRANSPOSE,
47  alpha, A1, x1, FLA_ONE, y,
48  FLA_Cntl_sub_gemv( cntl ) );
49 
50  /*------------------------------------------------------------*/
51 
52  FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, A1, /**/ A2,
53  FLA_LEFT );
54 
55  FLA_Cont_with_3x1_to_2x1( &xT, x0,
56  x1,
57  /* ** */ /* ** */
58  &xB, x2, FLA_TOP );
59 
60  }
61 
62  return FLA_SUCCESS;
63 }
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_Gemv_internal(FLA_Trans transa, FLA_Obj alpha, FLA_Obj A, FLA_Obj x, FLA_Obj beta, FLA_Obj y, fla_gemv_t *cntl)
Definition: FLA_Gemv_internal.c:16
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
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
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
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
x1
Definition: bl1_dotsv2.c:374
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

◆ FLA_Gemv_n_blk_var6()

FLA_Error FLA_Gemv_n_blk_var6 ( FLA_Obj  alpha,
FLA_Obj  A,
FLA_Obj  x,
FLA_Obj  beta,
FLA_Obj  y,
fla_gemv_t cntl 
)

References FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x1_to_2x1(), FLA_Determine_blocksize(), FLA_Gemv_internal(), FLA_Obj_width(), FLA_ONE, FLA_Part_1x2(), FLA_Part_2x1(), FLA_Repart_1x2_to_1x3(), FLA_Repart_2x1_to_3x1(), FLA_Scal_internal(), and x1.

Referenced by FLA_Gemv_n().

16 {
17  FLA_Obj AL, AR, A0, A1, A2;
18 
19  FLA_Obj xT, x0,
20  xB, x1,
21  x2;
22 
23  dim_t b;
24 
25  FLA_Scal_internal( beta, y,
26  FLA_Cntl_sub_scal( cntl ) );
27 
28  FLA_Part_1x2( A, &AL, &AR, 0, FLA_RIGHT );
29 
30  FLA_Part_2x1( x, &xT,
31  &xB, 0, FLA_BOTTOM );
32 
33  while ( FLA_Obj_width( AR ) < FLA_Obj_width( A ) ){
34 
35  b = FLA_Determine_blocksize( AL, FLA_LEFT, FLA_Cntl_blocksize( cntl ) );
36 
37  FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, &A1, /**/ &A2,
38  b, FLA_LEFT );
39 
40  FLA_Repart_2x1_to_3x1( xT, &x0,
41  &x1,
42  /* ** */ /* ** */
43  xB, &x2, b, FLA_TOP );
44 
45  /*------------------------------------------------------------*/
46 
47  /* y = alpha * A1 * x1 + y; */
48  FLA_Gemv_internal( FLA_NO_TRANSPOSE,
49  alpha, A1, x1, FLA_ONE, y,
50  FLA_Cntl_sub_gemv( cntl ) );
51 
52  /*------------------------------------------------------------*/
53 
54  FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, /**/ A1, A2,
55  FLA_RIGHT );
56 
57  FLA_Cont_with_3x1_to_2x1( &xT, x0,
58  /* ** */ /* ** */
59  x1,
60  &xB, x2, FLA_BOTTOM );
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_Gemv_internal(FLA_Trans transa, FLA_Obj alpha, FLA_Obj A, FLA_Obj x, FLA_Obj beta, FLA_Obj y, fla_gemv_t *cntl)
Definition: FLA_Gemv_internal.c:16
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
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
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
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
x1
Definition: bl1_dotsv2.c:374
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