libflame  revision_anchor
Functions
FLA_Copy_external.c File Reference

(r)

Functions

FLA_Error FLA_Copy_external (FLA_Obj A, FLA_Obj B)
 

Function Documentation

◆ FLA_Copy_external()

FLA_Error FLA_Copy_external ( FLA_Obj  A,
FLA_Obj  B 
)

References bl1_ccopymt(), bl1_cdcopymt(), bl1_cscopymt(), bl1_czcopymt(), bl1_dccopymt(), bl1_dcopymt(), bl1_dscopymt(), bl1_dzcopymt(), bl1_icopymt(), bl1_sccopymt(), bl1_scopymt(), bl1_sdcopymt(), bl1_szcopymt(), bl1_zccopymt(), bl1_zcopymt(), bl1_zdcopymt(), bl1_zscopymt(), FLA_Check_error_level(), FLA_Copy_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_is_conformal_to(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Param_map_flame_to_blis_trans().

Referenced by FLA_Accum_T_UT_fc_unb_var1(), FLA_Accum_T_UT_fr_unb_var1(), FLA_Apply_H2_UT_l_unb_var1(), FLA_Apply_H2_UT_piv_row(), FLA_Apply_H2_UT_r_unb_var1(), FLA_Apply_HUD_UT_lh_unb_var1(), FLA_Bidiag_UT_recover_tau_submatrix(), FLA_CAQR2_UT_unb_var1(), FLA_Chol_solve(), FLA_Copy(), FLA_Copy_task(), FLA_Eig_gest_il_unb_var3(), FLA_Eig_gest_il_unb_var4(), FLA_Eig_gest_il_unb_var5(), FLA_Eig_gest_iu_unb_var3(), FLA_Eig_gest_iu_unb_var4(), FLA_Eig_gest_iu_unb_var5(), FLA_Eig_gest_nl_unb_var4(), FLA_Eig_gest_nl_unb_var5(), FLA_Eig_gest_nu_unb_var4(), FLA_Eig_gest_nu_unb_var5(), FLA_Hess_UT_blf_var2(), FLA_Hess_UT_blf_var3(), FLA_Hess_UT_blf_var4(), FLA_Hess_UT_blk_var1(), FLA_Hess_UT_blk_var2(), FLA_Hess_UT_blk_var3(), FLA_Hess_UT_blk_var4(), FLA_Hess_UT_recover_tau_submatrix(), FLA_LQ_UT_solve(), FLA_LU_nopiv_solve(), FLA_LU_piv_copy_task(), FLA_LU_piv_solve(), FLA_QR_UT_recover_tau_submatrix(), FLA_QR_UT_solve(), FLA_SA_LU_unb(), FLA_Tridiag_UT_l_blf_var3(), FLA_Tridiag_UT_l_blk_var3(), FLA_Tridiag_UT_recover_tau_submatrix(), FLA_Trmvsx_external(), FLA_Trsvsx_external(), FLA_UDdate_UT_solve(), and FLASH_Copy_hierarchy().

14 {
15  FLA_Datatype dt_A;
16  FLA_Datatype dt_B;
17  int m_B, n_B;
18  int rs_A, cs_A;
19  int rs_B, cs_B;
20  trans1_t blis_trans;
21 
22  if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
23  FLA_Copy_check( A, B );
24 
25  if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS;
26 
27  dt_A = FLA_Obj_datatype( A );
28  dt_B = FLA_Obj_datatype( B );
29 
30  rs_A = FLA_Obj_row_stride( A );
31  cs_A = FLA_Obj_col_stride( A );
32 
33  m_B = FLA_Obj_length( B );
34  n_B = FLA_Obj_width( B );
35  rs_B = FLA_Obj_row_stride( B );
36  cs_B = FLA_Obj_col_stride( B );
37 
38  if ( FLA_Obj_is_conformal_to( FLA_NO_TRANSPOSE, A, B ) )
39  FLA_Param_map_flame_to_blis_trans( FLA_NO_TRANSPOSE, &blis_trans );
40  else // if ( FLA_Obj_is_conformal_to( FLA_TRANSPOSE, A, B ) )
41  FLA_Param_map_flame_to_blis_trans( FLA_TRANSPOSE, &blis_trans );
42 
43  // If A is of type FLA_CONSTANT, then we have to proceed based on the
44  // datatype of B.
45  if ( dt_A == FLA_CONSTANT )
46  {
47  if ( dt_B == FLA_FLOAT )
48  {
49  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
50  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
51 
52  bl1_scopymt( blis_trans,
53  m_B,
54  n_B,
55  buff_A, rs_A, cs_A,
56  buff_B, rs_B, cs_B );
57  }
58  else if ( dt_B == FLA_DOUBLE )
59  {
60  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
61  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
62 
63  bl1_dcopymt( blis_trans,
64  m_B,
65  n_B,
66  buff_A, rs_A, cs_A,
67  buff_B, rs_B, cs_B );
68  }
69  else if ( dt_B == FLA_COMPLEX )
70  {
71  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
72  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
73 
74  bl1_ccopymt( blis_trans,
75  m_B,
76  n_B,
77  buff_A, rs_A, cs_A,
78  buff_B, rs_B, cs_B );
79  }
80  else if ( dt_B == FLA_DOUBLE_COMPLEX )
81  {
82  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
83  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
84 
85  bl1_zcopymt( blis_trans,
86  m_B,
87  n_B,
88  buff_A, rs_A, cs_A,
89  buff_B, rs_B, cs_B );
90  }
91  }
92  else if ( dt_A == FLA_INT )
93  {
94  int* buff_A = ( int * ) FLA_INT_PTR( A );
95  int* buff_B = ( int * ) FLA_INT_PTR( B );
96 
97  bl1_icopymt( blis_trans,
98  m_B,
99  n_B,
100  buff_A, rs_A, cs_A,
101  buff_B, rs_B, cs_B );
102  }
103  else if ( dt_A == FLA_FLOAT )
104  {
105  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
106 
107  if ( dt_B == FLA_FLOAT )
108  {
109  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
110 
111  bl1_scopymt( blis_trans,
112  m_B,
113  n_B,
114  buff_A, rs_A, cs_A,
115  buff_B, rs_B, cs_B );
116  }
117  else if ( dt_B == FLA_DOUBLE )
118  {
119  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
120 
121  bl1_sdcopymt( blis_trans,
122  m_B,
123  n_B,
124  buff_A, rs_A, cs_A,
125  buff_B, rs_B, cs_B );
126  }
127  else if ( dt_B == FLA_COMPLEX )
128  {
129  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
130 
131  bl1_sccopymt( blis_trans,
132  m_B,
133  n_B,
134  buff_A, rs_A, cs_A,
135  buff_B, rs_B, cs_B );
136  }
137  else if ( dt_B == FLA_DOUBLE_COMPLEX )
138  {
139  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
140 
141  bl1_szcopymt( blis_trans,
142  m_B,
143  n_B,
144  buff_A, rs_A, cs_A,
145  buff_B, rs_B, cs_B );
146  }
147  }
148  else if ( dt_A == FLA_DOUBLE )
149  {
150  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
151 
152  if ( dt_B == FLA_FLOAT )
153  {
154  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
155 
156  bl1_dscopymt( blis_trans,
157  m_B,
158  n_B,
159  buff_A, rs_A, cs_A,
160  buff_B, rs_B, cs_B );
161  }
162  else if ( dt_B == FLA_DOUBLE )
163  {
164  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
165 
166  bl1_dcopymt( blis_trans,
167  m_B,
168  n_B,
169  buff_A, rs_A, cs_A,
170  buff_B, rs_B, cs_B );
171  }
172  else if ( dt_B == FLA_COMPLEX )
173  {
174  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
175 
176  bl1_dccopymt( blis_trans,
177  m_B,
178  n_B,
179  buff_A, rs_A, cs_A,
180  buff_B, rs_B, cs_B );
181  }
182  else if ( dt_B == FLA_DOUBLE_COMPLEX )
183  {
184  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
185 
186  bl1_dzcopymt( blis_trans,
187  m_B,
188  n_B,
189  buff_A, rs_A, cs_A,
190  buff_B, rs_B, cs_B );
191  }
192  }
193  else if ( dt_A == FLA_COMPLEX )
194  {
195  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
196 
197  if ( dt_B == FLA_FLOAT )
198  {
199  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
200 
201  bl1_cscopymt( blis_trans,
202  m_B,
203  n_B,
204  buff_A, rs_A, cs_A,
205  buff_B, rs_B, cs_B );
206  }
207  else if ( dt_B == FLA_DOUBLE )
208  {
209  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
210 
211  bl1_cdcopymt( blis_trans,
212  m_B,
213  n_B,
214  buff_A, rs_A, cs_A,
215  buff_B, rs_B, cs_B );
216  }
217  else if ( dt_B == FLA_COMPLEX )
218  {
219  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
220 
221  bl1_ccopymt( blis_trans,
222  m_B,
223  n_B,
224  buff_A, rs_A, cs_A,
225  buff_B, rs_B, cs_B );
226  }
227  else if ( dt_B == FLA_DOUBLE_COMPLEX )
228  {
229  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
230 
231  bl1_czcopymt( blis_trans,
232  m_B,
233  n_B,
234  buff_A, rs_A, cs_A,
235  buff_B, rs_B, cs_B );
236  }
237  }
238  else if ( dt_A == FLA_DOUBLE_COMPLEX )
239  {
240  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
241 
242  if ( dt_B == FLA_FLOAT )
243  {
244  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
245 
246  bl1_zscopymt( blis_trans,
247  m_B,
248  n_B,
249  buff_A, rs_A, cs_A,
250  buff_B, rs_B, cs_B );
251  }
252  else if ( dt_B == FLA_DOUBLE )
253  {
254  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
255 
256  bl1_zdcopymt( blis_trans,
257  m_B,
258  n_B,
259  buff_A, rs_A, cs_A,
260  buff_B, rs_B, cs_B );
261  }
262  else if ( dt_B == FLA_COMPLEX )
263  {
264  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
265 
266  bl1_zccopymt( blis_trans,
267  m_B,
268  n_B,
269  buff_A, rs_A, cs_A,
270  buff_B, rs_B, cs_B );
271  }
272  else if ( dt_B == FLA_DOUBLE_COMPLEX )
273  {
274  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
275 
276  bl1_zcopymt( blis_trans,
277  m_B,
278  n_B,
279  buff_A, rs_A, cs_A,
280  buff_B, rs_B, cs_B );
281  }
282  }
283 
284  return FLA_SUCCESS;
285 }
void bl1_icopymt(trans1_t trans, int m, int n, int *a, int a_rs, int a_cs, int *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:13
void bl1_dzcopymt(trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:1032
void bl1_sccopymt(trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:562
void FLA_Param_map_flame_to_blis_trans(FLA_Trans trans, trans1_t *blis_trans)
Definition: FLA_Param.c:245
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
void bl1_zccopymt(trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:1300
void bl1_dcopymt(trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:148
trans1_t
Definition: blis_type_defs.h:52
FLA_Bool FLA_Obj_is_conformal_to(FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition: FLA_Query.c:438
FLA_Error FLA_Copy_check(FLA_Obj A, FLA_Obj B)
Definition: FLA_Copy_check.c:13
void bl1_czcopymt(trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:1234
void bl1_cdcopymt(trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:964
void bl1_szcopymt(trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:696
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition: FLA_Query.c:400
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void bl1_sdcopymt(trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:428
void bl1_ccopymt(trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:215
void bl1_zscopymt(trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:762
Definition: blis_type_defs.h:132
void bl1_zcopymt(trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:286
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
void bl1_dscopymt(trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:494
int FLA_Datatype
Definition: FLA_type_defs.h:49
void bl1_scopymt(trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:81
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
void bl1_cscopymt(trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:628
void bl1_dccopymt(trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:898
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
Definition: blis_type_defs.h:137
void bl1_zdcopymt(trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymt.c:1098