libflame  revision_anchor
Functions
FLA_Syr2k_external.c File Reference

(r)

Functions

FLA_Error FLA_Syr2k_external (FLA_Uplo uplo, FLA_Trans trans, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C)
 

Function Documentation

◆ FLA_Syr2k_external()

FLA_Error FLA_Syr2k_external ( FLA_Uplo  uplo,
FLA_Trans  trans,
FLA_Obj  alpha,
FLA_Obj  A,
FLA_Obj  B,
FLA_Obj  beta,
FLA_Obj  C 
)
14 {
15  FLA_Datatype datatype;
16  int k_AB;
17  int m_A, n_A;
18  int m_C;
19  int rs_A, cs_A;
20  int rs_B, cs_B;
21  int rs_C, cs_C;
22  uplo1_t blis_uplo;
23  trans1_t blis_trans;
24 
25  if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
26  FLA_Syr2k_check( uplo, trans, alpha, A, B, beta, C );
27 
28  if ( FLA_Obj_has_zero_dim( C ) ) return FLA_SUCCESS;
29 
30  if ( FLA_Obj_has_zero_dim( A ) || FLA_Obj_has_zero_dim( B ) )
31  {
32  FLA_Scal_external( beta, C );
33  return FLA_SUCCESS;
34  }
35 
36  datatype = FLA_Obj_datatype( A );
37 
38  m_A = FLA_Obj_length( A );
39  n_A = FLA_Obj_width( A );
40  rs_A = FLA_Obj_row_stride( A );
41  cs_A = FLA_Obj_col_stride( A );
42 
43  rs_B = FLA_Obj_row_stride( B );
44  cs_B = FLA_Obj_col_stride( B );
45 
46  m_C = FLA_Obj_length( C );
47  rs_C = FLA_Obj_row_stride( C );
48  cs_C = FLA_Obj_col_stride( C );
49 
50  if ( trans == FLA_NO_TRANSPOSE )
51  k_AB = n_A;
52  else
53  k_AB = m_A;
54 
55  FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo );
56  FLA_Param_map_flame_to_blis_trans( trans, &blis_trans );
57 
58 
59  switch( datatype ){
60 
61  case FLA_FLOAT:
62  {
63  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
64  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
65  float *buff_C = ( float * ) FLA_FLOAT_PTR( C );
66  float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
67  float *buff_beta = ( float * ) FLA_FLOAT_PTR( beta );
68 
69  bl1_ssyr2k( blis_uplo,
70  blis_trans,
71  m_C,
72  k_AB,
73  buff_alpha,
74  buff_A, rs_A, cs_A,
75  buff_B, rs_B, cs_B,
76  buff_beta,
77  buff_C, rs_C, cs_C );
78 
79  break;
80  }
81 
82  case FLA_DOUBLE:
83  {
84  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
85  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
86  double *buff_C = ( double * ) FLA_DOUBLE_PTR( C );
87  double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
88  double *buff_beta = ( double * ) FLA_DOUBLE_PTR( beta );
89 
90  bl1_dsyr2k( blis_uplo,
91  blis_trans,
92  m_C,
93  k_AB,
94  buff_alpha,
95  buff_A, rs_A, cs_A,
96  buff_B, rs_B, cs_B,
97  buff_beta,
98  buff_C, rs_C, cs_C );
99 
100  break;
101  }
102 
103  case FLA_COMPLEX:
104  {
105  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
106  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
107  scomplex *buff_C = ( scomplex * ) FLA_COMPLEX_PTR( C );
108  scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha );
109  scomplex *buff_beta = ( scomplex * ) FLA_COMPLEX_PTR( beta );
110 
111  bl1_csyr2k( blis_uplo,
112  blis_trans,
113  m_C,
114  k_AB,
115  buff_alpha,
116  buff_A, rs_A, cs_A,
117  buff_B, rs_B, cs_B,
118  buff_beta,
119  buff_C, rs_C, cs_C );
120 
121  break;
122  }
123  case FLA_DOUBLE_COMPLEX:
124  {
125  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
126  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
127  dcomplex *buff_C = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( C );
128  dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha );
129  dcomplex *buff_beta = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( beta );
130 
131  bl1_zsyr2k( blis_uplo,
132  blis_trans,
133  m_C,
134  k_AB,
135  buff_alpha,
136  buff_A, rs_A, cs_A,
137  buff_B, rs_B, cs_B,
138  buff_beta,
139  buff_C, rs_C, cs_C );
140 
141  break;
142  }
143 
144  }
145 
146  return FLA_SUCCESS;
147 }
FLA_Error FLA_Syr2k_check(FLA_Uplo uplo, FLA_Trans trans, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C)
Definition: FLA_Syr2k_check.c:13
FLA_Error FLA_Scal_external(FLA_Obj alpha, FLA_Obj A)
Definition: FLA_Scal_external.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition: FLA_Query.c:400
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
void FLA_Param_map_flame_to_blis_trans(FLA_Trans trans, trans1_t *blis_trans)
Definition: FLA_Param.c:245
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
void FLA_Param_map_flame_to_blis_uplo(FLA_Uplo uplo, uplo1_t *blis_uplo)
Definition: FLA_Param.c:285
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
int FLA_Datatype
Definition: FLA_type_defs.h:49
void bl1_csyr2k(uplo1_t uplo, trans1_t trans, int m, int k, scomplex *alpha, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs, scomplex *beta, scomplex *c, int c_rs, int c_cs)
Definition: bl1_syr2k.c:465
void bl1_ssyr2k(uplo1_t uplo, trans1_t trans, int m, int k, float *alpha, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs, float *beta, float *c, int c_rs, int c_cs)
Definition: bl1_syr2k.c:13
void bl1_dsyr2k(uplo1_t uplo, trans1_t trans, int m, int k, double *alpha, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs, double *beta, double *c, int c_rs, int c_cs)
Definition: bl1_syr2k.c:239
void bl1_zsyr2k(uplo1_t uplo, trans1_t trans, int m, int k, dcomplex *alpha, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs, dcomplex *beta, dcomplex *c, int c_rs, int c_cs)
Definition: bl1_syr2k.c:691
uplo1_t
Definition: blis_type_defs.h:61
trans1_t
Definition: blis_type_defs.h:53
Definition: blis_type_defs.h:138
Definition: blis_type_defs.h:133

References bl1_csyr2k(), bl1_dsyr2k(), bl1_ssyr2k(), bl1_zsyr2k(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_trans(), FLA_Param_map_flame_to_blis_uplo(), FLA_Scal_external(), and FLA_Syr2k_check().

Referenced by FLA_Syr2k(), FLA_Syr2k_ln_task(), FLA_Syr2k_lt_task(), FLA_Syr2k_task(), FLA_Syr2k_un_task(), and FLA_Syr2k_ut_task().