libflame  revision_anchor
Functions
FLA_Copyt_external.c File Reference

(r)

Functions

FLA_Error FLA_Copyt_external (FLA_Trans trans, FLA_Obj A, FLA_Obj B)
 

Function Documentation

◆ FLA_Copyt_external()

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

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_Copyt_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), 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_Copy_buffer_to_object(), FLA_Copy_object_to_buffer(), FLA_Copyt(), FLA_Copyt_c_task(), FLA_Copyt_h_task(), FLA_Copyt_n_task(), FLA_Copyt_t_task(), FLA_Copyt_task(), FLA_Hess_UT_blk_var5(), FLA_LQ_UT_blk_var2(), FLA_LQ_UT_unb_var2(), FLA_Obj_create_copy_of(), FLA_QR_UT_blk_var2(), FLA_QR_UT_piv_unb_var1(), FLA_QR_UT_piv_unb_var2(), and FLA_QR_UT_unb_var2().